Skip to main content
Log in

Type safety for feature-oriented product lines

  • Published:
Automated Software Engineering Aims and scope Submit manuscript

Abstract

A feature-oriented product line is a family of programs that share a common set of features. A feature implements a stakeholder’s requirement and represents a design decision or configuration option. When added to a program, a feature involves the introduction of new structures, such as classes and methods, and the refinement of existing ones, such as extending methods. A feature-oriented decomposition enables a generator to create an executable program by composing feature code solely on the basis of the feature selection of a user—no other information needed. A key challenge of product line engineering is to guarantee that only well-typed programs are generated. As the number of valid feature combinations grows combinatorially with the number of features, it is not feasible to type check all programs individually. The only feasible approach is to have a type system check the entire code base of the feature-oriented product line. We have developed such a type system on the basis of a formal model of a feature-oriented Java-like language. The type system guaranties type safety for feature-oriented product lines. That is, it ensures that every valid program of a well-typed product line is well-typed. Our formal model including type system is sound and complete.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Similar content being viewed by others

References

  • Ancona, D., Lagorio, G., Zucca, E.: Jam—designing a Java extension with mixins. ACM Trans. Program. Lang. Syst. (TOPLAS) 25(5), 641–712 (2003)

    Article  Google Scholar 

  • Anfurrutia, F., Díaz, O., Trujillo, S.: On refining XML artifacts. In: Proceedings of the International Conference on Web Engineering (ICWE). LNCS, vol. 4607, pp. 473–478. Springer, Berlin (2007)

    Google Scholar 

  • Apel, S., Böhm, K.: Towards the development of ubiquitous middleware product lines. In: Software Engineering and Middleware. LNCS, vol. 3437, pp. 137–153. Springer, Berlin (2004)

    Google Scholar 

  • Apel, S., Hutchins, D.: An overview of the gDeep calculus. Technical Report MIP-0712, Department of Informatics and Mathematics, University of Passau (2007)

  • Apel, S., Hutchins, D.: A calculus for uniform feature composition. ACM Trans. Program. Lang. Syst. (TOPLAS) (2010)

  • Apel, S., Kästner, C.: An overview of feature-oriented software development. J. Object Technol. (JOT) 8(5), 49–84 (2009)

    Google Scholar 

  • Apel, S., Leich, T., Rosenmüller, M., Saake, G.: FeatureC++: on the symbiosis of feature-oriented and aspect-oriented programming. In: Proceedings of the International Conference on Generative Programming and Component Engineering (GPCE). LNCS, vol. 3676, pp. 125–140. Springer, Berlin (2005)

    Chapter  Google Scholar 

  • Apel, S., Kästner, C., Lengauer, C.: Feature featherweight Java: a calculus for feature-oriented programming and stepwise refinement. In: Proceedings of the International Conference on Generative Programming and Component Engineering (GPCE), pp. 101–112. ACM Press, New York (2008a)

    Chapter  Google Scholar 

  • Apel, S., Leich, T., Saake, G.: Aspectual feature modules. IEEE Trans. Softw. Eng. (TSE) 34(2), 162–180 (2008b)

    Article  Google Scholar 

  • Apel, S., Janda, F., Trujillo, S., Kästner, C.: Model superimposition in software product lines. In: Proceedings of the International Conference on Model Transformation (ICMT). LNCS, vol. 5563, pp. 4–19. Springer, Berlin (2009a)

    Google Scholar 

  • Apel, S., Kästner, C., Größlinger, A., Lengauer, C.: Feature (de)composition in functional programming. In: Proceedings of the International Conference on Software Composition (SC). LNCS, vol. 5634, pp. 9–26. Springer, Berlin (2009b)

    Google Scholar 

  • Apel, S., Kästner, C., Lengauer, C.: FeatureHouse: language-independent, automated software composition. In: Proceedings of the International Conference on Software Engineering (ICSE), pp. 221–231. IEEE Comput. Soc., Los Alamitos (2009c)

    Google Scholar 

  • Aversano, L., Di Penta, M., Baxter, I.: Handling preprocessor-conditioned declarations. In: Proceedings of the International Workshop on Source Code Analysis and Manipulation (SCAM), p. 83. IEEE Comput. Soc., Los Alamitos (2002)

    Chapter  Google Scholar 

  • Batory, D.: Feature models, grammars, and propositional formulas. In: Proceedings of the International Software Product Line Conference (SPLC). LNCS, vol. 3714, pp. 7–20. Springer, Berlin (2005)

    Google Scholar 

  • Batory, D., Sarvela, J., Rauschmayer, A.: Scaling step-wise refinement. IEEE Trans. Softw. Eng. (TSE) 30(6), 355–371 (2004)

    Article  Google Scholar 

  • Bergel, A., Ducasse, S., Nierstrasz, O.: Classbox/J: controlling the scope of change in Java. In: Proceedings of the International Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA), pp. 177–189. ACM Press, New York (2005)

    Google Scholar 

  • Bertot, Y., Casteran, P.: Interactive Theorem Proving and Program Development—Coq’Art: The Calculus of Inductive Constructions. Texts in Theoretical Computer Science. An EATCS Series. Springer, Berlin (2004)

    MATH  Google Scholar 

  • Bono, V., Patel, A., Shmatikov, V.: A core calculus of classes and mixins. In: Proceedings of the European Conference on Object-Oriented Programming (ECOOP). LNCS, vol. 1628, pp. 43–66. Springer, Berlin (1999)

    Google Scholar 

  • Bracha, G., Cook, W.: Mixin-based inheritance. In: Proceedings of the European Conference on Object-Oriented Programming (ECOOP) and International Conference on Object-Oriented Programming Systems, Languages, and Applications (OOPSLA), pp. 303–311. ACM Press, New York (1990)

    Chapter  Google Scholar 

  • Clarke, D., Drossopoulou, S., Noble, J., Wrigstad, T.: Tribe: a simple virtual class calculus. In: Proceedings of the International Conference on Aspect-Oriented Software Development (AOSD), pp. 121–134. ACM Press, New York (2007)

    Chapter  Google Scholar 

  • Clements, P., Northrop, L.: Software Product Lines: Practices and Patterns. Addison-Wesley, Reading (2002)

    Google Scholar 

  • Clifton, C., Millstein, T., Leavens, G., Chambers, C.: MultiJava: design rationale, compiler implementation, and applications. ACM Trans. Program. Lang. Syst. (TOPLAS) 28(3), 517–575 (2006)

    Article  Google Scholar 

  • Czarnecki, K., Eisenecker, U.: Generative Programming: Methods, Tools, and Applications. Addison-Wesley, Reading (2000)

    Google Scholar 

  • Czarnecki, K., Pietroszek, K.: Verifying feature-based model templates against well-formedness OCL constraints. In: Proceedings of the International Conference on Generative Programming and Component Engineering (GPCE), pp. 211–220. ACM Press, New York (2006)

    Chapter  Google Scholar 

  • Delaware, B., Cook, W., Batory, D.: Fitting the pieces together: a machine-checked model of safe composition. In: Proceedings of the International Symposium on Foundations of Software Engineering (FSE), pp. 243–252. ACM Press, New York (2009)

    Google Scholar 

  • Ducasse, S., Nierstrasz, O., Schärli, N., Wuyts, R., Black, A.: Traits: a mechanism for fine-grained reuse. ACM Trans. Program. Lang. Syst. (TOPLAS) 28(2), 331–388 (2006)

    Article  Google Scholar 

  • Ernst, E., Ostermann, K., Cook, W.: A virtual class calculus. In: Proceedings of the International Symposium on Principles of Programming Languages (POPL), pp. 270–282. ACM Press, New York (2006)

    Google Scholar 

  • Flatt, M., Krishnamurthi, S., Felleisen, M.: Classes and mixins. In: Proceedings of the International Symposium on Principles of Programming Languages (POPL), pp. 171–183. ACM Press, New York (1998)

    Google Scholar 

  • Gasiunas, V., Mezini, M., Ostermann, K.: Dependent classes. In: Proceedings of the International Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA), pp. 133–152. ACM Press, New York (2007)

    Google Scholar 

  • Gosling, J., Joy, B., Steele, G., Bracha, G.: The Java Language Specification, 3rd edn. The Java Series. Addison-Wesley, Reading (2005)

    Google Scholar 

  • Hirschfeld, R., Costanza, P., Nierstrasz, O.: Context-oriented programming. J. Object Technol. (JOT) 7(3), 125–151 (2008)

    Google Scholar 

  • Hutchins, D.: Eliminating distinctions of class: using prototypes to model virtual classes. In: Proceedings of the International Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA), pp. 1–19. ACM Press, New York (2006)

    Google Scholar 

  • Hutchins, D.: Pure subtype systems: a type theory for extensible software. PhD thesis, School of Informatics, University of Edinburgh (2009)

  • Igarashi, A., Pierce, B., Wadler, P.: Featherweight Java: a minimal core calculus for Java and GJ. ACM Trans. Program. Lang. Syst. (TOPLAS) 23(3), 396–450 (2001)

    Article  Google Scholar 

  • Igarashi, A., Saito, C., Viroli, M.: Lightweight family polymorphism. In: Proceedings of the Asian Symposium on Programming Languages and Systems (APLAS). LNCS, vol. 3780, pp. 161–177. Springer, Berlin (2005)

    Google Scholar 

  • Kamina, T., Tamai, T.: McJava—a design and implementation of Java with mixin-types. In: Proceedings of the Asian Symposium on Programming Languages and Systems (APLAS). LNCS, vol. 3302, pp. 398–414. Springer, Berlin (2004)

    Google Scholar 

  • Kang, K., Cohen, S., Hess, J., Novak, W., Peterson, A.: Feature-oriented domain analysis (FODA) feasibility study. Technical Report CMU/SEI-90-TR-21, Software Engineering Institute, Carnegie Mellon University (1990)

  • Kästner, C.: Virtual separation of concerns: rehabilitating the preprocessor. PhD thesis, School of Computer Science, University of Magdeburg (2010). Under review

  • Kästner, C., Apel, S.: Type-checking software product lines—a formal approach. In: Proceedings of the International Conference on Automated Software Engineering (ASE), pp. 258–267. IEEE Comput. Soc., Los Alamitos (2008)

    Google Scholar 

  • Kästner, C., Apel, S., Batory, D.: A case study implementing features using AspectJ. In: Proceedings of the International Software Product Line Conference (SPLC), pp. 222–232. IEEE Comput. Soc., Los Alamitos (2007)

    Google Scholar 

  • Kästner, C., Apel, S., Kuhlemann, M.: Granularity in software product lines. In: Proceedings of the International Conference on Software Engineering (ICSE), pp. 311–320. ACM Press, New York (2008)

    Google Scholar 

  • Kästner, C., Apel, S., Kuhlemann, M.: A model of refactoring physically and virtually separated features. In: Proceedings of the International Conference on Generative Programming and Component Engineering (GPCE), pp. 157–166. ACM Press, New York (2009a)

    Chapter  Google Scholar 

  • Kästner, C., Apel, S., Trujillo, S., Kuhlemann, M., Batory, D.: Guaranteeing syntactic correctness for all product line variants: a language-independent approach. In: Proceedings of the International Conference on Objects, Models, Components, Patterns (TOOLS EUROPE). LNBI, vol. 33, pp. 174–194. Springer, Berlin (2009b)

    Chapter  Google Scholar 

  • Lagorio, G., Servetto, M., Zucca, E.: Featherweight Jigsaw—a minimal core calculus for modular composition of classes. In: Proceedings of the European Conference on Object-Oriented Programming (ECOOP). LNCS, vol. 5653, pp. 244–268. Springer, Berlin (2009)

    Google Scholar 

  • Liquori, L., Spiwack, A.: FeatherTrait: a modest extension of featherweight Java. ACM Trans. Program. Lang. Syst. (TOPLAS) 30(2), 1–32 (2008)

    Article  Google Scholar 

  • Lopez-Herrejon, R., Batory, D.: A standard problem for evaluating product-line methodologies. In: Proceedings of the International Conference on Generative and Component-Based Software Engineering (GCSE). LNCS, vol. 2186, pp. 10–24. Springer, Berlin (2001)

    Chapter  Google Scholar 

  • Lopez-Herrejon, R., Batory, D., Cook, W.: Evaluating support for features in advanced modularization technologies. In: Proceedings of the European Conference on Object-Oriented Programming (ECOOP). LNCS, vol. 3586, pp. 169–194. Springer, Berlin (2005)

    Google Scholar 

  • Lopez-Herrejon, R., Batory, D., Lengauer, C.: A disciplined approach to aspect composition. In: Proceedings of the International Symposium Partial Evaluation and Semantics-Based Program Manipulation (PEPM), pp. 68–77. ACM Press, New York (2006)

    Chapter  Google Scholar 

  • Madsen, O., Moller-Pedersen, B.: Virtual classes: a powerful mechanism in object-oriented programming. In: Proceedings of the International Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA), pp. 397–406. ACM Press, New York (1989)

    Chapter  Google Scholar 

  • Masuhara, H., Kiczales, G.: Modeling crosscutting in aspect-oriented mechanisms. In: Proceedings of the European Conference on Object-Oriented Programming (ECOOP). LNCS, vol. 2743, pp. 2–28. Springer, Berlin (2003)

    Google Scholar 

  • Mendonca, M., Wasowski, A., Czarnecki, K.: SAT-based analysis of feature models is easy. In: Proceedings of the International Software Product Line Conference (SPLC), pp. 231–240. Software Engineering Institute, Carnegie Mellon University (2009)

  • Mezini, M., Ostermann, K.: Variability management with feature-oriented programming and aspects. In: Proceedings of the International Symposium on Foundations of Software Engineering (FSE), pp. 127–136. ACM Press, New York (2004)

    Google Scholar 

  • Murphy, G., Lai, A., Walker, R., Robillard, M.: Separating features in source code: an exploratory study. In: Proceedings of the International Conference on Software Engineering (ICSE), pp. 275–284. IEEE Comput. Soc., Los Alamitos (2001)

    Google Scholar 

  • Nystrom, N., Chong, S., Myers, A.: Scalable extensibility via nested inheritance. In: Proceedings of the International Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA), pp. 99–115. ACM Press, New York (2004)

    Google Scholar 

  • Odersky, M., Cremet, V., Röckl, C., Zenger, M.: A nominal theory of objects with dependent types. In: Proceedings of the European Conference on Object-Oriented Programming (ECOOP). LNCS, vol. 2743, pp. 201–224. Springer, Berlin (2003)

    Google Scholar 

  • Odersky, M., Zenger, M.: Scalable component abstractions. In: Proceedings of the International Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA), pp. 41–57. ACM Press, New York (2005)

    Google Scholar 

  • Ostermann, K.: Dynamically composable collaborations with delegation layers. In: Proceedings of the European Conference on Object-Oriented Programming (ECOOP). LNCS, vol. 2374, pp. 89–110. Springer, Berlin (2002)

    Google Scholar 

  • Pierce, B.: Types and Programming Languages. MIT Press, Cambridge (2002)

    Google Scholar 

  • Prehofer, C.: Feature-oriented programming: a fresh look at objects. In: Proceedings of the European Conference on Object-Oriented Programming (ECOOP). LNCS, vol. 1241, pp. 419–443. Springer, Berlin (1997)

    Google Scholar 

  • Reenskaug, T., Andersen, E., Berre, A., Hurlen, A., Landmark, A., Lehne, O., Nordhagen, E., Ness-Ulseth, E., Oftedal, G., Skaar, A., Stenslet, P.: OORASS: seamless support for the creation and maintenance of object-oriented systems. J. Object-Oriented Program. (JOOP) 5(6), 27–41 (1992)

    Google Scholar 

  • Rosenmüller, M., Siegmund, N., Saake, G., Apel, S.: Code generation to support static and dynamic composition of software product lines. In: Proceedings of the International Conference on Generative Programming and Component Engineering (GPCE), pp. 3–12. ACM Press, New York (2008a)

    Chapter  Google Scholar 

  • Rosenmüller, M., Siegmund, N., Schirmeier, H., Sincero, J., Apel, S., Leich, T., Spinczyk, O., Saake, G.: FAME-DBMS: tailor-made data management solutions for embedded systems. In: Proceedings of the EDBT Workshop on Software Engineering for Tailor-made Data Management (SETMDM), pp. 1–6. ACM Press, New York (2008b)

    Chapter  Google Scholar 

  • Rosenmüller, M., Apel, S., Leich, T., Saake, G.: Tailor-made data management for embedded systems: a case study on Berkeley DB. Data Knowl. Eng. (DKE) 68(12), 1493–1512 (2009a)

    Article  Google Scholar 

  • Rosenmüller, M., Kästner, C., Siegmund, N., Sunkle, S., Apel, S., Leich, T., Saake, G.: SQL á la Carte—toward tailor-made data management. In: Datenbanksysteme in Business, Technologie und Web—Fachtagung des GI-Fachbereichs Datenbanken und Informationssysteme. GI-Edition—LNI, vol. P-144, pp. 117–136. Gesellschaft für Informatik (2009b)

  • Siegmund, N., Kästner, C., Rosenmüller, M., Heidenreich, F., Apel, S., Saake, G.: Bridging the gap between variability in client application and database schema. In: Datenbanksysteme in Business, Technologie und Web—Fachtagung des GI-Fachbereichs Datenbanken und Informationssysteme. GI-Edition—LNI, vol. P-144, pp. 297–306. Gesellschaft für Informatik (2009)

  • Smaragdakis, Y., Batory, D.: Mixin layers: an object-oriented implementation technique for refinements and collaboration-based designs. ACM Trans. Softw. Eng. Methodol. (TOSEM) 11(2), 215–255 (2002)

    Article  Google Scholar 

  • Strniša, R., Sewell, P., Parkinson, M.: The Java module system: core design and semantic definition. In: Proceedings of the International Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA), pp. 499–514. ACM Press, New York (2007)

    Google Scholar 

  • Tarr, P., Ossher, H., Harrison, W., Sutton, S. Jr.: N degrees of separation: multi-dimensional separation of concerns. In: Proceedings of the International Conference on Software Engineering (ICSE), pp. 107–119. IEEE Comput. Soc., Los Alamitos (1999)

    Chapter  Google Scholar 

  • Thaker, S., Batory, D., Kitchin, D., Cook, W.: Safe composition of product lines. In: Proceedings of the International Conference on Generative Programming and Component Engineering (GPCE), pp. 95–104. ACM Press, New York (2007)

    Chapter  Google Scholar 

  • VanHilst, M., Notkin, D.: Using role components in implement collaboration-based designs. In: Proceedings of the International Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA), pp. 359–369. ACM Press, New York (1996)

    Google Scholar 

  • Wright, A.K., Felleisen, M.: A syntactic approach to type soundness. Inf. Comput. 115(1), 38–94 (1994)

    Article  MATH  MathSciNet  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Sven Apel.

Rights and permissions

Reprints and permissions

About this article

Cite this article

Apel, S., Kästner, C., Größlinger, A. et al. Type safety for feature-oriented product lines. Autom Softw Eng 17, 251–300 (2010). https://doi.org/10.1007/s10515-010-0066-8

Download citation

  • Received:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s10515-010-0066-8

Keywords

Navigation