Automated Software Engineering

, Volume 17, Issue 3, pp 251–300 | Cite as

Type safety for feature-oriented product lines

  • Sven Apel
  • Christian Kästner
  • Armin Größlinger
  • Christian Lengauer
Article

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.

Keywords

Feature featherweight Java Feature-oriented programming Software product lines Type systems Safe composition 

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Ancona, D., Lagorio, G., Zucca, E.: Jam—designing a Java extension with mixins. ACM Trans. Program. Lang. Syst. (TOPLAS) 25(5), 641–712 (2003) CrossRefGoogle Scholar
  2. 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
  3. 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
  4. Apel, S., Hutchins, D.: An overview of the gDeep calculus. Technical Report MIP-0712, Department of Informatics and Mathematics, University of Passau (2007) Google Scholar
  5. Apel, S., Hutchins, D.: A calculus for uniform feature composition. ACM Trans. Program. Lang. Syst. (TOPLAS) (2010) Google Scholar
  6. Apel, S., Kästner, C.: An overview of feature-oriented software development. J. Object Technol. (JOT) 8(5), 49–84 (2009) Google Scholar
  7. 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) CrossRefGoogle Scholar
  8. 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) CrossRefGoogle Scholar
  9. Apel, S., Leich, T., Saake, G.: Aspectual feature modules. IEEE Trans. Softw. Eng. (TSE) 34(2), 162–180 (2008b) CrossRefGoogle Scholar
  10. 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
  11. 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
  12. 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
  13. 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) CrossRefGoogle Scholar
  14. 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
  15. Batory, D., Sarvela, J., Rauschmayer, A.: Scaling step-wise refinement. IEEE Trans. Softw. Eng. (TSE) 30(6), 355–371 (2004) CrossRefGoogle Scholar
  16. 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
  17. 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) MATHGoogle Scholar
  18. 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
  19. 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) CrossRefGoogle Scholar
  20. 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) CrossRefGoogle Scholar
  21. Clements, P., Northrop, L.: Software Product Lines: Practices and Patterns. Addison-Wesley, Reading (2002) Google Scholar
  22. 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) CrossRefGoogle Scholar
  23. Czarnecki, K., Eisenecker, U.: Generative Programming: Methods, Tools, and Applications. Addison-Wesley, Reading (2000) Google Scholar
  24. 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) CrossRefGoogle Scholar
  25. 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
  26. 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) CrossRefGoogle Scholar
  27. 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
  28. 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
  29. 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
  30. Gosling, J., Joy, B., Steele, G., Bracha, G.: The Java Language Specification, 3rd edn. The Java Series. Addison-Wesley, Reading (2005) Google Scholar
  31. Hirschfeld, R., Costanza, P., Nierstrasz, O.: Context-oriented programming. J. Object Technol. (JOT) 7(3), 125–151 (2008) Google Scholar
  32. 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
  33. Hutchins, D.: Pure subtype systems: a type theory for extensible software. PhD thesis, School of Informatics, University of Edinburgh (2009) Google Scholar
  34. 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) CrossRefGoogle Scholar
  35. 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
  36. 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
  37. 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) Google Scholar
  38. Kästner, C.: Virtual separation of concerns: rehabilitating the preprocessor. PhD thesis, School of Computer Science, University of Magdeburg (2010). Under review Google Scholar
  39. 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
  40. 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
  41. 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
  42. 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) CrossRefGoogle Scholar
  43. 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) CrossRefGoogle Scholar
  44. 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
  45. Liquori, L., Spiwack, A.: FeatherTrait: a modest extension of featherweight Java. ACM Trans. Program. Lang. Syst. (TOPLAS) 30(2), 1–32 (2008) CrossRefGoogle Scholar
  46. 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) CrossRefGoogle Scholar
  47. 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
  48. 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) CrossRefGoogle Scholar
  49. 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) CrossRefGoogle Scholar
  50. 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
  51. 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) Google Scholar
  52. 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
  53. 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
  54. 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
  55. 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
  56. 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
  57. 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
  58. Pierce, B.: Types and Programming Languages. MIT Press, Cambridge (2002) Google Scholar
  59. 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
  60. 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
  61. 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) CrossRefGoogle Scholar
  62. 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) CrossRefGoogle Scholar
  63. 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) CrossRefGoogle Scholar
  64. 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) Google Scholar
  65. 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) Google Scholar
  66. 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) CrossRefGoogle Scholar
  67. 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
  68. 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) CrossRefGoogle Scholar
  69. 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) CrossRefGoogle Scholar
  70. 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
  71. Wright, A.K., Felleisen, M.: A syntactic approach to type soundness. Inf. Comput. 115(1), 38–94 (1994) MATHCrossRefMathSciNetGoogle Scholar

Copyright information

© Springer Science+Business Media, LLC 2010

Authors and Affiliations

  • Sven Apel
    • 1
  • Christian Kästner
    • 2
  • Armin Größlinger
    • 1
  • Christian Lengauer
    • 1
  1. 1.Department of Informatics and MathematicsUniversity of PassauPassauGermany
  2. 2.School of Computer ScienceUniversity of MagdeburgMagdeburgGermany

Personalised recommendations