Automatically propagating changes from reference implementations to code generation templates

ContextCode generators can automatically perform some tedious and error-prone implementation tasks, increasing productivity and quality in the software development process. Most code generators are based on templates, which are fundamentally composed of text expansion statements. To build templates, the code of an existing, tested and validated implementation may serve as reference, in a process known as templatization. With the dynamics of software evolution/maintenance and the need for performing changes in the code generation templates, there is a loss of synchronism between the templates and this reference code. Additional effort is required to keep them synchronized. ObjectiveThis paper proposes automation as a way to reduce the extra effort needed to keep templates and reference code synchronized. MethodA mechanism was developed to semi-automatically detect and propagate changes from reference code to templates, keeping them synchronized with less effort. The mechanism was also submitted to an empirical evaluation to analyze its effects in terms of effort reduction during maintenance/evolution templatization. ResultsIt was observed that the developed mechanism can lead to a 50% reduction in the effort needed to perform maintenance/evolution templatization, when compared to a manual approach. It was also observed that this effect depends on the nature of the evolution/maintenance task, since for one of the tasks there was no observable advantage in using the mechanism. However, further studies are needed to better characterize these tasks. ConclusionAlthough there is still room for improvement, the results indicate that automation can be used to reduce effort and cost in the maintenance and evolution of a template-based code generation infrastructure.

[1]  Wolfgang De Meuter,et al.  SelfSync: a dynamic round-trip engineering environment , 2005, OOPSLA '05.

[2]  Soichiro Hidaka,et al.  A compositional approach to bidirectional model transformation , 2009, 2009 31st International Conference on Software Engineering - Companion Volume.

[3]  Claes Wohlin,et al.  Experimentation in software engineering: an introduction , 2000 .

[4]  Markus Völter,et al.  Patterns for Model-Driven Software-Development , 2004, EuroPLoP.

[5]  Robert Feldt,et al.  Validity Threats in Empirical Software Engineering Research - An Initial Survey , 2010, SEKE.

[6]  Brad A. Myers,et al.  Capturing and analyzing low-level events from the code editor , 2011, PLATEAU '11.

[7]  Hassan Charaf,et al.  A Synchronizing Technique for Syntactic Model-Code Round-Trip Engineering , 2008, 15th Annual IEEE International Conference and Workshop on the Engineering of Computer Based Systems (ecbs 2008).

[8]  Ulrich Nickel,et al.  The FUJABA environment , 2000, Proceedings of the 2000 International Conference on Software Engineering. ICSE 2000 the New Millennium.

[9]  Michael Lawley,et al.  Model Synchronisation: Definitions for Round-Trip Engineering , 2008, ICMT@TOOLS.

[10]  J. Craig Cleaveland,et al.  Building application generators , 1988, IEEE Software.

[11]  Federico Ciccozzi,et al.  Round-trip support for extra-functional property management in model-driven engineering of embedded systems , 2013, Inf. Softw. Technol..

[12]  Stan Jarzabek,et al.  Flexible generators for software reuse and evolution: NIER Track , 2011, 2011 33rd International Conference on Software Engineering (ICSE).