Title: Formal Foundations for Software Evolution
1Formal Foundationsfor Software Evolution
- Programming Technology Lab
-
- Tom Mens
- tommens_at_vub.ac.be
- http//prog.vub.ac.be/tommens
2Need better tool support for
- version control
- e.g. upgrading application frameworks
- collaborative software development
- software merging
- change management
- change propagation
- change impact analysis
- ripple effect
- ...
- evolution at a high level of abstraction
- evolution of design patterns
- architectural evolution
- ...
object-orientedsoftwareevolution
3Need better tool support for
- co-evolution between different phases
- maintaining consistency
- checking compliance between architecture and
design, design and implementation, ... - re-engineering of legacy systems
- program comprehension
- reverse engineering
- migration
- ...
- empirical research on software evolution
- based on change metrics
- predictive models
- ...
4Tool support must be
- scalable
- applicable to large-scale software systems
- A major challenge for the research community is
to develop a good theoretical understanding an
underpinning for maintenance and evolution, which
scales to industrial applications.
BennettRajlich 2000 - language-independent
- independent of the programming or modelling
language - generally applicable in all phases of the
software life-cycle
5Reuse Contracts
- Usegraph rewritingto provide aformal
foundationforsoftware evolution based onreuse
contracts
6Benefits of Reuse Contracts
- Document reuse and evolution
- Deal with upgrade problems
- Provide support for software merging
- Provide support for framework refactoring
- Are independent of kind of software artifact
- analysis, architecture, design, implementation
71. Documenting Reuse
reuse
size item.size
81. Documenting Evolution
evolution
92. Dealing with Upgrade Problems
evolution
reuse
102. Dealing with Upgrade Problems
evolution
reuse
Coarsening(addMany, add, calls)
inconsistent operation conflict
Extension(size, attribute) Refinement(add, size,
update)
112. Dealing with Upgrade Problems
- extension/cancellation adding/removing an
operation or attribute - refinement/coarsening adding/removing
invocation or attribute access - abstraction/concretisation making an operation
abstract/concrete
Conflict Table
extension
refinement
coarsening
interface conflicts
extension refinement coarsening
no conflicts
no conflicts
operation capture, unanticipated recursion
operation capture, inconsistent operations
no conflicts
operation capture, inconsistent operations
inconsistent operations
no conflicts
123. Support for Software Merging
evolution
evolution
Extension(position, attribute) Extension(move,
method)Coarsening(addMany, add, calls)
inconsistent operation conflict
DesktopFolder v2a
contents size add addMany
Extension(size, attribute) Refinement(add, size,
update)
134. Support for FW Refactoring
145. Independent of software artifact
provider WebNavigation
client PDFNavigation
collaboration
participant extension
interface
Document
gotoPage
added
participant refinement
participant coarsening
15Problems with reuse contracts
- How to scale up to higher-level transformations
- e.g. dealing with class collaborations
- How to apply to other domains
- e.g. software architectures
- Solution Provide a formal foundation for reuse
contracts
16Reuse Contract Formalism
- Represent software artifacts by graphs
- Represent software evolution by graph rewriting
- Domain-independent formalism
- Independent of the target language
- Independent of the phase in the life-cycle
- Lightweight formalism to facilitate tool support
- Formal characterisation of evolution conflicts
- Prototype tool implemented in Prolog
17Graphs
- Node types
- class
- attribute
- operation
- interface
- Edge types
- assoc
- has-a (aggregation)
- is-a (generalisation)
- implements
18Type Graph
- Used to specifydomain-specific constraints
19Graph Rewriting
- Used to specify software evolution
20Primitive Graph Productions
- Use restricted set of graph productions
- AddNode
- DropNode
- AddEdge
- DropEdge
- RetypeNode
- RetypeEdge
- RelabelNode
- RelabelEdge
21Syntactic Conflicts
Syntactic conflict if P1 and P2 are not parallel
independent
P1
P2
22Syntactic Conflict Table
- Complete fine-grained characterisation of
syntactic conflicts
23Semantic Conflicts
- Based on the formal notion of
- pushouts and pullbacks
- Fine-grained conflict characterisation
- By detecting occurrence of graph patterns in
result graph
inconsistent method conflict
cyclic inheritance
24Structural Conflicts
More difficult to detect in a general way
25Using Assertions
- Problem
- Using a predefined set of graph productions is
not generic - Introducing new productions requires changes to
conflict table - Does not scale up to composite graph productions
- Solution
- make formalism independent of chosen productions
- define productions based on assertions only
- preconditions, postconditions, invariants
26Example
27Example ctd.
28Syntactic Conflict Table
- Detect syntactic merge conflicts
- in terms of transformation preconditions
- compare breaches of application conditions
- Advantages
- more general
- does not rely on predefined graph produtions
- more scalable
- can be used directly for composite or
domain-specific graph productions
29Syntactic Conflict Table
30Using dependencies
- Dependencies can be defined between productions
- based on relations between assertions
31Using dependencies
- Dependencies can be used to address scalability
- Reordering productions in a sequence
- Defining atomic composite productions from a
sequence of productions - Removing redundancy in a production sequence
- Factoring out commonalities from parallel
production sequences - Parallellising subsequences
321. Reordering productions
332. Composite productions
343. Removing redundancy
- Allows us to simplify a production sequence
redundant pair
reorder
redundant pair
353. Removing Redundancy
364. Factoring out commonalities
- Find commonalities in two parallel sequences, and
factor out - facilitates merging and conflict detection
374. Factoring out Example
384. Factoring out Example
395. Parallellising subsequences
RenameN(a,surface,area)
AddN(b,perimeter,attribute)
RetypeN(a, attribute,operation)
RetypeN(b, attribute,operation)
AddN(c,radius,attribute)
AddE(e,b,c,uses,uses)
AddE(f,a,c,uses,uses)
DropE(e,b,c)
DropN(b)
405. Parallellising subsequences
RenameN(a,surface,area)
RetypeN(a, attribute,operation)
AddN(b,perimeter,attribute)
AddN(c,radius,attribute)
RetypeN(b, attribute,operation)
AddE(e,b,c,uses,uses)
AddE(f,a,c,uses,uses)
DropE(e,b,c)
DropN(b)
41Validation of Reuse Contracts
- Industrial case
- One base release line with many customisations
for different customer applications - Collaborative software development with parallel
changes to base release and customisations
7.2
NDR
7.4
DR
VTM
10.x
WDR 0.1
TV2
11
WDR 1.0
12
WDR 2.0
42Validation of Reuse Contracts
- Use reuse contracts to document
- evolution of base release line
- customisation to different customer applications
- evolution of customer applications
- Use conflict detection to support
- upgrades of customer application to more recent
base release - refactoring of base release for easier future
customisation - Provide help with consolidation
- detect commonalities between different
customisations - apply commonalities to base release
43To Do
- User-friendly tool support
- Perform large-scale experiments
- Validate scalability
- Look at conflict resolution techniques
- Deal with problem of co-evolution
44Co-Evolution
- Underlying idea
- Keep representation of same software artifact at
different levels of abstraction (e.g. design and
implementation) synchronised during evolution
45Co-Evolution
- needed for collaborative development
- when different persons make changes to same
software concept at different levels of
abstraction - facilitates delta analysis
- relate changes at analysis level back to the code
and keep them synchronised - address architectural drift and software erosion
- use a compliance checking algorithm
- detect conflicts between changes at different
levels