Applying Design by Contract to Feature-Oriented Programming

Feature-oriented programming (FOP) is an extension of ob- ject-oriented programming to support software variability by refining existing classes and methods. In order to increase the reliability of all implemented program variants, we integrate design by contract (DbC) with FOP. DbC is an approach to build reliable object-oriented software by specifying methods with contracts. Contracts are annotations that document and formally specify behavior, and can be used for formal verification of correctness or as test oracles. We present and discuss five approaches to define contracts of methods and their refinements in FOP. Furthermore, we share our insights gained by performing five case studies. This work is a foundation for research on the analysis of feature-oriented programs (e.g., for verifying functional correctness or for detecting feature interactions).

[1]  Christian Prehofer,et al.  Feature-Oriented Programming: A Fresh Look at Objects , 1997, ECOOP.

[2]  Reiner Hähnle,et al.  A Liskov Principle for Delta-Oriented Programming , 2012, ISoLA.

[3]  Elmar Jürgens,et al.  Do code clones matter? , 2009, 2009 IEEE 31st International Conference on Software Engineering.

[4]  Sven Apel,et al.  Detection of feature interactions using feature-aware verification , 2011, 2011 26th IEEE/ACM International Conference on Automated Software Engineering (ASE 2011).

[5]  Bertrand Meyer,et al.  Applying 'design by contract' , 1992, Computer.

[6]  Albert L. Baker,et al.  Preliminary design of JML: a behavioral interface specification language for java , 2006, SOEN.

[7]  Bernhard Beckert,et al.  Formal Verification of Object-Oriented Software - International Conference, FoVeOOS 2010, Paris, France, June 28-30, 2010, Revised Selected Papers , 2011, FoVeOOS.

[8]  Sven Apel,et al.  Automatic detection of feature interactions using the Java modeling language: an experience report , 2011, SPLC '11.

[9]  Sven Apel,et al.  An Overview of Feature-Oriented Software Development , 2009, J. Object Technol..

[10]  Gary T. Leavens,et al.  Forcing behavioral subtyping through specification inheritance , 1996, Proceedings of IEEE 18th International Conference on Software Engineering.

[11]  Kyo Chul Kang,et al.  Feature-Oriented Domain Analysis (FODA) Feasibility Study , 1990 .

[12]  Vladimir Klebanov,et al.  Verification of Software Product Lines with Delta-Oriented Slicing , 2010, FoVeOOS.

[13]  Jeannette M. Wing,et al.  A behavioral notion of subtyping , 1994, TOPL.

[14]  Satoshi Matsuoka,et al.  ECOOP'97 — Object-Oriented Programming , 1997, Lecture Notes in Computer Science.

[15]  Daniel Bruns,et al.  Verification of Software Product Lines: Reducing the Effort with Delta-oriented Slicing and Proof Reuse , 2010 .

[16]  Don Batory,et al.  Scaling step-wise refinement , 2003, 25th International Conference on Software Engineering, 2003. Proceedings..

[17]  Jianjun Zhao,et al.  Pipa: A Behavioral Interface Specification Language for AspectJ , 2003, FASE.

[18]  Jing Liu,et al.  Compositional model checking of software product lines using variation point obligations , 2010, Automated Software Engineering.

[19]  C. A. R. HOARE,et al.  An axiomatic basis for computer programming , 1969, CACM.

[20]  Sergio Segura,et al.  Automated analysis of feature models 20 years later: A literature review , 2010, Inf. Syst..

[21]  David H. Lorenz,et al.  Extending Design by Contract for Aspect-Oriented Programming , 2005, ArXiv.

[22]  Ana Moreira,et al.  Contracts for aspect-oriented design , 2008 .

[23]  Perdita Stevens,et al.  Modelling Recursive Calls with UML State Diagrams , 2003, FASE.

[24]  Thomas Leich,et al.  Aspectual Feature Modules , 2008, IEEE Transactions on Software Engineering.

[25]  Sven Apel,et al.  Detecting Dependences and Interactions in Feature-Oriented Design , 2010, 2010 IEEE 21st International Symposium on Software Reliability Engineering.

[26]  Sven Apel,et al.  Type safety for feature-oriented product lines , 2010, Automated Software Engineering.

[27]  William R. Cook,et al.  A machine-checked model of safe composition , 2009, FOAL '09.

[28]  Sven Apel,et al.  Proof Composition for Deductive Verification of Software Product Lines , 2011, 2011 IEEE Fourth International Conference on Software Testing, Verification and Validation Workshops.