Introduction to Software Construction and Evolution

University of Nantes – LS2N, France

Gerson Sunyé

Plan

  • Introduction

  • Methods

  • Activities

  • Techniques

  • Tools

  • Conclusion

Introduction

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

A Software Engineering Activity

software construction
Figure 1. Software Construction and Evolution

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!

Methods, Activities, Techniques and Tools

  • Software Construction and Evolution follow a Method

  • Methods organize Activities

  • Activities use Techniques

  • Techniques are supported by Tools

Diagram

Example: The Test-Driven Development Method

Diagram
Figure 3. Activities, Techniques, and Tools of the TDD Method

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

Activities

Activities are the different tasks realized during the software development process

 
 

Examples

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

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.

Tools

JUnit
Git

Tools help developers to apply one or more techniques


Examples

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

Plan

  • Introduction

  • Methods

  • Activities

  • Techniques

  • Tools

  • Conclusion

Software Construction and Evolution Methods

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!

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 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

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.

Test Driven Development

tdd logo
Development cycle:
  1. Add a test

  2. Write the code

  3. Run tests

  4. Improve code

  5. Repeat

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.

Continuous Integration

CI
Main components:
  • Control Version System (Repository)

  • CI Server

  • Build Scripts

  • Feedback Mechanisms

  • Test Machine

  • Build Machine

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.

DevOps

DevOps
Process:
  • Coding

  • Building

  • Testing

  • Packaging

  • Releasing

  • Configuring

  • Monitoring

Plan

  • Introduction

  • Methods

  • Activities

  • Techniques

  • Tools

  • Conclusion

Software Construction and Evolution Activities

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.

Testing
  • Activity that checks whether the actual results match the expected results and to ensure that the software system is Defect free.

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

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.

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

Plan

  • Introduction

  • Methods

  • Activities

  • Techniques

  • Tools

  • Conclusion

Software Construction and Evolution Techniques

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.

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.

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!

Logging

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

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

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

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.

Coding Conventions

test automation
Automated Testing
  • Automatic execution of unit and system 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

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.

Conclusion

construction evolution