Fitting the pieces together: a machine-checked model of safe composition

Programs of a software product line can be synthesized by composing features which implement a unit of program functionality. In most product lines, only some combination of features are meaningful; feature models express the high-level domain constraints that govern feature compatibility. Product line developers also face the problem of safe composition - whether every product allowed by a feature model is type-safe when compiled and run. To study the problem of safe composition, we present Lightweight Feature Java (LFJ), an extension of Lightweight Java with support for features. We define a constraint-based type system for LFJ and prove its soundness using a full formalization of LFJ in Coq. In LFJ, soundness means that any composition of features that satisfies the typing constraints will generate a well-formed LJ program. If the constraints of a feature model imply these typing constraints then all programs allowed by the feature model are type-safe.

[1]  Benjamin C. Pierce,et al.  Types and programming languages: the next generation , 2003, 18th Annual IEEE Symposium of Logic in Computer Science, 2003. Proceedings..

[2]  William R. Cook,et al.  Safe composition of product lines , 2007, GPCE '07.

[3]  Don Batory Feature-oriented programming and the AHEAD tool suite , 2004, ICSE 2004.

[4]  Timothy C. Lethbridge,et al.  Software engineering 2004 , 2006 .

[5]  Matthew J. Parkinson,et al.  The java module system: core design and semantic definition , 2007, OOPSLA.

[6]  Sven Apel,et al.  Feature featherweight java: a calculus for feature-oriented programming and stepwise refinement , 2008, GPCE '08.

[7]  Sven Apel,et al.  Type-Safe Feature-Oriented Product Lines , 2010, ArXiv.

[8]  Tom Ridge,et al.  Ott: effective tool support for the working semanticist , 2007, ICFP '07.

[9]  Krzysztof Czarnecki,et al.  Verifying feature-based model templates against well-formedness OCL constraints , 2006, GPCE '06.

[10]  Davide Ancona,et al.  Polymorphic bytecode: compositional compilation for Java-like languages , 2005, POPL '05.

[11]  Sven Apel,et al.  An Overview of the gDEEP Calculus , 2008 .

[12]  Pierre Castéran,et al.  Interactive Theorem Proving and Program Development , 2004, Texts in Theoretical Computer Science An EATCS Series.

[13]  Rubén Prieto-Díaz,et al.  Module interconnection languages : a survey , 1982 .

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

[15]  Don S. Batory,et al.  Feature Models, Grammars, and Propositional Formulas , 2005, SPLC.

[16]  Oscar Nierstrasz,et al.  Classbox/J: controlling the scope of change in Java , 2005, OOPSLA '05.

[17]  Krzysztof Czarnecki,et al.  Components and Generative Programming , 1999, ESEC / SIGSOFT FSE.

[18]  Krzysztof Czarnecki,et al.  Components and generative programming (invited paper) , 1999, ESEC/FSE-7.