SlideShare a Scribd company logo
Fragility in Evolving Software
BENEVOL'13

Prof. Kim Mens

16,17 Dec. 2013

ICTEAM

Mons, Belgium

UCL, Belgium

Fragility in Evolving Software
Fragility
Software artefacts make many assumptions about
other software artefacts
Many of these assumptions are not documented,
nor verified explicitly
When an artefact evolves into one that doesn't
res-pect the assumptions, fragility problems arise
Fragility problems can thus be seen as a kind of
substitutability problem
Fragility
Base
artefact

evolution

dependency

?
Dependent
artefact

Evolved
artefact
The Fragile Base
Class Problem
Object-oriented programs consist of many classes connected
through inheritcance
Base classes make assumptions about how they can be reused
by subclasses
Subclasses make assumptions about the classes they inherit
from
These assumptions are often not documented explicitly, nor
verified automatically
The fragile base class problem [5,7] occurs when a base class
evolves into a new one that doesn't respect these assumptions
The Fragile Base
Class Problem


Base class

evolution

inheritance

?


Subclass

Evolved
Base
class
Fragility in Aspect
Oriented Programming
AOP = base code + aspects
Aspects = pointcuts + advice code
Aspects modify the behaviour of the base
code by weaving in advice code at
various join points, described by
pointcut expressions
Base code is oblivious to the aspects
Fragility in AOP
Both pointcuts and advice code make
assumptions about the base code they refer to or
act upon
These assumptions are not documented explicitly,
nor verified automatically
Subtle conflicts arise when the base code evolves
in a way that breaks these assumptions
These problems are known as the fragile pointcut
problem [2,6] and the fragile advice problem [1]
Fragility in AOP


Base code
aspect
weaving

evolution

p
ile
ag
fr

Aspect =
pointcut
+ advice

t ?
cu
nt
oi

?
ice
dv
a
ile
ag
fr

Evolved
Base
code
Dealing with
fragility
Fragility problems arise when implicit assumptions
between dependent artefacts get broken when the
system evolves
Solution consists of documenting the assumptions
explicitly, and verifying them upon evolution
By defining some kind of evolution contract between
the evolving artefact and its dependent artefacts
A verifiable agreement between the two parties
Detect fragility conflicts by verifying the contract
Dealing with
fragility
Different kinds of fragility conflicts can be
distinguished, depending on :
how the artefact evolves
how the artefacts depend on each other
what conditions of the contract are breached
Appropriate solutions to these conflicts can be
proposed accordingly
Handling the fragile
base class problem
1. Define a reuse contract [7] between a derived
class and the base class it depends on
how does the reuser specialize the base
class?
2. Define a usage contract [4] between the base
class and the derived classes that "use" it
what regularities does the base class expect
the derived classes to respect ?
Reuse Contracts
Reuse contracts define an evolution contract between
a "reuser" and the base class it depends upon
the base class declares a specialization
interface [3] defining what reusers can rely upon
a reuse operator defines how derived classes reuse
the base class
an evolution operator defines how the base class
evolved
Reuse Contracts
DesktopFolder

Coarsening

DesktopFolder

xpos, ypos, contents

addMany {-add}

xpos, ypos, contents

move

move

add

add

addMany {add}

addMany

Refinement
add {+size}
SizedFolder
size
add {size}

?
Reuse Contracts
DesktopFolder

Coarsening

DesktopFolder

xpos, ypos, contents

addMany {-add}

xpos, ypos, contents

move

move

add

add

addMany {add}

addMany

Refinement
add {+size}
SizedFolder
size

Inconsistent Methods

add {size}

addMany should be
overridden too
Reuse Contracts
Extension
+m
Extension
+p

Refinement
m {+n}

name con-

method

flict [m=p]

capture [n=p]

Cancelation
-m

Coarsening
m {-n}

...

...

...

...

Refinement
p {+q}

...

...

...

Cancelation
-p

...

...

...

...

...

Coarsening
p {-q}

...

...

...

...

...

...

...

...

...

...

...

inconsistent
method [n=p]

...
Usage Contracts
Usage contracts [4] define an evolution
contract between the base class and the
classes that "use" it
base class defines what regularities
should be respected by its derived classes
regularities are checked when modifying
existing or creating new derived classes
Usage Contracts
Describe expectations of "provider" :

FAMIXSourcedEntity


copyFrom: anEntity within: aVisitor

inheritance

All overriders of
copyFrom: within:
should start with a super call

"Consumer" should comply with
these expectations

X


copyFrom: anEntity within: aVisitor
super copyFrom: anEntity
within: aVisitor
Usage Contracts
FAMIXSourcedEntity


copyFrom: anEntity within: aVisitor

All overriders of
copyFrom: within:
should start with a super call

Evolved / new class

inheritance

should still / also comply

X

Evolved or new X


copyFrom: anEntity within: aVisitor
super copyFrom: anEntity
within: aVisitor



evolution

copyFrom: anEntity within: aVisitor
???
Usage Contracts
A DSL for declaring usage contracts
Specifying the liable entities of the contract
scope of classes or methods to which the contract is
applicable
Defining the structural regularity
structural constraints to be respected by the liable
entities
These lightweight contracts are checked and reported
immediately during development and maintenance
Usage Contracts
All overriders of
copyFrom: within:

Specifying the liable entities

should start with a super call

classesInFAMIXSourcedEntityHierarchy



<liableHierarchy: #FAMIXSourcedEntity>

Defining the structural regularity
copyFromWithinWithCorrectSuperCall



<selector: #copyFrom:within:>




contract:






require:








(condition beginsWith:















if: (condition isOverridden)

(condition doesSuperSend: #copyFrom:within:)
The fragile
pointcut problem
In aspect-oriented programming, the base program
is oblivious of the aspects that act upon it
Pointcut expressions describe at what join points in
the base program advice code will be woven
The fragile pointcut problem [2] occurs when
pointcut expressions unintendedly capture or
accidentally miss particular join points
as a consequence of their fragility with respect
to seemingly safe evolutions of the base program
The fragile
pointcut problem
E.g., a pointcut expression to capture getters and setters
An "enumeration" pointcut:



pointcut accessors()






call(void Buffer.set(Object)) || call(Object Buffer.get());

May accidentally miss other relevant getters and setters
A "pattern-based" pointcut:



pointcut accessors()






call(* set*(..)) || call(* get*(..));

May unintendedly capture methods that aren't getters or setters
for example, a method named setting
The fragile
pointcut problem
Pointcuts in program

Pointcuts in evolved program

d
nde ture
te
nin t cap
u in
po
oin
j
Class
Name
Attributes
Attributes
Operations
Operations

Class
Name
Attributes
Attributes
Operations
Operations

Class
Name
Attributes
Attributes
Operations
Operations
*

Class
Name
Attributes
Attributes
Operations
Operations

*

Class
Name
Attributes
Attributes
Operations
Operations

Class
Name
Attributes
Attributes
Operations
Operations
Class
Name
Attributes
Attributes
Operations
Operations

Source program

EVOLUTION
Class
Name
Attributes
Attributes
Operations
Operations

*
Class
Name
Attributes
Attributes
Operations
Operations

*

Class
Name
Attributes
Attributes
Operations
Operations

Class
Name
Attributes
Attributes
Operations
Operations

Class
Name
Attributes
Attributes
Operations
Operations

Evolved Source program

al
ent iss
id
acc int m
po
oin
j
Model-based
pointcuts
Model-based poincuts [2] define an evolution contract between the pointcuts
and the base code, in terms of an intermediate model that both agree upon.
A "model-based" pointcut:



pointcut accessors()






classifiedAs(?methSignature,AccessorMethods) &&






call(?methSignature)

The base code should comply with the model, but remains oblivious of the
actual aspects
Some fragility problems can be encountered by defining and verifying
additional constraints at the level of the model
For example, every setter method should have a name of the form setX
and assign a value to the variable X
Model-based
pointcuts
Pointcuts

Additional constraints such as:

Conceptual Model

{ methods named set* } =
{ methods assigning an instance variable }

Class
Name
Attributes
Attributes
Operations
Operations

Class
Name
Attributes
Attributes
Operations
Operations

Class
Name
Attributes
Attributes
Operations
Operations
*

*
Class
Name
Attributes
Attributes
Operations
Operations

Source code

Class
Name
Attributes
Attributes
Operations
Operations

Class
Name
Attributes
Attributes
Operations
Operations
Model-based
pointcuts
Pointcuts

Pointcuts in Evolved Code

Conceptual Model

Class
Name
Attributes
Attributes
Operations
Operations

Class
Name
Attributes
Attributes
Operations
Operations

Conceptual Model

Class
Name
Attributes
Attributes
Operations
Operations
*

Class
Name
Attributes
Attributes
Operations
Operations

*
Class
Name
Attributes
Attributes
Operations
Operations

Source code

Class
Name
Attributes
Attributes
Operations
Operations

Class
Name
Attributes
Attributes
Operations
Operations

EVOLUTION
Class
Name
Attributes
Attributes
Operations
Operations

*

Class
Name
Attributes
Attributes
Operations
Operations

*

Class
Name
Attributes
Attributes
Operations
Operations

Class
Name
Attributes
Attributes
Operations
Operations

Evolved Source code

Class
Name
Attributes
Attributes
Operations
Operations
Summary
Software fragility arises when implicit
assumptions artefacts make about dependent and
depending artefacts get broken upon evolution
Solutions consists of documenting these
assumptions explicitly as "evolution contracts",
and verifying them whenever the software evolves
Appropriate conflict resolutions can be suggested
depending on how the artefacts evolved and on
what assumptions got broken
Other potential
application areas
We have applied these ideas mostly to OO, FW and
AO software development
Other envisaged application areas :
dynamically adaptive systems
and COP in particular
evolving configurations of network routers
data-intensive systems
...
Take-away message
A good idea is timeless.
To reinvent yourself it sometimes suffices to rediscover
yourself.
Revive research on software reuse and evolution by reusing
or evolving old research on software reuse and evolution.
Context-oriented progamming is one potential new
application area of these ideas.
Ideas could be applied to any domain where you have
potential fragility problems.
Timeline
Usage Contracts: Offering Immediate Feedback on
Violations of Structural Source-code Regularities
Angela Lozanoa , Andy Kellensb , Kim Mensa
a

Universit´ catholique de Louvain
e
b
Vrije Universiteit Brussel

Abstract
Developers often encode design knowledge through structural regularities
such as API usage protocols, coding idioms and naming conventions. As
these regularities express how the source code should be structured, they
provide vital information for developers using or extending that code. Adherence to such regularities tends to deteriorate over time when they are not
documented and checked explicitly. This paper introduces uContracts, an
internal DSL to codify and verify such regularities using ‘usage contracts’.
Whereas our DSL does not aim to be complete, it does cover common usage
regularities, while providing a means through metaprogramming to express
atypical regularities. Common regularities are identified based on regularities supported by existing approaches to detect bugs or suggest missing code
fragments, techniques that mine for structural regularities, as well as on the
analysis of an open-source project. We validate our DSL by documenting
the usage regularities of an industrial case study, and analyse how useful the
information provided by checking these regularities is for the developers of
that case study.

?

1. Introduction
Being able to document and preserve architectural integrity and design
knowledge of an application is important to increase its longevity [4]. Given
that over time the actual implementation structure tends to drift away from
Email addresses: angela.lozano@uclouvain.be (Angela Lozano),
andy.kellens@vub.ac.be (Andy Kellens), kim.mens@uclouvain.be (Kim Mens)

contracts

March 26, 2013

Dyn. evol.

Contracts

Usage

AOSD'06

Pointcuts

Model-based

OOPSLA'96

Contracts

Reuse

Preprint submitted to Science of Computer Programming
Some references
1. Cyment, Kicillof, Altman & Asteasuain. Improving AOP systems’ evolvability by
decoupling advices from base code. RAM-SE’06 WS @ ECOOP’06, pp 9–21, 2006.
2. Kellens, Mens, Brichau & Gybels. Managing the evolution of aspect-oriented software
with model-based pointcuts. ECOOP’06, pp 501–525, 2006.
3. Lamping. Typing the specialization interface. OOPSLA ’93, pp 201–214, 1993.
4. Lozano, Kellens & Mens. Usage contracts: Offering immediate feedback on violations
of structural source-code regularities. Under revision.
5. Mikhajlov & Sekerinski. A study of the fragile base class problem. ECOOP’98, pp
355–382, 1998.
6. Noguera, Kellens, Deridder & D’Hondt. Tackling pointcut fragility with dynamic
annotations. RAM-SE’10 WS @ ECOOP’10, pp 1–6, 2010.
7. Steyaert, Lucas, Mens & D’Hondt. Reuse contracts: Managing the evolution of reusable
assets. OOPSLA’96, pp 268–285, 1996.

More Related Content

What's hot

Software Design Patterns
Software Design PatternsSoftware Design Patterns
Software Design Patterns
Satheesh Sukumaran
 
Gof design patterns
Gof design patternsGof design patterns
Gof design patterns
Srikanth R Vaka
 
Vb net xp_03
Vb net xp_03Vb net xp_03
Vb net xp_03
Niit Care
 
Bartlesville Dot Net User Group Design Patterns
Bartlesville Dot Net User Group Design PatternsBartlesville Dot Net User Group Design Patterns
Bartlesville Dot Net User Group Design Patterns
Jason Townsend, MBA
 
Dev labs alliance top 20 basic java interview question for sdet
Dev labs alliance top 20 basic java interview question for sdetDev labs alliance top 20 basic java interview question for sdet
Dev labs alliance top 20 basic java interview question for sdet
devlabsalliance
 
Let us understand design pattern
Let us understand design patternLet us understand design pattern
Let us understand design pattern
Mindfire Solutions
 
Dacj 1-2 b
Dacj 1-2 bDacj 1-2 b
Dacj 1-2 b
Niit Care
 
Object-Oriented Application Frameworks
Object-Oriented Application FrameworksObject-Oriented Application Frameworks
Object-Oriented Application Frameworks
kim.mens
 
Framework engineering JCO 2011
Framework engineering JCO 2011Framework engineering JCO 2011
Framework engineering JCO 2011
YoungSu Son
 
Software design patterns ppt
Software design patterns pptSoftware design patterns ppt
Software design patterns ppt
mkruthika
 
GoF Design patterns I: Introduction + Structural Patterns
GoF Design patterns I:   Introduction + Structural PatternsGoF Design patterns I:   Introduction + Structural Patterns
GoF Design patterns I: Introduction + Structural Patterns
Sameh Deabes
 
Aspect Oriented Programming Through C#.NET
Aspect Oriented Programming Through C#.NETAspect Oriented Programming Through C#.NET
Aspect Oriented Programming Through C#.NET
Waqas Tariq
 
Effective Java, Third Edition - Keepin' it Effective
Effective Java, Third Edition - Keepin' it EffectiveEffective Java, Third Edition - Keepin' it Effective
Effective Java, Third Edition - Keepin' it Effective
C4Media
 
Java Design Pattern Interview Questions
Java Design Pattern Interview QuestionsJava Design Pattern Interview Questions
Java Design Pattern Interview Questions
jbashask
 
Design patterns
Design patternsDesign patterns
Design patterns
Luis Goldster
 
Lecture 5 Software Engineering and Design Design Patterns
Lecture 5 Software Engineering and Design Design PatternsLecture 5 Software Engineering and Design Design Patterns
Lecture 5 Software Engineering and Design Design Patterns
op205
 
Coding Naked
Coding NakedCoding Naked
Coding Naked
Caleb Jenkins
 
[JWPA-1]의존성 주입(Dependency injection)
[JWPA-1]의존성 주입(Dependency injection)[JWPA-1]의존성 주입(Dependency injection)
[JWPA-1]의존성 주입(Dependency injection)
Young-Ho Cho
 
Opposites Attract
Opposites AttractOpposites Attract
Opposites Attract
Kevlin Henney
 
8 most expected java interview questions
8 most expected java interview questions8 most expected java interview questions
8 most expected java interview questions
Poonam Kherde
 

What's hot (20)

Software Design Patterns
Software Design PatternsSoftware Design Patterns
Software Design Patterns
 
Gof design patterns
Gof design patternsGof design patterns
Gof design patterns
 
Vb net xp_03
Vb net xp_03Vb net xp_03
Vb net xp_03
 
Bartlesville Dot Net User Group Design Patterns
Bartlesville Dot Net User Group Design PatternsBartlesville Dot Net User Group Design Patterns
Bartlesville Dot Net User Group Design Patterns
 
Dev labs alliance top 20 basic java interview question for sdet
Dev labs alliance top 20 basic java interview question for sdetDev labs alliance top 20 basic java interview question for sdet
Dev labs alliance top 20 basic java interview question for sdet
 
Let us understand design pattern
Let us understand design patternLet us understand design pattern
Let us understand design pattern
 
Dacj 1-2 b
Dacj 1-2 bDacj 1-2 b
Dacj 1-2 b
 
Object-Oriented Application Frameworks
Object-Oriented Application FrameworksObject-Oriented Application Frameworks
Object-Oriented Application Frameworks
 
Framework engineering JCO 2011
Framework engineering JCO 2011Framework engineering JCO 2011
Framework engineering JCO 2011
 
Software design patterns ppt
Software design patterns pptSoftware design patterns ppt
Software design patterns ppt
 
GoF Design patterns I: Introduction + Structural Patterns
GoF Design patterns I:   Introduction + Structural PatternsGoF Design patterns I:   Introduction + Structural Patterns
GoF Design patterns I: Introduction + Structural Patterns
 
Aspect Oriented Programming Through C#.NET
Aspect Oriented Programming Through C#.NETAspect Oriented Programming Through C#.NET
Aspect Oriented Programming Through C#.NET
 
Effective Java, Third Edition - Keepin' it Effective
Effective Java, Third Edition - Keepin' it EffectiveEffective Java, Third Edition - Keepin' it Effective
Effective Java, Third Edition - Keepin' it Effective
 
Java Design Pattern Interview Questions
Java Design Pattern Interview QuestionsJava Design Pattern Interview Questions
Java Design Pattern Interview Questions
 
Design patterns
Design patternsDesign patterns
Design patterns
 
Lecture 5 Software Engineering and Design Design Patterns
Lecture 5 Software Engineering and Design Design PatternsLecture 5 Software Engineering and Design Design Patterns
Lecture 5 Software Engineering and Design Design Patterns
 
Coding Naked
Coding NakedCoding Naked
Coding Naked
 
[JWPA-1]의존성 주입(Dependency injection)
[JWPA-1]의존성 주입(Dependency injection)[JWPA-1]의존성 주입(Dependency injection)
[JWPA-1]의존성 주입(Dependency injection)
 
Opposites Attract
Opposites AttractOpposites Attract
Opposites Attract
 
8 most expected java interview questions
8 most expected java interview questions8 most expected java interview questions
8 most expected java interview questions
 

Similar to Fragility in evolving software

THE CLR AND THE .NET FRAMEWORK, C#
THE CLR AND THE .NET FRAMEWORK, C#THE CLR AND THE .NET FRAMEWORK, C#
THE CLR AND THE .NET FRAMEWORK, C#
MANOJ BURI
 
Design Patterns
Design PatternsDesign Patterns
Design Patterns
Rafael Coutinho
 
Framework Design Guidelines For Brussels Users Group
Framework Design Guidelines For Brussels Users GroupFramework Design Guidelines For Brussels Users Group
Framework Design Guidelines For Brussels Users Group
brada
 
Usage contracts (presented at SATToSE 2014 in L'Aquila, Italy)
Usage contracts (presented at SATToSE 2014 in L'Aquila, Italy)Usage contracts (presented at SATToSE 2014 in L'Aquila, Italy)
Usage contracts (presented at SATToSE 2014 in L'Aquila, Italy)
kim.mens
 
Poco Es Mucho: WCF, EF, and Class Design
Poco Es Mucho: WCF, EF, and Class DesignPoco Es Mucho: WCF, EF, and Class Design
Poco Es Mucho: WCF, EF, and Class Design
James Phillips
 
Classes2
Classes2Classes2
Classes2
phanleson
 
Prophecy Of Design Patterns
Prophecy Of Design PatternsProphecy Of Design Patterns
Prophecy Of Design Patterns
pradeepkothiyal
 
Unit i
Unit iUnit i
Web-Dev Portfolio
Web-Dev PortfolioWeb-Dev Portfolio
Web-Dev Portfolio
nwbgh
 
Encapsulation
EncapsulationEncapsulation
Encapsulation
FALLEE31188
 
Software Design Patterns
Software Design PatternsSoftware Design Patterns
Software Design Patterns
Pankhuree Srivastava
 
Improving software econimics
Improving software econimicsImproving software econimics
Improving software econimics
Kalica Wadhwa
 
Software Patterns
Software PatternsSoftware Patterns
Software Patterns
bonej010
 
27418524 design-patterns-dot-net-with-examples
27418524 design-patterns-dot-net-with-examples27418524 design-patterns-dot-net-with-examples
27418524 design-patterns-dot-net-with-examples
Quang Suma
 
L03 Software Design
L03 Software DesignL03 Software Design
L03 Software Design
Ólafur Andri Ragnarsson
 
Object Oriented Programming In .Net
Object Oriented Programming In .NetObject Oriented Programming In .Net
Object Oriented Programming In .Net
Greg Sohl
 
JavaOne 2009 BOF-5189 Griffon In Depth
JavaOne 2009 BOF-5189 Griffon In DepthJavaOne 2009 BOF-5189 Griffon In Depth
JavaOne 2009 BOF-5189 Griffon In Depth
Danno Ferrin
 
Design patterns
Design patternsDesign patterns
Design patterns
Binu Bhasuran
 
L5 m256 block2_unit5
L5 m256 block2_unit5L5 m256 block2_unit5
L5 m256 block2_unit5
Dr Omar M.S Hamed
 
Sofwear deasign and need of design pattern
Sofwear deasign and need of design patternSofwear deasign and need of design pattern
Sofwear deasign and need of design pattern
chetankane
 

Similar to Fragility in evolving software (20)

THE CLR AND THE .NET FRAMEWORK, C#
THE CLR AND THE .NET FRAMEWORK, C#THE CLR AND THE .NET FRAMEWORK, C#
THE CLR AND THE .NET FRAMEWORK, C#
 
Design Patterns
Design PatternsDesign Patterns
Design Patterns
 
Framework Design Guidelines For Brussels Users Group
Framework Design Guidelines For Brussels Users GroupFramework Design Guidelines For Brussels Users Group
Framework Design Guidelines For Brussels Users Group
 
Usage contracts (presented at SATToSE 2014 in L'Aquila, Italy)
Usage contracts (presented at SATToSE 2014 in L'Aquila, Italy)Usage contracts (presented at SATToSE 2014 in L'Aquila, Italy)
Usage contracts (presented at SATToSE 2014 in L'Aquila, Italy)
 
Poco Es Mucho: WCF, EF, and Class Design
Poco Es Mucho: WCF, EF, and Class DesignPoco Es Mucho: WCF, EF, and Class Design
Poco Es Mucho: WCF, EF, and Class Design
 
Classes2
Classes2Classes2
Classes2
 
Prophecy Of Design Patterns
Prophecy Of Design PatternsProphecy Of Design Patterns
Prophecy Of Design Patterns
 
Unit i
Unit iUnit i
Unit i
 
Web-Dev Portfolio
Web-Dev PortfolioWeb-Dev Portfolio
Web-Dev Portfolio
 
Encapsulation
EncapsulationEncapsulation
Encapsulation
 
Software Design Patterns
Software Design PatternsSoftware Design Patterns
Software Design Patterns
 
Improving software econimics
Improving software econimicsImproving software econimics
Improving software econimics
 
Software Patterns
Software PatternsSoftware Patterns
Software Patterns
 
27418524 design-patterns-dot-net-with-examples
27418524 design-patterns-dot-net-with-examples27418524 design-patterns-dot-net-with-examples
27418524 design-patterns-dot-net-with-examples
 
L03 Software Design
L03 Software DesignL03 Software Design
L03 Software Design
 
Object Oriented Programming In .Net
Object Oriented Programming In .NetObject Oriented Programming In .Net
Object Oriented Programming In .Net
 
JavaOne 2009 BOF-5189 Griffon In Depth
JavaOne 2009 BOF-5189 Griffon In DepthJavaOne 2009 BOF-5189 Griffon In Depth
JavaOne 2009 BOF-5189 Griffon In Depth
 
Design patterns
Design patternsDesign patterns
Design patterns
 
L5 m256 block2_unit5
L5 m256 block2_unit5L5 m256 block2_unit5
L5 m256 block2_unit5
 
Sofwear deasign and need of design pattern
Sofwear deasign and need of design patternSofwear deasign and need of design pattern
Sofwear deasign and need of design pattern
 

More from kim.mens

Software Maintenance and Evolution
Software Maintenance and EvolutionSoftware Maintenance and Evolution
Software Maintenance and Evolution
kim.mens
 
Context-Oriented Programming
Context-Oriented ProgrammingContext-Oriented Programming
Context-Oriented Programming
kim.mens
 
Software Reuse and Object-Oriented Programming
Software Reuse and Object-Oriented ProgrammingSoftware Reuse and Object-Oriented Programming
Software Reuse and Object-Oriented Programming
kim.mens
 
Bad Code Smells
Bad Code SmellsBad Code Smells
Bad Code Smells
kim.mens
 
Object-Oriented Design Heuristics
Object-Oriented Design HeuristicsObject-Oriented Design Heuristics
Object-Oriented Design Heuristics
kim.mens
 
Software Patterns
Software PatternsSoftware Patterns
Software Patterns
kim.mens
 
Code Refactoring
Code RefactoringCode Refactoring
Code Refactoring
kim.mens
 
Domain Modelling
Domain ModellingDomain Modelling
Domain Modelling
kim.mens
 
Towards a Context-Oriented Software Implementation Framework
Towards a Context-Oriented Software Implementation FrameworkTowards a Context-Oriented Software Implementation Framework
Towards a Context-Oriented Software Implementation Framework
kim.mens
 
Towards a Taxonomy of Context-Aware Software Variabilty Approaches
Towards a Taxonomy of Context-Aware Software Variabilty ApproachesTowards a Taxonomy of Context-Aware Software Variabilty Approaches
Towards a Taxonomy of Context-Aware Software Variabilty Approaches
kim.mens
 
Breaking the Walls: A Unified Vision on Context-Oriented Software Engineering
Breaking the Walls: A Unified Vision on Context-Oriented Software EngineeringBreaking the Walls: A Unified Vision on Context-Oriented Software Engineering
Breaking the Walls: A Unified Vision on Context-Oriented Software Engineering
kim.mens
 
Context-oriented programming
Context-oriented programmingContext-oriented programming
Context-oriented programming
kim.mens
 
Basics of reflection
Basics of reflectionBasics of reflection
Basics of reflection
kim.mens
 
Advanced Reflection in Java
Advanced Reflection in JavaAdvanced Reflection in Java
Advanced Reflection in Java
kim.mens
 
Basics of reflection in java
Basics of reflection in javaBasics of reflection in java
Basics of reflection in java
kim.mens
 
Reflection in Ruby
Reflection in RubyReflection in Ruby
Reflection in Ruby
kim.mens
 
Introduction to Ruby
Introduction to RubyIntroduction to Ruby
Introduction to Ruby
kim.mens
 
Introduction to Smalltalk
Introduction to SmalltalkIntroduction to Smalltalk
Introduction to Smalltalk
kim.mens
 
A gentle introduction to reflection
A gentle introduction to reflectionA gentle introduction to reflection
A gentle introduction to reflection
kim.mens
 
Managing the Evolution of Information Systems with Intensional Views and Rela...
Managing the Evolution of Information Systems with Intensional Views and Rela...Managing the Evolution of Information Systems with Intensional Views and Rela...
Managing the Evolution of Information Systems with Intensional Views and Rela...
kim.mens
 

More from kim.mens (20)

Software Maintenance and Evolution
Software Maintenance and EvolutionSoftware Maintenance and Evolution
Software Maintenance and Evolution
 
Context-Oriented Programming
Context-Oriented ProgrammingContext-Oriented Programming
Context-Oriented Programming
 
Software Reuse and Object-Oriented Programming
Software Reuse and Object-Oriented ProgrammingSoftware Reuse and Object-Oriented Programming
Software Reuse and Object-Oriented Programming
 
Bad Code Smells
Bad Code SmellsBad Code Smells
Bad Code Smells
 
Object-Oriented Design Heuristics
Object-Oriented Design HeuristicsObject-Oriented Design Heuristics
Object-Oriented Design Heuristics
 
Software Patterns
Software PatternsSoftware Patterns
Software Patterns
 
Code Refactoring
Code RefactoringCode Refactoring
Code Refactoring
 
Domain Modelling
Domain ModellingDomain Modelling
Domain Modelling
 
Towards a Context-Oriented Software Implementation Framework
Towards a Context-Oriented Software Implementation FrameworkTowards a Context-Oriented Software Implementation Framework
Towards a Context-Oriented Software Implementation Framework
 
Towards a Taxonomy of Context-Aware Software Variabilty Approaches
Towards a Taxonomy of Context-Aware Software Variabilty ApproachesTowards a Taxonomy of Context-Aware Software Variabilty Approaches
Towards a Taxonomy of Context-Aware Software Variabilty Approaches
 
Breaking the Walls: A Unified Vision on Context-Oriented Software Engineering
Breaking the Walls: A Unified Vision on Context-Oriented Software EngineeringBreaking the Walls: A Unified Vision on Context-Oriented Software Engineering
Breaking the Walls: A Unified Vision on Context-Oriented Software Engineering
 
Context-oriented programming
Context-oriented programmingContext-oriented programming
Context-oriented programming
 
Basics of reflection
Basics of reflectionBasics of reflection
Basics of reflection
 
Advanced Reflection in Java
Advanced Reflection in JavaAdvanced Reflection in Java
Advanced Reflection in Java
 
Basics of reflection in java
Basics of reflection in javaBasics of reflection in java
Basics of reflection in java
 
Reflection in Ruby
Reflection in RubyReflection in Ruby
Reflection in Ruby
 
Introduction to Ruby
Introduction to RubyIntroduction to Ruby
Introduction to Ruby
 
Introduction to Smalltalk
Introduction to SmalltalkIntroduction to Smalltalk
Introduction to Smalltalk
 
A gentle introduction to reflection
A gentle introduction to reflectionA gentle introduction to reflection
A gentle introduction to reflection
 
Managing the Evolution of Information Systems with Intensional Views and Rela...
Managing the Evolution of Information Systems with Intensional Views and Rela...Managing the Evolution of Information Systems with Intensional Views and Rela...
Managing the Evolution of Information Systems with Intensional Views and Rela...
 

Recently uploaded

みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
名前 です男
 
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
saastr
 
Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
ssuserfac0301
 
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptxOcean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
SitimaJohn
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
Quotidiano Piemontese
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Malak Abu Hammad
 
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing InstancesEnergy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Alpen-Adria-Universität
 
Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)
Jakub Marek
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
Matthew Sinclair
 
Recommendation System using RAG Architecture
Recommendation System using RAG ArchitectureRecommendation System using RAG Architecture
Recommendation System using RAG Architecture
fredae14
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
Zilliz
 
Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
Tatiana Kojar
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
Daiki Mogmet Ito
 
WeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation TechniquesWeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation Techniques
Postman
 
UI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentationUI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentation
Wouter Lemaire
 
Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
Hiroshi SHIBATA
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
DianaGray10
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
Pixlogix Infotech
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Speck&Tech
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
shyamraj55
 

Recently uploaded (20)

みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
 
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
 
Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
 
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptxOcean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
 
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing InstancesEnergy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
 
Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
 
Recommendation System using RAG Architecture
Recommendation System using RAG ArchitectureRecommendation System using RAG Architecture
Recommendation System using RAG Architecture
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
 
Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
 
WeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation TechniquesWeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation Techniques
 
UI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentationUI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentation
 
Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
 

Fragility in evolving software

  • 2. BENEVOL'13 Prof. Kim Mens 16,17 Dec. 2013 ICTEAM Mons, Belgium UCL, Belgium Fragility in Evolving Software
  • 3. Fragility Software artefacts make many assumptions about other software artefacts Many of these assumptions are not documented, nor verified explicitly When an artefact evolves into one that doesn't res-pect the assumptions, fragility problems arise Fragility problems can thus be seen as a kind of substitutability problem
  • 5. The Fragile Base Class Problem Object-oriented programs consist of many classes connected through inheritcance Base classes make assumptions about how they can be reused by subclasses Subclasses make assumptions about the classes they inherit from These assumptions are often not documented explicitly, nor verified automatically The fragile base class problem [5,7] occurs when a base class evolves into a new one that doesn't respect these assumptions
  • 6. The Fragile Base Class Problem Base class evolution inheritance ? Subclass Evolved Base class
  • 7. Fragility in Aspect Oriented Programming AOP = base code + aspects Aspects = pointcuts + advice code Aspects modify the behaviour of the base code by weaving in advice code at various join points, described by pointcut expressions Base code is oblivious to the aspects
  • 8. Fragility in AOP Both pointcuts and advice code make assumptions about the base code they refer to or act upon These assumptions are not documented explicitly, nor verified automatically Subtle conflicts arise when the base code evolves in a way that breaks these assumptions These problems are known as the fragile pointcut problem [2,6] and the fragile advice problem [1]
  • 9. Fragility in AOP Base code aspect weaving evolution p ile ag fr Aspect = pointcut + advice t ? cu nt oi ? ice dv a ile ag fr Evolved Base code
  • 10. Dealing with fragility Fragility problems arise when implicit assumptions between dependent artefacts get broken when the system evolves Solution consists of documenting the assumptions explicitly, and verifying them upon evolution By defining some kind of evolution contract between the evolving artefact and its dependent artefacts A verifiable agreement between the two parties Detect fragility conflicts by verifying the contract
  • 11. Dealing with fragility Different kinds of fragility conflicts can be distinguished, depending on : how the artefact evolves how the artefacts depend on each other what conditions of the contract are breached Appropriate solutions to these conflicts can be proposed accordingly
  • 12. Handling the fragile base class problem 1. Define a reuse contract [7] between a derived class and the base class it depends on how does the reuser specialize the base class? 2. Define a usage contract [4] between the base class and the derived classes that "use" it what regularities does the base class expect the derived classes to respect ?
  • 13. Reuse Contracts Reuse contracts define an evolution contract between a "reuser" and the base class it depends upon the base class declares a specialization interface [3] defining what reusers can rely upon a reuse operator defines how derived classes reuse the base class an evolution operator defines how the base class evolved
  • 14. Reuse Contracts DesktopFolder Coarsening DesktopFolder xpos, ypos, contents addMany {-add} xpos, ypos, contents move move add add addMany {add} addMany Refinement add {+size} SizedFolder size add {size} ?
  • 15. Reuse Contracts DesktopFolder Coarsening DesktopFolder xpos, ypos, contents addMany {-add} xpos, ypos, contents move move add add addMany {add} addMany Refinement add {+size} SizedFolder size Inconsistent Methods add {size} addMany should be overridden too
  • 16. Reuse Contracts Extension +m Extension +p Refinement m {+n} name con- method flict [m=p] capture [n=p] Cancelation -m Coarsening m {-n} ... ... ... ... Refinement p {+q} ... ... ... Cancelation -p ... ... ... ... ... Coarsening p {-q} ... ... ... ... ... ... ... ... ... ... ... inconsistent method [n=p] ...
  • 17. Usage Contracts Usage contracts [4] define an evolution contract between the base class and the classes that "use" it base class defines what regularities should be respected by its derived classes regularities are checked when modifying existing or creating new derived classes
  • 18. Usage Contracts Describe expectations of "provider" : FAMIXSourcedEntity copyFrom: anEntity within: aVisitor inheritance All overriders of copyFrom: within: should start with a super call "Consumer" should comply with these expectations X copyFrom: anEntity within: aVisitor super copyFrom: anEntity within: aVisitor
  • 19. Usage Contracts FAMIXSourcedEntity copyFrom: anEntity within: aVisitor All overriders of copyFrom: within: should start with a super call Evolved / new class inheritance should still / also comply X Evolved or new X copyFrom: anEntity within: aVisitor super copyFrom: anEntity within: aVisitor evolution copyFrom: anEntity within: aVisitor ???
  • 20. Usage Contracts A DSL for declaring usage contracts Specifying the liable entities of the contract scope of classes or methods to which the contract is applicable Defining the structural regularity structural constraints to be respected by the liable entities These lightweight contracts are checked and reported immediately during development and maintenance
  • 21. Usage Contracts All overriders of copyFrom: within: Specifying the liable entities should start with a super call classesInFAMIXSourcedEntityHierarchy <liableHierarchy: #FAMIXSourcedEntity> Defining the structural regularity copyFromWithinWithCorrectSuperCall <selector: #copyFrom:within:> contract: require: (condition beginsWith: if: (condition isOverridden) (condition doesSuperSend: #copyFrom:within:)
  • 22. The fragile pointcut problem In aspect-oriented programming, the base program is oblivious of the aspects that act upon it Pointcut expressions describe at what join points in the base program advice code will be woven The fragile pointcut problem [2] occurs when pointcut expressions unintendedly capture or accidentally miss particular join points as a consequence of their fragility with respect to seemingly safe evolutions of the base program
  • 23. The fragile pointcut problem E.g., a pointcut expression to capture getters and setters An "enumeration" pointcut: pointcut accessors() call(void Buffer.set(Object)) || call(Object Buffer.get()); May accidentally miss other relevant getters and setters A "pattern-based" pointcut: pointcut accessors() call(* set*(..)) || call(* get*(..)); May unintendedly capture methods that aren't getters or setters for example, a method named setting
  • 24. The fragile pointcut problem Pointcuts in program Pointcuts in evolved program d nde ture te nin t cap u in po oin j Class Name Attributes Attributes Operations Operations Class Name Attributes Attributes Operations Operations Class Name Attributes Attributes Operations Operations * Class Name Attributes Attributes Operations Operations * Class Name Attributes Attributes Operations Operations Class Name Attributes Attributes Operations Operations Class Name Attributes Attributes Operations Operations Source program EVOLUTION Class Name Attributes Attributes Operations Operations * Class Name Attributes Attributes Operations Operations * Class Name Attributes Attributes Operations Operations Class Name Attributes Attributes Operations Operations Class Name Attributes Attributes Operations Operations Evolved Source program al ent iss id acc int m po oin j
  • 25. Model-based pointcuts Model-based poincuts [2] define an evolution contract between the pointcuts and the base code, in terms of an intermediate model that both agree upon. A "model-based" pointcut: pointcut accessors() classifiedAs(?methSignature,AccessorMethods) && call(?methSignature) The base code should comply with the model, but remains oblivious of the actual aspects Some fragility problems can be encountered by defining and verifying additional constraints at the level of the model For example, every setter method should have a name of the form setX and assign a value to the variable X
  • 26. Model-based pointcuts Pointcuts Additional constraints such as: Conceptual Model { methods named set* } = { methods assigning an instance variable } Class Name Attributes Attributes Operations Operations Class Name Attributes Attributes Operations Operations Class Name Attributes Attributes Operations Operations * * Class Name Attributes Attributes Operations Operations Source code Class Name Attributes Attributes Operations Operations Class Name Attributes Attributes Operations Operations
  • 27. Model-based pointcuts Pointcuts Pointcuts in Evolved Code Conceptual Model Class Name Attributes Attributes Operations Operations Class Name Attributes Attributes Operations Operations Conceptual Model Class Name Attributes Attributes Operations Operations * Class Name Attributes Attributes Operations Operations * Class Name Attributes Attributes Operations Operations Source code Class Name Attributes Attributes Operations Operations Class Name Attributes Attributes Operations Operations EVOLUTION Class Name Attributes Attributes Operations Operations * Class Name Attributes Attributes Operations Operations * Class Name Attributes Attributes Operations Operations Class Name Attributes Attributes Operations Operations Evolved Source code Class Name Attributes Attributes Operations Operations
  • 28. Summary Software fragility arises when implicit assumptions artefacts make about dependent and depending artefacts get broken upon evolution Solutions consists of documenting these assumptions explicitly as "evolution contracts", and verifying them whenever the software evolves Appropriate conflict resolutions can be suggested depending on how the artefacts evolved and on what assumptions got broken
  • 29. Other potential application areas We have applied these ideas mostly to OO, FW and AO software development Other envisaged application areas : dynamically adaptive systems and COP in particular evolving configurations of network routers data-intensive systems ...
  • 30. Take-away message A good idea is timeless. To reinvent yourself it sometimes suffices to rediscover yourself. Revive research on software reuse and evolution by reusing or evolving old research on software reuse and evolution. Context-oriented progamming is one potential new application area of these ideas. Ideas could be applied to any domain where you have potential fragility problems.
  • 31. Timeline Usage Contracts: Offering Immediate Feedback on Violations of Structural Source-code Regularities Angela Lozanoa , Andy Kellensb , Kim Mensa a Universit´ catholique de Louvain e b Vrije Universiteit Brussel Abstract Developers often encode design knowledge through structural regularities such as API usage protocols, coding idioms and naming conventions. As these regularities express how the source code should be structured, they provide vital information for developers using or extending that code. Adherence to such regularities tends to deteriorate over time when they are not documented and checked explicitly. This paper introduces uContracts, an internal DSL to codify and verify such regularities using ‘usage contracts’. Whereas our DSL does not aim to be complete, it does cover common usage regularities, while providing a means through metaprogramming to express atypical regularities. Common regularities are identified based on regularities supported by existing approaches to detect bugs or suggest missing code fragments, techniques that mine for structural regularities, as well as on the analysis of an open-source project. We validate our DSL by documenting the usage regularities of an industrial case study, and analyse how useful the information provided by checking these regularities is for the developers of that case study. ? 1. Introduction Being able to document and preserve architectural integrity and design knowledge of an application is important to increase its longevity [4]. Given that over time the actual implementation structure tends to drift away from Email addresses: angela.lozano@uclouvain.be (Angela Lozano), andy.kellens@vub.ac.be (Andy Kellens), kim.mens@uclouvain.be (Kim Mens) contracts March 26, 2013 Dyn. evol. Contracts Usage AOSD'06 Pointcuts Model-based OOPSLA'96 Contracts Reuse Preprint submitted to Science of Computer Programming
  • 32. Some references 1. Cyment, Kicillof, Altman & Asteasuain. Improving AOP systems’ evolvability by decoupling advices from base code. RAM-SE’06 WS @ ECOOP’06, pp 9–21, 2006. 2. Kellens, Mens, Brichau & Gybels. Managing the evolution of aspect-oriented software with model-based pointcuts. ECOOP’06, pp 501–525, 2006. 3. Lamping. Typing the specialization interface. OOPSLA ’93, pp 201–214, 1993. 4. Lozano, Kellens & Mens. Usage contracts: Offering immediate feedback on violations of structural source-code regularities. Under revision. 5. Mikhajlov & Sekerinski. A study of the fragile base class problem. ECOOP’98, pp 355–382, 1998. 6. Noguera, Kellens, Deridder & D’Hondt. Tackling pointcut fragility with dynamic annotations. RAM-SE’10 WS @ ECOOP’10, pp 1–6, 2010. 7. Steyaert, Lucas, Mens & D’Hondt. Reuse contracts: Managing the evolution of reusable assets. OOPSLA’96, pp 268–285, 1996.