2. Projekt „B2-PDE“
• Beteiligte:
– Technische Universität Dresden (Lehrstuhl
Softwaretechnologie)
– Comarch Software AG (Dresden)
• FuE-Verbundprojekt gefördert von der SAB
• Projektrahmen: ERP-System „B2“
– Praktische Probleme bei neuen Versionen des B2-Frameworks :
• Plugin-Anpassung
• Tutorial-Anpassung
Innovationsforum, 28.11.2007 Ilie Şavga Slide 2 of 16
3. Software Technology Group, Department of Computer Science, Technische Universität Dresden
Changed-Based Support for
Binary Compatibility in
Evolving Frameworks
M.Sc. Ilie Şavga (B2-PDE Team)
Innovation Forum, 28.11.2007, Dresden
4. Software Frameworks
Framework Version 1
A software framework is a software component
that embodies a skeleton solution for a family
of related software products and is instantiated
Customer
by modules containing custom code (plugins).
getName()
getDiscount()
Johnson and Foote 1998
customer.getDiscount();
Plugin Version 1
Innovationsforum, 28.11.2007 Ilie Şavga Slide 4 of 16
5. Framework Change Breaking a Plugin
Framework Version 1 Framework Version 2
Customer
getName()
ExtractSubclass
Customer
getName()
VipCustomer
getDiscount()
getDiscount()
customer.getDiscount();
Plugin Version 1
Innovationsforum, 28.11.2007 Ilie Şavga Slide 5 of 16
6. Motivation and Goal
We want to automatically preserve binary compatibility of framework and its
plugins—the latter must link and run with new framework releases without
recompiling.
Forman et al., 1995
Using change history automatically retain binary compatibility to
reduce the costs and improve the quality of framework
upgrade.
Innovationsforum, 28.11.2007 Ilie Şavga Slide 6 of 16
7. Change-Driven Adaptation
ExtractSubclass Framework Version 2
Customer
generate
generate
getName()
Adapter (wrapper) design pattern
GoF 1995;
VipCustomer
delegate
getDiscount()
delegate
Customer
getName()
getDiscount()
Adapter Version 1-to-2
customer.getDiscount();
Plugin Version 1
Innovationsforum, 28.11.2007 Ilie Şavga Slide 7 of 16
8. Adaptation Layer for Binary Compatibility
Change
Change
Specification
Specification
input
F2
Generator
Generator
generate
AL1
delegate
P1 P2
time
Innovationsforum, 28.11.2007 Ilie Şavga Slide 8 of 16
10. Two Adaptation Tools of B2-PDE
• Differ in how the change information is specified
ADE: B2-PDE
change mapping
effectiveness Development
ComeBack!:
refactoring-based
automation
Innovationsforum, 28.11.2007 Ilie Şavga Slide 10 of 16
11. Framework Refactoring Breaking a Plugin
Framework Version 1 Framework Version 2
Customer
getName()
ExtractSubclass
Customer
getName()
VipCustomer
getDiscount()
getDiscount()
Refactoring is a behavior-preserving
source transformation.
Opdyke 1992; Roberts 1999; Fowler 1999
customer.getDiscount();
Refactoring operations comprise >80%
of application-breaking API changes.
Plugin Version 1
Dig and Johnson 2005
Innovationsforum, 28.11.2007 Ilie Şavga Slide 11 of 16
12. The ComeBack! Tool
Framework
Framework
Binaries
Binaries
parsing
ComeBack!
Framework
Framework
Fact Base
Fact Base
Prolog
Comeback Refactoring
Prolog
Comeback Refactoring
Engine
Library History
Engine
Library History
Adapter
Adapter
Fact Base
Fact Base
pretty printing
Adapter
Adapter
Layer
Layer
ComeBack! homepage: http://comeback.sf.net
Innovationsforum, 28.11.2007 Ilie Şavga Slide 12 of 16
13. Refactoring-Based Adaptation
Refactoring
Refactoring
input
History
History
F3
Generator
Generator
generate generate
AL1 AL2
delegate
delegate
P1 P2 P3
time
Innovationsforum, 28.11.2007 Ilie Şavga Slide 13 of 16
14. ADE: Adapter Development Environment
F1 F3
input input
Heuristic Engine
Heuristic Engine
output
amend and
complete
Change
Change
Mapping
Mapping
developers
developers
Innovationsforum, 28.11.2007 Ilie Şavga Slide 14 of 16
16. Adaptation in B2-PDE: Benefits
• Framework developers
• no update patches
• empowered framework maintenance
• Third-party companies
• no manual plugin adaptation
• End Users
• „silent“ plugin adaptation
For all
Treated as a specification, change history fosters the automatic
preservation of binary compatibility reducing the costs and
increasing the quality of framework upgrade.
Innovationsforum, 28.11.2007 Ilie Şavga Slide 16 of 16
18. References
R. Johnson and B. Foote. Designing reusable classes. Journal of Object-Oriented Programming, 1(2):22–35, June 1988.
W. F. Opdyke. Refactoring Object-Oriented Frameworks. PhD thesis, Urbana-Champaign, IL, USA, 1992.
D. B. Roberts. Practical analysis for refactoring. PhD thesis, University of Illinois at Urbana-Champaign, Urbana, Illinois, 1999.
M. Fowler. Refactoring: Improving the Design of Existing Code. Addison-Wesley, 1999.
D. Dig and R. Johnson. The role of refactorings in API evolution. In ICSM ’05: Proceedings of the 21st IEEE International Conference on Software
Maintenance (ICSM’05), pages 389–398, Washington, DC, USA, 2005. IEEE Computer Society.
GoF: E. Gamma, R. Helm, R. Johnson, and J. Vlisside. Design Patterns: Elements of Reusable Object-Oriented Software. Addison-Wesley, Reading,
Massachusetts, 1995.
S. Becker, A. Brogi, I. Gorton, S. Overhage, A. Romanovsky, and M. Tivoli. Towards an engineering approach to component adaptation. In R. H.
Reussner, J. A. Stafford, and C. A. Szyperski, editors, Architecting Systems with Trustworthy Components, volume 3938 of Lecture Notes in
Computer Science, pages 193–215. Springer, 2004.
J. A. Stafford, and C. A. Szyperski, editors, Architecting Systems with Trustworthy Components, volume 3938 of Lecture Notes in Computer Science,
pages 193–215. Springer, 2004.
CORBA homepage. http://www.corba.org
Microsoft COM homepage. http://www.microsoft.com/Com/default.mspx.
J. Camara, C. Canal, J. Cubo, and J. Murillo. An aspectoriented adaptation framework for dynamic component evolution. In 3rd ECOOP Workshop on
Reflection, AOP and Meta-Data for Software Evolution, pages 59–71, 2006.
I. R. Forman, M. H. Conner, S. H. Danforth, and L. K. Raper. Release-to-release binary compatibility in SOM. In OOPSLA ’95: Proceedings of the tenth
annual conference on Objectoriented programming systems, languages, and applications, pages 426–438, New York, NY, USA, 1995. ACM
Press.
S. Malabarba, R. Pandey, J. Gragg, E. Barr, and J. F. Barnes. Runtime support for type-safe dynamic java classes. In ECOOP ’00: Proceedings of the
14th European Conference on Object-Oriented Programming, pages 337–361, London, UK, 2000. Springer-Verlag.
I.Balaban, F. Tip, and R. Fuhrer. Refactoring support for class library migration. In OOPSLA ’05: Proceedings of the 20th annual ACM SIGPLAN
conference on Object oriented programming, systems, languages, and applications, pages 265–279, New York, NY, USA, 2005. ACM Press.
K. Chow and D. Notkin. Semi-automatic update of applications in response to library changes. In ICSM ’96: Proceedings of the 1996 International
Conference on Software Maintenance, page 359, Washington, DC, USA, 1996. IEEE Computer Society.
J. Henkel and A. Diwan. Catchup!: capturing and replaying refactorings to support API evolution. In ICSE ’05: Proceedings of the 27th international
conference on Software engineering, pages 274–283, New York, NY, USA, 2005. ACM Press.
R. Keller and U. Hoelzle. Binary component adaptation. Lecture Notes in Computer Science, 1445:307–318, 1998.
S. Roock and A. Havenstein. Refactoring tags for automatic refactoring of framework dependent applications. In XP’02: Proceedings of Extreme
Programming Conference, pages 182–185, 2002.
Innovationsforum, 28.11.2007 Ilie Şavga Slide 18 of 16
19. Comebacks
A comeback is a refactoring transforming adapters to compensate
for a framework refactoring.
Refactoring Comeback
AddClass(class,superclass, subclasses) CbAddClass(class,superclass,subclasses):
– RemoveClass (class)
PushDownMethod CbPushDownMethod
(class,subclass,method) (class,subclass,method):
– AddMethod(class,Method(subclass,method))
– RemoveMethod(subclass,method)
ExtractSubclass CbExtractSubclass
(class,subclass,methods) (class,subclass,methods):
– forall m in methods:
CbPushDownMethod(class,subclass,m)
– CbAddClass(subclass,class,Subclasses(class))
Innovationsforum, 28.11.2007 Ilie Şavga Slide 19 of 16
20. Related Work
Prevention Facilitation
Use of a legacy middleware or a Distribute changes: change info (as
specific communication protocol annotations or separate
to connect a framework and its specifications) + adaptation rules.
plugins.
Pros: potentially unlimited
Pros: transparent client adaptation,
power.
in some cases without
recompilation.
Cons: middleware-dependent Cons: cumbersome manual
framework development. specifications; invasion by
adapter code requires source
availability and recompilation.
CORBA; COM; Forman et al., 1995; Malabarba et al., 2000; Balaban et al., 2005; Chow and Notkin 1996; Henkel and Diwan 2005;
Camara et al. 2006; Keller and Hölze 1998; Roock and Havenstein 2002;
Innovationsforum, 28.11.2007 Ilie Şavga Slide 20 of 16
21. Setting the Context
Refactoring
Note: we consider the addition of functionality also a refactoring
Pure Deletion is not allowed
Frameworks
API well defined
Black- and white-box
Callbacks
No generic types in the API
No public fields in the API
Reflection and serialization used in a adaptive-aware disciplined way
Controlled (expressed by refactoring) split/merge of types
Innovationsforum, 28.11.2007 Ilie Şavga Slide 21 of 16
22. Beyond Refactorings
Adaptable signature-level component mismatches, no protocol or
semantic adaptation.
Becker et al. 2004
Intended behavior-modifying framework changes:
• Visible: to be tested
– Testing adapters
• Unvisible: to be adapted
– Updating change specification Dig et al. 2007; MolhadoRef
Innovationsforum, 28.11.2007 Ilie Şavga Slide 22 of 16
23. Other Related Issues
• Refactoring acquisition
– Manual: annotations, + version control systems Chow and Notkin 1996; Wemmie 2006
– Semi-automatic: metrics-based heuristics, vector space information
retrieval, relating CVS to transactions, origin analysis, clone detection
Demeyer et al. 2000; Antoniol et al. 2004; Gorg and Weisgerber 2005;
Zou and Godfrey 2003; Rysselberghe and Demeyer 2003
• combination of syntactic (signature-based, shingles) and semantic
(clone detection, reference graphs) analysis Weissgerber and Diehl 2006; Dig et al. 2006
– Automatic: Eclipse and JBuilder
• Refactoring representation
– Refactoring-aware SCM system Dig et al. 2007; MolhadoRef
• Refactoring and metrics
– Predictive and retrospective
– Process-oriented frameworks Mens and Demeyer 2001; Cimon et al. 2000; Tahvildari et al. 2003
• Refactoring-driven testing Bannwart and Müller 2006
Innovationsforum, 28.11.2007 Ilie Şavga Slide 23 of 16
24. Tecnical Issues
• Linkage problems
– Currently by reflection
– In the future: by strong names
• Wrapping/Unwrapping types
– Imply adaptation-requires dedicated methods
– The performance pentalties to estimate
Innovationsforum, 28.11.2007 Ilie Şavga Slide 24 of 16
25. References
S. Demeyer, S. Ducasse, and O. Nierstrasz. Finding refactorings via change metrics. In OOPSLA ’00: Proceedings of the 15th ACM
SIGPLAN conference on Object-oriented programming, systems, languages, and applications, pages 166–177, New York, NY,
USA, 2000. ACM Press.
G. Antoniol, M. D. Penta, and E. Merlo. An automatic approach to identify class evolution discontinuities. In IWPSE ’04: Proceedings of
the Principles of Software Evolution, 7th International Workshop on (IWPSE’04), pages 31–40, Washington, DC, USA, 2004. IEEE
Computer Society.
C. Gorg and P. Weisgerber. Detecting and visualizing refactorings from software archives. In IWPC ’05: Proceedings of the 13th
International Workshop on Program Comprehension, pages 205–214, Washington, DC, USA, 2005. IEEE Computer Society.
L. Zou and M.W. Godfrey. Detecting merging and splitting using origin analysis. In WCRE ’03: Proceedings of the 10th Working
Conference on Reverse Engineering, page 146, Washington, DC, USA, 2003. IEEE Computer Society.
F. V. Rysselberghe and S. Demeyer. Reconstruction of successful software evolution using clone detection. In IWPSE ’03: Proceedings
of the 6th International Workshop on Principles of Software Evolution, page 126, Washington, DC, USA, 2003. IEEE Computer
Society.
P. Weissgerber and S. Diehl. Identifying refactorings from source-code changes. In ASE ’06: Proceedings of the 21st IEEE
International Conference on Automated Software Engineering (ASE’06), pages 231–240, Washington, DC, USA, 2006. IEEE
Computer Society.
D. Dig, C. Comertoglu, D. Marinov, and R. Johnson. Automated detection of refactorings in evolving components. In D. Thomas,
editor, ECOOP, volume 4067 of Lecture Notes in Computer Science, pages 404–428. Springer, 2006.
D. Dig, K. Manzoor, R. Johnson, and T. N. Nguyen. Refactoring-aware configuration management for object-oriented programs. In
ICSE, 2007.
Molhadoref homepage. https://netfiles.uiuc.edu/dig/MolhadoRef.
C. Bitter. Using Aspect-Oriented Techniques for Adaptation. Master Thesis, TU Dresden, 2007.
T. Mens and S. Demeyer. Evolution metrics. In Proc. Int. Workshop on Principles of Software Evolution, 2001.
L. Tahvildari, K. Kontogiannis, and J. Mylopoulos. Quality-driven software reengineering. Journal of System Software, 66(3):225–239,
2003.
F. Bannwart and P. Müller. Changing programs correctly: Refactoring with specifications. In J. Misra, T. Nipkow, and E. Sekerinski,
editors, FM, volume 4085 of Lecture Notes in Computer Science, pages 492–507. Springer, 2006.
T. Mens, N. V. Eetvelde, S. Demeyer, and D. Janssens. Formalizing refactorings with graph transformations: Research articles. Journal
of Software Maintenance and Evolution:Research and Practice, 17(4):247–276, 2005.
N.V.Eetvelde. A Graph Transformation Approach to Refactoring. University of Antwerp. PhD. Thesis, 2007.
Innovationsforum, 28.11.2007 Ilie Şavga Slide 25 of 16