Introduction

1. Introduction

2. Definitions

Software Construction is the detailed creation of working meaningful software through a combination of coding, verification, unit testing, integration testing, and debugging.

— SWEBOK

Software evolution is the term used in software engineering (specifically software maintenance) to refer to all programming activity that is intended to generate a new software version from an earlier operational version.

— Lehman & Ramil 2000

3. A Software Engineering Activity

software construction
Figure 1. Software Construction and Evolution
  • An activity is not a phase.

  • Referring to the construction as an activity does not imply a distinct phase.

4. Activities versus Phases

waterfall model
Figure 2. The Waterfall Model
  • In the past, Implementation and Maintenance were seen as phases of the development process.

  • Activity ≠ Phase

  • Software Construction and Evolution are more than just creating and changing code!

5. Methods, Activities, Techniques and Tools

  • Software Construction and Evolution follow a Method

  • Methods organize Activities

  • Activities use Techniques

  • Techniques are supported by Tools

Methods, Activities, Techniques, and Tools
Figure 3. Methods, Activities, Techniques, and Tools

6. Example: The Test-Driven Development Method

Activities, Techniques, and Tools of the TDD Method
Figure 4. Activities, Techniques, and Tools of the TDD Method

7. Development Methods

A development method defines the way a software product is developed:
  • Which activities are concerned

  • The order they are performed

  • Their expected degree of completeness

  • The development planning

 
 

Examples

Test Driven Development (TDD), eXtreme Programming (XP), DevOps, Continuous Integration

  • The way: the software development process

  • Development planning: defines the order in which components are created and integrated, the software quality management processes, the allocation of task assignments to specific software engineers

8. Activities

Activities are the different tasks realized during the software development process

 
 

Examples

Unit and Integration Testing, Coding, Maintenance, Building, Improving, Designing, etc.

Activities: only related to construction and evolution

9. Techniques

A skillful or efficient way to solve problems

 
 

Examples

Mapping Design to Code, Defensive Programming, Refactorings, Assertive Programming Design Patterns, Automated Code Generation, Logging, etc.

10. Tools

JUnit
Git

Tools help developers to apply one or more techniques


Examples

Java, IntelliJ, Maven, Git, JUnit, PMD, etc.

11. Software Construction and Evolution Methods

12. The Unified Modeling Language (UML)

uml logo
  • Not a development method, but a modeling language.

  • Current version: 2.5.

  • A OMG standard containing:

    • A notation (concrete syntax)

    • A meta-model (abstract syntax)

    • Almost no semantics!

  • Several diagrams (concerns), one model.

  • Several actors and processes, one syntax.

    • Reduces the learning curve, but:

    • Increases misinterpretation and confusion!

13. Agile Methods

agile
Agile Methods
  • Development approaches which involve the collaborative effort of self-organizing and cross-functional teams and their customer.

  • Advocates adaptive planning, evolutionary development, early delivery, and continual improvement.

  • Encourages rapid and flexible response to change.

  • Will be the subject of the next lectures.

Agile software development comprises various approaches to software development under which requirements and solutions evolve through the collaborative effort of self-organizing and cross-functional teams and their customer(s)/end user(s).[1] It advocates adaptive planning, evolutionary development, early delivery, and continual improvement, and it encourages rapid and flexible response to change.[2][further explanation needed]

The term agile (sometimes written Agile)[3] was popularized, in this context, by the Manifesto for Agile Software Development.[4] The values and principles espoused in this manifesto were derived from and underpin a broad range of software development frameworks, including Scrum and Kanban.[5][6]

While there is much anecdotal evidence that adopting agile practices and values improves the agility of software professionals, teams and organizations, some empirical studies have disputed that evidence.[7][8]

14. Agile Methods

xp logo
  • Examples: Extreme Programming (XP), Scrum, Lean, Kanban, Rapid application development (RAD), etc.

  • Practices:

    • Pair programming

    • Automatic Testing

    • Continuous Design Improvement

    • Small releases

    • Collective code ownership

    • Simple design

15. Test Driven Development

tdd guilty
Test Driven Development
  • An Agile Development Method

  • Relies on the repetition of a very short development cycle

  • Requirements are turned into very specific test cases

  • Will be the subject of the next lectures.

16. Test Driven Development

tdd logo
Development cycle:
  1. Add a test

  2. Write the code

  3. Run tests

  4. Improve code

  5. Repeat

17. Continuous Integration

ci logo
Continuous Integration
  • Software development practice.

  • Developers integrate their work frequently, leading to multiple integrations per day.

  • Each integration is verified by an automated build.

18. Continuous Integration

continuous integration
Main components:
  • Control Version System (Repository)

  • CI Server

  • Build Scripts

  • Feedback Mechanisms

  • Test Machine

  • Build Machine

19. DevOps

devops logo
DevOps
  • Set of practices that combines software development (Dev) and information-technology operations (Ops).

  • Aims to shorten the systems development life cycle and provide continuous delivery with high software quality.

Going beyond the scope of software construction

20. DevOps

DevOps
Process:
  • Coding

  • Building

  • Testing

  • Packaging

  • Releasing

  • Configuring

  • Monitoring

  • Coding – code development and review, source code management tools, code merging

  • Building – continuous integration tools, build status

  • Testing – continuous testing tools that provide quick and timely feedback on business risks

  • Packaging – artifact repository, application pre-deployment staging

  • Releasing – change management, release approvals, release automation

  • Configuring – infrastructure configuration and management, infrastructure as code tools

  • Monitoring – applications performance monitoring, end-user experience

21. Plan

  • Introduction

  • Methods

  • Activities

  • Techniques

  • Tools

  • Conclusion

22. Software Construction and Evolution Activities

23. Software Construction and Evolution Activities

24. Software Coding and debugging

Software Coding
  • The activity of designing and building an executable computer program for accomplishing a specific computing task

  • Also comprehends writing comments, documenting APIs, and naming programming elements.

Debugging
  • Activity of identifying, analyzing and removing errors.

25. Testing

Testing
  • Activity that checks whether the actual results match the expected results (w.r.t. the Design Model) and to ensure that the software system is reliable.

Implementation Modeling
  • Activity of using a high-level language to build simplified version of software implementation aspects.

  • Similar to software design, but: lower level, less abstract, language dependent. TODO: add example

26. Build Management

Build Management:
  • Activity that generates executable software from source code.

  • Building software is not only compilation: dependency management, code generation, unit testing, configurations, etc.

Software Configuration Management
  • Activity of tracking and controlling changes in the source code.

  • If something goes wrong, it can determine what was changed and by who.

In software engineering, software configuration management (SCM or S/W CM) [1] is the task of tracking and controlling changes in the software, part of the larger cross-disciplinary field of configuration management.[2] SCM practices include revision control and the establishment of baselines. If something goes wrong, SCM can determine what was changed and who changed it. If a configuration is working well, SCM can determine how to replicate it across many hosts.

27. Refactoring

cleaning
Code improvement
  • Activity of cleaning and improving the quality of existing code.

28. Software Construction and Evolution Techniques

29. Mapping Designs to Code

mapping design to code
Mapping Designs to Code:
  • A set of conventions, strategies, idioms, interpretations allowing to translate a design model into source code.

  • Will be the subject of the next lectures.

  • May concern different modeling and implementation languages. Here we will study UML to Java.

30. Assertive Programming

Assertive Programming
  • Technique that follows the principle of fail fast and fail visibly

  • It reduces the error propagation because of side-effects.

  • It forbids(kind of sanity-check) the system to enter an inconsistent state because of user-data or by subsequent code changes.

31. Defensive Programming

Defensive Programming
  • Technique that ensures the code to behave in a correct manner, despite incorrect input.

  • Guarantees that a method can be executed only when some requirements are met.


Assertive is the opposite of Defensive Programming!

32. Logging

logging
Logging
  • Technique for keeping a log of events that occur during the execution of a software.

33. Automatic Code Generation

codegen
Automatic Code Generation
  • Code generation from a higher level language (graphical or textual).

34. Code Smells

epoisses
  • Code smells are “warnings signs” of deeper problems.

  • For instance: god classes, feature envy, long methods, too many parameters, nested if statements, etc.

  • http://wiki.c2.com/?CodeSmell

35. Code Conventions

code conventions
Code Conventions
  • Set of guidelines for a specific programming language that recommend programming style, practices, and methods for each aspect of a program written in that language.

  • Usually cover file organization, indentation, comments, declarations, statements, white space, naming conventions, programming practices, programming principles, programming rules of thumb, architectural best practices, etc.

These conventions These are guidelines for software structural quality. Software programmers are highly recommended to follow these guidelines to help improve the readability of their source code and make software maintenance easier. Coding conventions are only applicable to the human maintainers and peer reviewers of a software project. Conventions may be formalized in a documented set of rules that an entire team or company follows[1], or may be as informal as the habitual coding practices of an individual. Coding conventions are not enforced by compilers.

37. Automated Testing

test automation
Automated Testing
  • Automatic execution of unit and integration tests, static analysis, and any source code verification mechanism.

  • Goals:

    • Find bugs

    • Evaluate code quality: respect to conventions, best practices, etc.

  • Consequences:

    • Shortens time to defect detection

    • Increases personal discipline

    • Avoids regression

38. Code Refactoring

cleaning
  • Code improvement technique that preserves program behavior

  • Also, an simple operation that transforms the code and ensures the behavior is preserved

  • Operation examples: change of a class name, creation of an abstract class, extraction of the interface of class, etc.

39. Conclusion

construction evolution