Вы находитесь на странице: 1из 39

Impact Analysis

Prof. Romain Robbes


Changes can trigger ripple effects
Impact analysis estimates actual changes
Initiation

Concept Location
If the change is not localized,
Impact Analysis
the programmer determines
Prefactoring which other modules are
Verification

affected by the change.


Actualization

Postfactoring

Conclusion
From concept location to impact analysis
Impact analysis (IA):
Initiation Determines the strategy and
Concept Location impact of the change

Impact Analysis Classes identified in concept location


make up the initial impact set
Prefactoring
Verification

Actualization Class dependencies are analyzed;


impacted classes are added to the
Postfactoring
estimated impact set
Conclusion
Concept location vs Impact analysis
Concept location vs Impact analysis
The impact set of a change request
System

Estimated impact set

Initial impact set


Estimated vs actual impact set
System

Changed set

Initial impact set


Example: point-of-sale application

To implement promotions,
Prices have a new date
parameter.
Example: point-of-sale application

To implement promotions,
Prices have a new date
parameter.
Example: point-of-sale application

To implement promotions,
Prices have a new date
parameter.
Concept location vs impact analysis

Concept location is repeated until a suitable starting point is found

Impact analysis is repeated until ... when?


Class interactions
Class interactions

Two classes interact if they have something in common


One depends on the other; there is a contract between them
They coordinate: share the same coding, schedule, etc.

Interactions propagate change in both directions

A B
However, indirect interactions are possible
(ex: mailman)

Global variables
Shared assumptions
(blue is 1)
Classes composing functionality
However, indirect interactions are possible
(ex: mailman)
class A {
int getUserColor();
}

Global variables class B {


void paintScreen(int color);
Shared assumptions }

(blue is 1) class C {
A a;
B b;
Classes composing functionality
void askThenPaint()
{
b.paintScreen(a.getUserColor());
}
}
Neighborhood of a class

To implement promotions,
Prices have a new date
parameter.
The impact analysis process
Marking classes
Mark Meaning

BLANK Not inspected yet: status unknown

Class belongs to the impact set.


CHANGED
All BLANK neighbors become NEXT

UNCHANGED Class does not belong to the impact set

NEXT Scheduled for inspection

Does not belong to the impact set, but neighbors may still
PROPAGATING
change. All BLANK neighbors become NEXT
Impact analysis process

create interaction diagram


mark all classes as BLANK are there any
classes in the interaction
diagram marked as
mark the class located during NEXT?
concept location as CHANGED

[no]
Mark all BLANK neighbors as NEXT

[yes]
Mark as UNCHANGED

Mark as PROPAGATES select a NEXT class;


update its mark.
Mark as CHANGED
Impact analysis example
Impact analysis example
Impact analysis example
Impact analysis example
Impact analysis example
Impact analysis example
Impact analysis example
Impact analysis example
Impact analysis example
Impact analysis example, with
Propagating classes
Impact analysis example, with
Propagating classes
Impact analysis example, with
Propagating classes
Impact analysis example, with
Propagating classes
Impact analysis example, with
Propagating classes
Impact analysis example, with
Propagating classes
Impact analysis example, with
Propagating classes
Tool support for IA
create interaction diagram
mark all classes as BLANK are there any
classes in the interaction
diagram marked as
mark the class located during NEXT?
concept location as CHANGED

[no]
Mark all BLANK neighbors as NEXT

[yes]
Mark as UNCHANGED

Mark as PROPAGATES select a NEXT class;


update its mark.
Mark as CHANGED

Computer Programmer
Further tool support permit the ranking of
the NEXT classes

Based on number of references, textual similarity, etc ...

Finer-grained impact analysis is also possible


(methods, instance variables ...)

Вам также может понравиться