350 likes | 467 Views
Managing the Evolution of Reusable Assets. Theo D’Hondt Patrick Steyaert Programming Technology Lab Vrije Universiteit Brussel. Activities. Conventional Software Engineering. Software Engineering 1975 A.D. Software Engineering 1985 A.D. Recent Insight. Engineering Techniques in Software….
E N D
Managing the Evolution of Reusable Assets Theo D’Hondt Patrick Steyaert Programming Technology Lab Vrije Universiteit Brussel
Engineering Techniques in Software… Modularity
Reuse assets are the gold coins of software engineering. Legacy is the dirty word of software engineering.
What can Go Wrong… • Arian 4 • well tested software • proven correctly • Arian 5 • reuse of pieces of Ariane 4 software • result: trivial error (floating point error), large consequences • What happened ? • changed flight specifications
Our Example: Tape Management TapeManipulation Tape manipulates TapeManager accept(Tape) identification kvu associate(script) manages manipulate(Tape) register(Tape) transfer(Tape) • Tapes are manipulated • - adding scripts, visioning • Tapes are managed • - tracking, kvu checking
Tape Components TapeManipulation Tape manipulates TapeManager accept(Tape) identification kvu associate(script) manages manipulate(Tape) register(Tape) transfer(Tape) Shipping-Receiving Traffic Visioning Technical Visioning receive(Tape) ship(Tape) location?(Tape) manipulate(Tape) manipulate(Tape) tape manipulation internal to visioning depends on kvu, script present, ...
Technical Visioning Traffic Tape Composition Problem !
Challenges: Impact Analysis Changing a method
Example TapeManager TapeManager parent class change add(Tape) add(Tape) addAll(TapeSet) addAll(TapeSet) OOTVTapeManager OOTVTapeManager notify notify add(Tape) add(Tape) addAll(TapeSet) addAll(TapeSet) no notification
Challenges: Proliferation of Versions • Application A • MyTapeManager • Tape • Repository • Tapemanager • Tapes • Application B • MyTape • Application C • XTapeManager Maintenance problem: version management Development problem: design for reuse
? Visioning manipulate(Tape) Challenges: Design for Reuse TapeManipulation TapeManager accept(Tape) manipulate(Tape) register(Tape) transfer(Tape) How to improve reusability? Traffic ... ... location?(Tape)
Reuse Contracts Asset provider Asset reuser • declares what assump-tions can be made about the asset • declares how an asset can be reused • formally, non-coercively • declares what assumptions are made about the asset • declares how an asset is reused • formally,disciplined • rules for change propagation
Contracts & Specialisation Clauses tm:TapeManager implementation will invoke transfer, manip… notify(...) 3.transfer [notify] 2.accept [manipulate, transfer] 4.transfer [accept] m:TapeManip… next:TapeManip… 1.accept accept(Tape) accept(Tape) manipulate(Tape) transfer(Tape) tape transfer contract Contracts declare the assumptions that can be made about a class and how a it can be reused.
Evolution and Composition Changing a method
Remember TapeManipulation Tape manipulates TapeManager accept(Tape) identification kvu associate(script) manages manipulate(Tape) register(Tape) transfer(Tape) Shipping-Receiving Traffic Visioning Technical Visioning receive(Tape) ship(Tape) location?(Tape) manipulate(Tape) manipulate(Tape) Composition Problem !
Traffic Traffic Changing Assumptions Assumption made by reuser (before change) TapeManip.transfer [notify] Assumes What can be assumed (after composition or change) Actually gets TapeManip.transfer []
BUT… TapeManager TapeManip.transfer [notify] …concrete parent class … Assumes Traffic notify(...) Too verbose Does not document how TapeManager is actually reused
Declaring How a Class is Actually Reused TapeManager TapeManager documenting different kinds of reuse notify (...) notify (...) • Refinement • notify [+track] Traffic Traffic track track notify [track] notify [track]
Different Kinds of Reuse • Assumption “preserving” • Concretisation: filling in the “hotspots” • Refinement: refining the overall design • Extension: adding new behaviour • Assumption “breaching” • Abstraction: generalisation • Coarsening: performance optimisation • Cancellation: fixes
Estimating Impact of Changes • Coarsening • addAll [-add] TapeManager TapeManager add(Tape) add(Tape) addAll(TapeSet)[add] addAll(TapeSet) [] • Refinement • add [+notify] • Refinement • add [+notify] OOTVTapeManager OOTVTapeManager notify notify add(Tape) [notify] add(Tape) [notify] addAll(TapeSet) [add] addAll(TapeSet) [add] # addAll needs to be overridden too
Estimating Composability tape transfer contract TapeManager TapeManipulation notify (...) transfer (Tape) [notify] • Refinement • notify [+track] • Coarsening • transfer [-notify] Traffic Technical Visioning track transfer (Tape) [] notify [track] # composition problem
Reuse Contracts for Inheritance Asset provider Asset reuser TapeManager • Refinement • add […] add() addAll() [add] • formally • non-coercively • formally • disciplined • rules for detecting conflicts
Conclusion • New style of software engineering • modularity reuse objects • learn about the problem domain as you go along with projects • Challenges • supporting reuse • supporting evolution • Reuse Contracts • incrementally turn software artifacts in assets