5 introduction to software change software change (sc) is the process of adding new functionality to...

28
5 Introduction to software change • Software change (SC) is the process of adding new functionality to existing code • Foundation of software evolution, servicing © 2012 Václav Rajlich Software Engineering: The Current Practice Ch. 5 1

Upload: austen-ellis

Post on 22-Dec-2015

218 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 5 Introduction to software change Software change (SC) is the process of adding new functionality to existing code Foundation of software evolution, servicing

5 Introduction to software change

• Software change (SC) is the process of adding new functionality to existing code

• Foundation of software evolution, servicing

© 2012 Václav Rajlich Software Engineering: The Current Practice Ch. 5 1

Page 2: 5 Introduction to software change Software change (SC) is the process of adding new functionality to existing code Foundation of software evolution, servicing

Characteristics of SC

• Lientz and Swanson

– perfective ~66%

– adaptive

– corrective

– protective© 2012 Václav Rajlich Software Engineering: The Current Practice Ch. 5 2

Page 3: 5 Introduction to software change Software change (SC) is the process of adding new functionality to existing code Foundation of software evolution, servicing

Functionality

• Incremental– adding new functionality

• Contraction– removing obsolete functionality

• Replacement– replacing existing functionality

• Refactoring– changing software structure without changing

behavior© 2012 Václav Rajlich Software Engineering: The Current Practice Ch. 5 3

Page 4: 5 Introduction to software change Software change (SC) is the process of adding new functionality to existing code Foundation of software evolution, servicing

Impact

• Local impact

• Significant impact

• Massive impact

• Change strategy– improves structure– quick fix

© 2012 Václav Rajlich Software Engineering: The Current Practice Ch. 5 4

Page 5: 5 Introduction to software change Software change (SC) is the process of adding new functionality to existing code Foundation of software evolution, servicing

Form of changing code

• Source code– most common

• Code after compilation– object form– executable form

© 2012 Václav Rajlich Software Engineering: The Current Practice Ch. 5 5

Page 6: 5 Introduction to software change Software change (SC) is the process of adding new functionality to existing code Foundation of software evolution, servicing

Phased model of SC

• Main topic of this course

• Preview of Phases of SC

© 2012 Václav Rajlich Software Engineering: The Current Practice Ch. 5 6

SC Implementation

Interactions with the world

SC design

Initiation

Concept Location

Impact Analysis

Prefactoring

Actualization

Postfactoring

ConclusionConclusion

VERIFICATION

Page 7: 5 Introduction to software change Software change (SC) is the process of adding new functionality to existing code Foundation of software evolution, servicing

Initiation

• SC starts by a change request• Prioritization of change

requests, etc.

© 2012 Václav Rajlich Software Engineering: The Current Practice Ch. 5 7

Initiation

Concept Location

Impact Analysis

Prefactoring

Actualization

Postfactoring

ConclusionConclusion

VERIFICATION

Page 8: 5 Introduction to software change Software change (SC) is the process of adding new functionality to existing code Foundation of software evolution, servicing

SC Design

© 2012 Václav Rajlich Software Engineering: The Current Practice Ch. 5 8

Concept

Software

Impact Set

Impact Analysis

Impact Analysis

Concept Location

Initiation

Concept Location

Impact Analysis

Prefactoring

Actualization

Postfactoring

ConclusionConclusion

VERIFICATION

Page 9: 5 Introduction to software change Software change (SC) is the process of adding new functionality to existing code Foundation of software evolution, servicing

Concept Location

• Concepts are extracted from change request

• Extracted concepts are located in the code and used as a starting point of SC

© 2012 Václav Rajlich Software Engineering: The Current Practice Ch. 5 9

Initiation

Concept Location

Impact Analysis

Prefactoring

Actualization

Postfactoring

ConclusionConclusion

VERIFICATION

Page 10: 5 Introduction to software change Software change (SC) is the process of adding new functionality to existing code Foundation of software evolution, servicing

Impact Analysis

• Determine strategy and impact of change

• Classes identified in concept location make up the initial impact set

• Class dependencies are analyzed, and impacted classes are added to the impact set

© 2012 Václav Rajlich Software Engineering: The Current Practice Ch. 5 10

Initiation

Concept Location

Impact Analysis

Prefactoring

Actualization

Postfactoring

ConclusionConclusion

VERIFICATION

Page 11: 5 Introduction to software change Software change (SC) is the process of adding new functionality to existing code Foundation of software evolution, servicing

Prefactoring

• Opportunistic refactoring that localizes (minimizes) impact of SC on software

• Extract Class (Fowler)– gather fields, methods, and code

snippets into a new component class

• Extract Superclass– create new abstract class

© 2012 Václav Rajlich Software Engineering: The Current Practice Ch. 5 11

Initiation

Concept Location

Impact Analysis

Prefactoring

Actualization

Postfactoring

ConclusionConclusion

VERIFICATION

Page 12: 5 Introduction to software change Software change (SC) is the process of adding new functionality to existing code Foundation of software evolution, servicing

Actualization

• Creates new code

• Plugs it into the old code

• Visit neighboring classes and update them– change propagation– ripple effect

© 2012 Václav Rajlich Software Engineering: The Current Practice Ch. 5 12

Initiation

Concept Location

Impact Analysis

Prefactoring

Actualization

Postfactoring

ConclusionConclusion

VERIFICATION

Page 13: 5 Introduction to software change Software change (SC) is the process of adding new functionality to existing code Foundation of software evolution, servicing

Postfactoring

• Eliminate any anti-patterns that may have been introduced– long method

• after added functionality, some methods may be doing too much

– bloated class • after added functionality, a class may

be too large

© 2012 Václav Rajlich Software Engineering: The Current Practice Ch. 5 13

Initiation

Concept Location

Impact Analysis

Prefactoring

Actualization

Postfactoring

ConclusionConclusion

VERIFICATION

Page 14: 5 Introduction to software change Software change (SC) is the process of adding new functionality to existing code Foundation of software evolution, servicing

Verification

• Guarantees correctness of the change

• Testing– functional– unit – structural

• Walkthroughs

© 2012 Václav Rajlich Software Engineering: The Current Practice Ch. 5 14

Initiation

Concept Location

Impact Analysis

Prefactoring

Actualization

Postfactoring

ConclusionConclusion

VERIFICATION

Page 15: 5 Introduction to software change Software change (SC) is the process of adding new functionality to existing code Foundation of software evolution, servicing

Conclusion

• Commit finished code into version control

• Build the new baseline

• Prepare for the next change

© 2012 Václav Rajlich Software Engineering: The Current Practice Ch. 5 15

Initiation

Concept Location

Impact Analysis

Prefactoring

Actualization

Postfactoring

ConclusionConclusion

VERIFICATION

Page 16: 5 Introduction to software change Software change (SC) is the process of adding new functionality to existing code Foundation of software evolution, servicing

Test-Driven Development

• Write test first

• Write code to pass the test

© 2012 Václav Rajlich Software Engineering: The Current Practice Ch. 5 16

New Baseline

Initiation

Concept Location

Test-first

Actualization

Regression testing

Page 17: 5 Introduction to software change Software change (SC) is the process of adding new functionality to existing code Foundation of software evolution, servicing

Change initiation

• Requirements– user reports a software bug– user asks for an enhancement– programmer proposes improvement– manager wants to meet competitor’s

functionality

© 2012 Václav Rajlich Software Engineering: The Current Practice Ch. 5 17

Initiation

Concept Location

Impact Analysis

Prefactoring

Actualization

Postfactoring

ConclusionConclusion

VERIFICATION

Page 18: 5 Introduction to software change Software change (SC) is the process of adding new functionality to existing code Foundation of software evolution, servicing

Requirements form

• Sentence or paragraph

• Bug report

• User story– limit the complexity of the story and potential

for misunderstanding– user story fits on a 3” x 5” card– if a new functionality cannot fit, it has to be

divided into several user stories

© 2012 Václav Rajlich Software Engineering: The Current Practice Ch. 5 18

Page 19: 5 Introduction to software change Software change (SC) is the process of adding new functionality to existing code Foundation of software evolution, servicing

Product backlog

• Database of requirements– “wish list” – add/delete/modify requirements– additional knowledge is acquired by the users– additional clarification is needed by the

developers

© 2012 Václav Rajlich Software Engineering: The Current Practice Ch. 5 19

Page 20: 5 Introduction to software change Software change (SC) is the process of adding new functionality to existing code Foundation of software evolution, servicing

Requirements Elicitation

© 2012 Václav Rajlich Software Engineering: The Current Practice Ch. 5 20

New Requirements

Product Backlog

Stakeholders

Desired Code

Existing Code

Requirements elicitation

Page 21: 5 Introduction to software change Software change (SC) is the process of adding new functionality to existing code Foundation of software evolution, servicing

Requirements analysis

• Inconsistencies– Contradictions

• ex. different formula for the same thing

– Inadequacy• ex. requirements are too terse -> developers have

to guess

© 2012 Václav Rajlich Software Engineering: The Current Practice Ch. 5 21

Page 22: 5 Introduction to software change Software change (SC) is the process of adding new functionality to existing code Foundation of software evolution, servicing

Inconsistencies (2)

• Noise• ex. irrelevant requirements (delete them)

• Unfeasibility• ex. project team or technology barriers

• Ambiguity or unintelligibility• ex. interpreting a requirement in more than one

way

© 2012 Václav Rajlich Software Engineering: The Current Practice Ch. 5 22

Page 23: 5 Introduction to software change Software change (SC) is the process of adding new functionality to existing code Foundation of software evolution, servicing

Prioritization - bugs

• 1. Fatal application error

• 2. Application is severely impaired – no workaround can be found

• 3. Some functionality is impaired – workaround can be found

• 4. Minor problem – not involving primary functionality

© 2012 Václav Rajlich Software Engineering: The Current Practice Ch. 5 23

Page 24: 5 Introduction to software change Software change (SC) is the process of adding new functionality to existing code Foundation of software evolution, servicing

Business value

• 1. An essential functionality without which the application is useless

• 2. An important functionality that users rely on

• 3. A functionality that users need but can be without

• 4. A minor enhancement

© 2012 Václav Rajlich Software Engineering: The Current Practice Ch. 5 24

Page 25: 5 Introduction to software change Software change (SC) is the process of adding new functionality to existing code Foundation of software evolution, servicing

Risk

• 1. A serious threat, the so-called “showstopper”– if unresolved, the project is in serious trouble

• 2. An important threat that cannot be ignored

• 3. A distant threat that still merits attention

• 4. A minor inconveniences

© 2012 Václav Rajlich Software Engineering: The Current Practice Ch. 5 25

Page 26: 5 Introduction to software change Software change (SC) is the process of adding new functionality to existing code Foundation of software evolution, servicing

Process needs

• 1. Key requirement– if not implemented in advance, practically all

code will have to be redone

• 2. An important requirement – if postponed, will lead to large rework

• 3. A nontrivial rework will be required if this requirement is postponed

• 4. A minor rework will be triggered

© 2012 Václav Rajlich Software Engineering: The Current Practice Ch. 5 26

Page 27: 5 Introduction to software change Software change (SC) is the process of adding new functionality to existing code Foundation of software evolution, servicing

Change Initiation process

• Select a set of the highest priority requirements

• Analyze these requirements

• After this analysis, select the highest priority requirement as the next change request

© 2012 Václav Rajlich Software Engineering: The Current Practice Ch. 5 27

Page 28: 5 Introduction to software change Software change (SC) is the process of adding new functionality to existing code Foundation of software evolution, servicing

Change Initiation

© 2012 Václav Rajlich Software Engineering: The Current Practice Ch. 5 28

Product Backlog Desired Code

Existing Code

Change InitiationNew Code

Change Request

Change

Stakeholders