Today software systems are composed from various artifacts, which have a specific purpose and describe only a part of the whole system from a particular perspective. Source code, unit tests and contracts can be such artifacts during the implementation phase. The latter formally specifies the source code and can enforce these specifications. These artifacts have some overlap such as the signatures of methods. This overlap must not be contradictory. Otherwise, the software system cannot be composed. Therefore, an approach for the co-evolution of these artifacts is necessary in order to keep them consistent after changes. Several approaches exist for keeping code, contracts and unit tests consistent after changes. These approaches only focus, however, on a very limited amount of possible changes and often the concept for applying them in an automated way is not publicly available. To our knowledge, no comprehensive approach exists for co-evolving all artifacts in an automated way. The contribution of this thesis is an approach for co-evolution of source code, unit tests and contracts. For Java code, JUnit tests and Java Markup Language (JML) contracts we analyze the overlapping information and define reactions on possible changes. We generalize the results for object-oriented languages and arbitrary specification languages afterwards. We implemented our approach for Java code and JML contracts with modeldriven techniques based on a synchronization framework. We transform the artifacts from code into models, apply corresponding reactions for the change and serialize the models into code again. These reactions can be quite simple or complex such as the reaction on a changed method: We determine whether the method body is side-effect free and add or remove the corresponding annotation of the contract for the method and all callers if required. Additionally we use an existing approach to monitor changes in Java code and apply the changes to the other artifacts automatically. This is fully transparent to users because they only receive consistent code artifacts after performing a change and do not need to know about models or the transformations. We evaluated our approach and our implementation with a case study focusing on the correct handling of changes in a real-world project. We showed that our approach is able to keep code and contracts consistent for 1036 out of 1085 rename refactorings (ca. 95 %) and that it can support co-evolution in the implementation phase.
[1]
Parag Himanshu Dave,et al.
Design and Analysis of Algorithms
,
2009
.
[2]
Jacqueline Grennon.
, 2nd Ed.
,
2002,
The Journal of nervous and mental disease.
[3]
Yishai A. Feldman,et al.
Discern: Towards the Automatic Discovery of Software Contracts
,
2006,
Fourth IEEE International Conference on Software Engineering and Formal Methods (SEFM'06).
[4]
dizayn İç dekor.
Design by Contract
,
2010
.
[5]
Bertrand Meyer,et al.
Contract driven development = test driven development - writing test cases
,
2007,
ESEC-FSE '07.
[6]
Yishai A. Feldman,et al.
Refactoring with contracts
,
2006,
AGILE 2006 (AGILE'06).
[7]
Daniel M. Zimmerman,et al.
JMLUnit: The Next Generation
,
2010,
FoVeOOS.
[8]
Markus Völter,et al.
Model-Driven Software Development: Technology, Engineering, Management
,
2006
.
[9]
Gary T. Leavens,et al.
A Simple and Practical Approach to Unit Testing: The JML and JUnit Way
,
2002,
ECOOP.
[10]
Tom Snyder,et al.
Test-Driven Development: A J2EE Example
,
2004
.
[11]
Richard F. Paige,et al.
Agile Specification-Driven Development
,
2004,
XP.
[12]
Max E. Kramer,et al.
View-centric engineering with synchronized heterogeneous models
,
2013
.
[13]
Ian Sommerville.
Teaching cloud computing: A software engineering perspective
,
2013,
J. Syst. Softw..