Well-formed and scalable invasive software composition

Software components provide essential means to structure and organize software effectively. However, frequently, required component abstractions are not available in a programming language or system, or are not adequately combinable with each other. Invasive software composition (ISC) is a general approach to software composition that unifies component-like abstractions such as templates, aspects and macros. ISC is based on fragment composition, and composes programs and other software artifacts at the level of syntax trees. Therefore, a unifying fragment component model is related to the context-free grammar of a language to identify extension and variation points in syntax trees as well as valid component types. By doing so, fragment components can be composed by transformations at respective extension and variation points so that always valid composition results regarding the underlying context-free grammar are yielded. However, given a language’s context-free grammar, the composition result may still be incorrect. Context-sensitive constraints such as type constraints may be violated so that the program cannot be compiled and/or interpreted correctly. While a compiler can detect such errors after composition, it is difficult to relate them back to the original transformation step in the composition system, especially in the case of complex compositions with several hundreds of such steps. To tackle this problem, this thesis proposes well-formed ISC—an extension to ISC that uses reference attribute grammars (RAGs) to specify fragment component models and fragment contracts to guard compositions with context-sensitive constraints. Additionally, well-formed ISC provides composition strategies as a means to configure composition algorithms and handle interferences between composition steps. Developing ISC systems for complex languages such as programming languages is a complex undertaking. Composition-system developers need to supply or develop adequate language and parser specifications that can be processed by an ISC composition engine. Moreover, the specifications may need to be extended with rules for the intended composition abstractions. Current approaches to ISC require complete grammars to be able to compose fragments in the respective languages. Hence, the specifications need to be developed exhaustively before any component model can be supplied. To tackle this problem, this thesis introduces scalable ISC—a variant of ISC that uses island component models as a means to define component models for partially specified languages while still the whole language is supported. Additionally, a scalable workflow for agile composition-system development is proposed which supports a development of ISC systems in small increments using modular extensions. All theoretical concepts introduced in this thesis are implemented in the Skeletons and Application Templates framework SkAT. It supports “classic”, well-formed and scalable ISC by

[1]  Sven Apel,et al.  Virtual Separation of Concerns - A Second Chance for Preprocessors , 2009, J. Object Technol..

[2]  A. Tarski A LATTICE-THEORETICAL FIXPOINT THEOREM AND ITS APPLICATIONS , 1955 .

[3]  Eelco Visser,et al.  An Algorithm for Layout Preservation in Refactoring Transformations , 2011, SLE.

[4]  Leon Moonen,et al.  Generating robust parsers using island grammars , 2001, Proceedings Eighth Working Conference on Reverse Engineering.

[5]  Emma Söderberg Contributions to the Construction of Extensible Semantic Editors , 2012 .

[6]  M. deJonge A pretty-printer for every occasion , 2001 .

[7]  Márcio Ribeiro,et al.  Investigating preprocessor-based syntax errors , 2014, GPCE '13.

[8]  Uwe Aßmann,et al.  Using feature models for creating families of documents , 2010, DocEng '10.

[9]  Mira Mezini,et al.  Conquering aspects with Caesar , 2003, AOSD '03.

[10]  Murray Hill,et al.  Yacc: Yet Another Compiler-Compiler , 1978 .

[11]  Bryan Ford,et al.  Parsing expression grammars: a recognition-based syntactic foundation , 2004, POPL '04.

[12]  Kent L. Beck,et al.  Extreme programming explained - embrace change , 1990 .

[13]  Oscar Nierstrasz,et al.  Object-oriented software composition , 1995 .

[14]  Jurgen Vinju A type-driven approach to concrete meta programming. , 2005 .

[15]  Torbjörn Ekman,et al.  Modularity first: a case for mixing AOP and attribute grammars , 2008, AOSD.

[16]  William Harry Maddox,et al.  Incremental Static Semantic Analysis , 1998 .

[17]  W. Teitelman PILOT: A STEP TOWARDS MAN-COMPUTER SYMBIOSIS , 1966 .

[18]  Benoît Combemale,et al.  A Proof Assistant Based Formalization of MDE Components , 2011, FACS.

[19]  Oscar Nierstrasz,et al.  Research directions in software composition , 1995, CSUR.

[20]  Uwe Aßmann,et al.  Towards well-formed fragment composition with reference attribute grammars , 2012, CBSE '12.

[21]  Daniel Weise,et al.  Programmable syntax macros , 1993, PLDI '93.

[22]  Steffen Zschaler,et al.  Providing Mainstream Parser Generators with Modular Language Definition Support , 2010 .

[23]  Christopher W. Pidgeon,et al.  DMS®: Program Transformations for Practical Scalable Software Evolution , 2002, IWPSE '02.

[24]  Niklaus Wirth,et al.  Program development by stepwise refinement , 1971, CACM.

[25]  Mirko Seifert,et al.  Integrating OCL and Textual Modelling Languages , 2010, MoDELS Workshops.

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

[27]  Uwe Aßmann,et al.  HyperAdapt: Enabling Aspects for XML , 2009, ICWE.

[28]  하수철,et al.  [서평]「Component Software」 - Beyond Object-Oriented Programming - , 2000 .

[29]  Murali Mani,et al.  Taxonomy of XML schema languages using formal language theory , 2005, TOIT.

[30]  Torbjörn Ekman,et al.  Declarative Intraprocedural Flow Analysis of Java Source Code , 2009, LDTA.

[31]  Sebastian Erdweg,et al.  Variability-aware parsing in the presence of lexical macros and conditional compilation , 2011, OOPSLA '11.

[32]  Ken Kennedy,et al.  Automatic generation of efficient evaluators for attribute grammars , 1976, POPL.

[33]  James R. Cordy,et al.  Robust multilingual parsing using island grammars , 2003, CASCON.

[34]  Lodewijk Bergmans,et al.  Composing crosscutting concerns using composition filters , 2001, CACM.

[35]  William G. Griswold,et al.  An Overview of AspectJ , 2001, ECOOP.

[36]  Michael Kifer,et al.  Logical foundations of object-oriented and frame-based languages , 1995, JACM.

[37]  Thomas W. Reps,et al.  Incremental Context-Dependent Analysis for Language-Based Editors , 1983, TOPL.

[38]  Martin Erwig,et al.  Extending Type Inference to Variational Programs , 2014, ACM Trans. Program. Lang. Syst..

[39]  Martin Erwig,et al.  The Choice Calculus: A Representation for Software Variation , 2011, TSEM.

[40]  Stanley M. Sutton,et al.  N degrees of separation: multi-dimensional separation of concerns , 1999, Proceedings of the 1999 International Conference on Software Engineering (IEEE Cat. No.99CB37002).

[41]  Eelco Visser,et al.  Syntax definition for language prototyping , 1997 .

[42]  Claus Brabrand,et al.  Growing languages with metamorphic syntax macros , 2000, PEPM '02.

[43]  Stuart Kent,et al.  Model Driven Engineering , 2002, IFM.

[44]  Rémi Douence,et al.  A Framework for the Detection and Resolution of Aspect Interactions , 2002, GPCE.

[45]  Uwe Aßmann,et al.  Detecting and resolving conflicts between adaptation aspects in multi-staged XML transformations , 2011, DocEng '11.

[46]  Derick Wood,et al.  Balanced Context-Free Grammars, Hedge Grammars and Pushdown Caterpillar Automata , 2004, Extreme Markup Languages®.

[47]  Shigeru Chiba,et al.  OpenJava: A Class-Based Macro System for Java , 1999, Reflection and Software Engineering.

[48]  Uwe Kastens,et al.  Ordered attributed grammars , 1980, Acta Informatica.

[49]  Krzysztof Czarnecki,et al.  Generative programming - methods, tools and applications , 2000 .

[50]  Christoph W. Kessler,et al.  Optimized composition of performance‐aware parallel components , 2012, Concurr. Comput. Pract. Exp..

[51]  William R. Cook,et al.  Mixin-based inheritance , 1990, OOPSLA/ECOOP '90.

[52]  James R. Cordy,et al.  The TXL source transformation language , 2006, Sci. Comput. Program..

[53]  Shan Shan Huang,et al.  Statically safe program generation with safegen , 2005, GPCE'05.

[54]  Eva Magnusson,et al.  Object-Oriented Declarative Program Analysis , 2007 .

[55]  Gordon V. Cormack,et al.  Modular Attribute Grammars , 1990, Comput. J..

[56]  Ondrej Lhoták,et al.  abc: an extensible AspectJ compiler , 2005, AOSD '05.

[57]  Jendrik Johannes,et al.  Component-based model-driven software development , 2010 .

[58]  Andreas Ludwig Automatische Transformation großer Softwaresysteme , 2002 .

[59]  Christoph W. Kessler,et al.  Crosscutting Concerns in Parallelization by Invasive Software Composition and Aspect Weaving , 2006, Proceedings of the 39th Annual Hawaii International Conference on System Sciences (HICSS'06).

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

[61]  Jochen Quante,et al.  Parsing Variant C Code: An Evaluation on Automotive Software , 2014, Softwaretechnik-Trends.

[62]  Olaf Spinczyk,et al.  Generic Advice: On the Combination of AOP with Generative Programming in AspectC++ , 2004, GPCE.

[63]  E. Dijkstra On the Role of Scientific Thought , 1982 .

[64]  Philip C. Pratt-Szeliga,et al.  Rootbeer: Seamlessly Using GPUs from Java , 2012, 2012 IEEE 14th International Conference on High Performance Computing and Communication & 2012 IEEE 9th International Conference on Embedded Software and Systems.

[65]  Cristina V. Lopes,et al.  Aspect-oriented programming , 1999, ECOOP Workshops.

[66]  Lodewijk Bergmans,et al.  Static and Dynamic Detection of Behavioral Conflicts Between Aspects , 2007, RV.

[67]  Frank Budinsky,et al.  Eclipse Modeling Framework , 2003 .

[68]  Adrian Pop,et al.  Composition of XML Dialects: A ModelicaXML Case Study , 2005, Electron. Notes Theor. Comput. Sci..

[69]  Reinhard Wilhelm,et al.  Übersetzerbau - Theorie, Konstruktion, Generierung , 1992 .

[70]  Ivan Porres,et al.  A Relation Between Context-Free Grammars and Meta Object Facility Metamodels , 2003 .

[71]  Bryan Ford,et al.  Packrat parsing:: simple, powerful, lazy, linear time, functional pearl , 2002, ICFP '02.

[72]  S. Doaitse Swierstra,et al.  Higher order attribute grammars , 1989, PLDI '89.

[73]  Krzysztof Czarnecki,et al.  Generative programming - principles and techniques of software engineering based on automated configuration and fragment-based component models , 1999 .

[74]  Eelco Visser,et al.  Stratego/XT 0.17. A language and toolset for program transformation , 2008, Sci. Comput. Program..

[75]  Bjarne Stroustrup,et al.  Design of Concept Libraries for C++ , 2011, SLE.

[76]  Ole Lehrmann Madsen,et al.  Object-oriented programming in the BETA programming language , 1993 .

[77]  Benoît Combemale,et al.  Correct-by-construction model composition: Application to the Invasive Software Composition method , 2014, FESCA.

[78]  Murray Cole,et al.  Bringing skeletons out of the closet: a pragmatic manifesto for skeletal parallel programming , 2004, Parallel Comput..

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

[80]  Paul Klint,et al.  Term Rewriting Meets Aspect-Oriented Programming , 2005, Processes, Terms and Cycles.

[81]  Sanjay Ghemawat,et al.  MapReduce: Simplified Data Processing on Large Clusters , 2004, OSDI.