Acta Informatica

, Volume 50, Issue 2, pp 77–122 | Cite as

Compositional type checking of delta-oriented software product lines

Original Article

Abstract

Delta-oriented programming is a compositional approach to flexibly implementing software product lines. A product line is represented by a code base and a product line declaration. The code base consists of a set of delta modules specifying modifications to object-oriented programs. A particular product in a delta-oriented product line is generated by applying the modifications contained in the suitable delta modules to the empty program. The product-line declaration provides the connection of the delta modules with the product features. This separation increases the reusability of delta modules. In this paper, we provide a foundation for compositional type checking of delta-oriented product lines of Java programs by presenting a minimal core calculus for delta-oriented programming. The calculus is equipped with a constraint-based type system that allows analyzing each delta module in isolation, such that the results of the analysis can be reused. By relying only on the analysis results for the delta modules and on the product line declaration, it is possible to establish whether all the products of the product line are well typed according to the fragment of the Java type system modeled by the calculus.

References

  1. Ancona, D., Damiani, F., Drossopoulou, S., Zucca, E.: Polymorphic bytecode: compositional compilation for java-like languages. In: Proceedings of the 32nd ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL ’05, pp. 26–37. ACM, New York (2005). doi:10.1145/1040305.1040308
  2. Apel, S., Kästner, C., Grösslinger, A., Lengauer, C.: Type safety for feature-oriented product lines. Autom. Softw. Eng. 17(3), 251–300 (2010). doi:10.1007/s10515-010-0066-8 CrossRefGoogle Scholar
  3. Apel, S., Kästner, C., Lengauer, C.: Feature featherweight java: a calculus for feature-oriented programming and stepwise refinement. In: Proceedings of the 7th International Conference on Generative Programming and Component Engineering, GPCE ’08, pp. 101–112. ACM, New York (2008). doi:10.1145/1449913.1449931
  4. Aracic, I., Gasiunas, V., Mezini, M., Ostermann, K.: An overview of caesarJ. Trans. AOSD I, LNCS 3880, 135–173 (2006). doi:10.1007/11687061_5 Google Scholar
  5. Batory, D.: Feature models, grammars, and propositional formulas. In: Obbink, H., Pohl, K. (eds.) Software Product Lines (SPLC 2005), Lecture Notes in Computer Science, vol. 3714, pp. 7–20. Springer (2005). doi:10.1007/11554844_3
  6. Batory, D., Sarvela, J.N., Rauschmayer, A.: Scaling step-wise refinement. IEEE Trans. Softw. Eng. 30, 355–371 (2004). doi:10.1109/TSE.2004.23 CrossRefGoogle Scholar
  7. Bettini, L., Damiani, F., Schaefer, I.: Implementing software product lines using traits. In: Proceedings of the 2010 ACM Symposium on Applied Computing, SAC ’10, pp. 2096–2102. ACM, New York (2010). doi:10.1145/1774088.1774530
  8. Bettini, L., Damiani, F., Schaefer, I., Strocco, F.: TraitRecordJ: a programming language with traits and records. Sci. Comput. Program. (2011). doi:10.1016/j.scico.2011.06.007
  9. Bono, V., Damiani, F., Giachino, E.: Separating type, behavior, and State to achieve very fine-grained reuse. In: Electronic Proceedings of FTfJP (2007)Google Scholar
  10. Bono, V., Damiani, F., Giachino, E.: On Traits and Types in a Java-like Setting. In: Ausiello, G., Karhumki, J., Mauri, G., Ong, L. (eds.) Fifth IFIP international conference on Theoretical Computer Science—Tcs 2008, IFIP International Federation for Information Processing, vol. 273, pp. 367–382. Springer (2008) doi:10.1007/978-0-387-09680-3_25
  11. Bracha, G., Cook, W.: Mixin-based inheritance. In: Proceedings of the European Conference on Object-Oriented Programming on Object-Oriented Programming Systems, Languages, and Applications, OOPSLA/ECOOP ’90, pp. 303–311. ACM, New York (1990). doi:10.1145/97945.97982
  12. Clements, P., Northrop, L.: Software Product Lines: Practices and Patterns. Addison Wesley Longman, Reading (2001)Google Scholar
  13. Clifton, C., Leavens, G.T.: MiniMAO\(_1\): investigating the semantics of proceed. Sci. Comput. Program. 63(3), 321–374 (2006). doi: 10.1016/j.scico.2006.02.009 MathSciNetMATHCrossRefGoogle Scholar
  14. Czarnecki, K., Eisenecker, U.W.: Generative Programming: Methods, Tools, and Applications. Addison-Wesley, Reading (2000)Google Scholar
  15. Damiani, F., Padovani, L., Schaefer, I.: A formal foundation for dynamic delta-oriented software product lines. In: Proceedings of the 11th International Conference on Generative Programming and Component Engineering, GPCE ’12, pp. 1–10. ACM, New York (2012). doi:10.1145/2371401.2371403
  16. Damiani, F., Schaefer, I.: Dynamic delta-oriented programming. In: Proceedings of the 15th International Software product Line Conference, vol. 2, SPLC ’11, pp. 34:1–34:8. ACM, New York (2011). doi:10.1145/2019136.2019175
  17. Damiani, F., Schaefer, I.: Family-based analysis of type safety for delta-oriented software product lines. In: Margaria, T., Steffen, B. (eds.) Leveraging Applications of Formal Methods, Verification and Validation. Technologies for Mastering Change, Lecture Notes in Computer Science, vol. 7609, pp. 193–207. Springer (2012). doi:10.1007/978-3-642-34026-0_15
  18. De Fraine, B., Südholt, M., Jonckers, V.: Strongaspectj: flexible and safe pointcut/advice bindings. In: Proceedings of the 7th International Conference on Aspect-Oriented Software Development, AOSD ’08, pp. 60–71. ACM, New York (2008). doi:10.1145/1353482.1353491
  19. Delaware, B., Cook, W., Batory, D.: A machine-checked model of safe composition. In: Proceedings of the 2009 Workshop on Foundations of Aspect-Oriented Languages, FOAL ’09, pp. 31–35. ACM, New York (2009). doi:10.1145/1509837.1509846
  20. Ducasse, S., Nierstrasz, O., Schärli, N., Wuyts, R., Black, A.: Traits: A mechanism for fine-grained reuse. ACM TOPLAS 28(2), 331–388 (2006). doi:10.1145/1119479.1119483 CrossRefGoogle Scholar
  21. Ernst, E.: gbeta - a language with virtual attributes, block structure, and propagating, dynamic inheritance. Ph.D. thesis, Department of Computer Science, University of Århus, Denmark (1999). http://www.daimi.au.dk/eernst/gbeta
  22. Ernst, E.: Propagating class and method combination. In: Guerraoui, R. (ed.) ECOOP 1999—Object-Oriented Programming, Lecture Notes in Computer Science, vol. 1628, pp. 67–91. Springer (1999). doi:10.1007/3-540-48743-3_4
  23. Ernst, E.: Higher-order hierarchies. In: Cardelli, L. (ed.) ECOOP 2003—Object-Oriented Programming, Lecture Notes in Computer Science, vol. 2743, pp. 303–328. Springer (2003). doi:10.1007/978-3-540-45070-2_14
  24. Ernst, E.: The expression problem, Scandinavian style. In: MASPEGHI (2004). http://www.i3s.unice.fr/maspeghi2004/final-version/e_ernst.pdf
  25. Fraine, B., Ernst, E., Sdholt, M.: Essential AOP: the a calculus. In: D’Hondt, T. (ed.) ECOOP 2010—Object-Oriented Programming, Lecture Notes in Computer Science, vol. 6183, pp. 101–125. Springer (2010). doi:10.1007/978-3-642-14107-2_6
  26. Igarashi, A., Pierce, B., Wadler, P.: Featherweight Java: a minimal core calculus for Java and GJ. ACM TOPLAS 23(3), 396–450 (2001). doi:10.1145/503502.503505 CrossRefGoogle Scholar
  27. Johnsen, E., Kyas, M., Yu, I.: Dynamic classes: modular asynchronous evolution of distributed concurrent objects. In: Cavalcanti, A., Dams, D. (eds.) FM 2009: Formal Methods, Lecture Notes in Computer Science, vol. 5850, pp. 596–611. Springer (2009). doi:10.1007/978-3-642-05089-3_38
  28. Kang, K.C., Cohen, S.G., Hess, J.A., Novak, W.E., Peterson, A.S.: Feature-Oriented Domain Analysis (FODA) Feasibility Study. Technical report. Carnegie Mellon Software Engineering Institute (1990)Google Scholar
  29. Kästner, C., Apel, S., Batory, D.: A case study implementing features using aspectJ. In: Software Product Line Conference (SPLC 2007), pp. 223–232. IEEE, Los Alamitos (2007). doi:10.1109/SPLINE.2007.12
  30. Kästner, C., Apel, S., Kuhlemann, M.: Granularity in software product lines. In: Proceedings of the 30th International Conference on Software Engineering, ICSE ’08, pp. 311–320. ACM, New York (2008). doi:10.1145/1368088.1368131
  31. Kästner, C., Apel, S., ur Rahman, S.S., Rosenmüller, M., Batory, D., Saake, G.: On the impact of the optional feature problem: analysis and case studies. In: Proceedings of the 13th International Software Product Line Conference, SPLC ’09, pp. 181–190. Carnegie Mellon University, Pittsburgh (2009). doi:10.1145/1753235.1753261
  32. Kiczales, G., Hilsdale, E., Hugunin, J., Kersten, M., Palm, J., Griswold, W.G.: An overview of aspectJ. In: ECOOP 2001—Object-Oriented Programming, Lecture Notes in Computer Science, vol. 2072, pp. 327–354. Springer (2001). doi:10.1007/3-540-45337-7_18
  33. Kiczales, G., Lamping, J., Mendhekar, A., Maeda, C., Lopes, C., Loingtier, J.M., Irwin, J.: Aspect-oriented programming. In: ECOOP 1997—Object-Oriented Programming, Lecture Notes in Computer Science, vol. 1241, pp. 220–242. Springer (1997). doi:10.1007/BFb0053381
  34. Krueger, C.: Eliminating the adoption barrier. IEEE Softw. 19(4), 29–31 (2002). doi:10.1109/MS.2002.1020284 CrossRefGoogle Scholar
  35. Kuhlemann, M., Batory, D., Kästner, C.: Safe composition of non-monotonic features. In: Proceedings of the Eighth International Conference on Generative Programming and Component Engineering, GPCE ’09, pp. 177–186. ACM, New York (2009). doi:10.1145/1621607.1621634
  36. Lopez-Herrejon, R., Batory, D., Cook, W.: Evaluating support for features in advanced modularization technologies. In: Black, A.P. (ed.) ECOOP 2005—Object-Oriented Programming, Lecture Notes in Computer Science, vol. 3586, pp. 169–194. Springer (2005). doi:10.1007/11531142_8
  37. Madsen, O.L., Møller-Pedersen, B.: Virtual classes: a powerful mechanism in object-oriented programming. In: Conference Proceedings on Object-Oriented Programming Systems, Languages and Applications, OOPSLA ’89, pp. 397–406. ACM, New York (1989). doi:10.1145/74877.74919
  38. Odersky, M.: The Scala Language Specification, version 2.4. Technical Report, Programming Methods Laboratory, EPFL (2007)Google Scholar
  39. Ossher, H., Tarr, P.: Hyper/J: multi-dimensional separation of concerns for Java. In: Proceedings of the 22nd International Conference on Software Engineering, ICSE ’00, pp. 734–737. ACM, New York (2000). doi:10.1145/337180.337618
  40. Ostermann, K.: Dynamically composable collaborations with delegation layers. In: Magnusson, B. (ed.) ECOOP 2002—Object-Oriented Programming, Lecture Notes in Computer Science, vol. 2374, pp. 89–110. Springer (2002). doi:10.1007/3-540-47993-7_4
  41. 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 7th International Conference on Generative Programming and Component Engineering, GPCE ’08, pp. 3–12. ACM, New York (2008). doi:10.1145/1449913.1449917
  42. Schaefer, I., Bettini, L., Bono, V., Damiani, F., Tanzarella, N.: Delta-oriented programming of software product lines. In: Bosch, J., Lee, J. (eds.) Software Product Lines: Going Beyond (SPLC 2010), Lecture Notes in Computer Science, vol. 6287, pp. 77–91. Springer (2010). doi:10.1007/978-3-642-15579-6_6
  43. Schaefer, I., Bettini, L., Damiani, F.: Compositional type-checking for delta-oriented programming. In: Proceedings of the Tenth International Conference on Aspect-Oriented Software Development, AOSD ’11, pp. 43–56. ACM, New York (2011). doi:10.1145/1960275.1960283
  44. Schaefer, I., Damiani, F.: Pure delta-oriented programming. In: Proceedings of the 2nd International Workshop on Feature-Oriented Software Development, FOSD ’10, pp. 49–56. ACM, New York (2010). doi:10.1145/1868688.1868696
  45. Smaragdakis, Y., Batory, D.: Mixin layers: an object-oriented implementation technique for refinements and collaboration-based designs. ACM Trans. Softw. Eng. Methodol. 11(2), 215–255 (2002). doi:10.1145/505145.505148 CrossRefGoogle Scholar
  46. Strniša, R., Sewell, P., Parkinson, M.: The java module system: core design and semantic definition. In: Proceedings of the 22nd Annual ACM SIGPLAN Conference on Object-Oriented Programming Systems and Applications, OOPSLA ’07, pp. 499–514. ACM, New York (2007). doi:10.1145/1297027.1297064
  47. Tarr, P., Ossher, H., Harrison, W., Sutton Jr., S.M.: N degrees of separation: multi-dimensional separation of concerns. In: Proceedings of the 21st International Conference on Software Engineering, ICSE ’99, pp. 107–119. ACM, New York (1999). doi:10.1145/302405.302457
  48. Thaker, S., Batory, D., Kitchin, D., Cook, W.: Safe composition of product lines. In: Proceedings of the 6th International Conference on Generative Programming and Component Engineering, GPCE ’07, pp. 95–104. ACM, New York (2007). doi:10.1145/1289971.1289989
  49. Thüm, T., Apel, S., Kästner, C., Kuhlemann, M., Schaefer, I., Saake, G.: Analysis Strategies for Software Product Lines. Technical Report FIN-004-2012, School of Computer Science, University of Magdeburg, Germany (2012). http://www.cs.uni-magdeburg.de/inf_media/downloads/forschung/technical_reports_und_preprints/2012/04_2012.pdf
  50. Torgersen, M.: The expression problem revisited. In: Odersky, M. (ed.) ECOOP 2004—Object-Oriented Programming, Lecture Notes in Computer Science, vol. 3086, pp. 123–146. Springer (2004). doi:10.1007/978-3-540-24851-4_6
  51. Zenger, M., Odersky, M.: Independently extensible solutions to the expression problem. In: FOOL (2005)Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2013

Authors and Affiliations

  • Lorenzo Bettini
    • 1
  • Ferruccio Damiani
    • 1
  • Ina Schaefer
    • 2
  1. 1.Dipartimento di InformaticaUniversitá di Torino TorinoItaly
  2. 2.Technische Universität BraunschweigBraunschweigGermany

Personalised recommendations