How to protect your changes in generated code?

Traditionally, 'requirements traceability' research aims to establish X% accurate relationship between problems and solutions, where X is typically below 100, and decreases whilst the knowledge of such relationships is obsolete over time. The aim of "invariant traceability" research is different: Whilst transformational appoaches in the area of model-driven software development are applied to software development, can we maintain 100% accurate relationship between problems and solutions?

Maintaining invariant traceability through bidirectional transformations

Following the `convention over configuration' paradigm, model-driven development (MDD) generates code to implement the "default" behaviour that has been specified by a template separate from the input model, reducing the decision effort of developers. For flexibility, users of MDD are allowed to customise the model and the generated code in parallel. A synchronisation of changed model or code is maintained by reflecting them on the other end of the code generation, as long as the traceability is unchanged. However, such invariant traceability between corresponding model and code elements can be violated either when (a) users of MDD protect custom changes from the generated code, or when (b) developers of MDD change the template for generating the default behaviour. A mismatch between user and template code is inevitable as they evolve for their own purposes. In this paper, we propose a two-layered invariant traceability framework that reduces the number of mismatches through bidirectional transformations. On top of existing vertical (model<->code) synchronisations between a model and the template code, a horizontal (code<->code) synchronisation between user and template code is supported, aligning the changes in both directions. Our blinkit tool is evaluated using the data set available from the CVS repositories of a MDD project: Eclipse MDT/GMF.
  • Yijun Yu, Yu Lin, Zhenjiang Hu, Soichiro Hidaka, Kato Hiroyuki, and Lionel Montrieux (2012). Maintaining invariant traceability through bidirectional transformations. In: 34th International Conference on Software Engineering, 2-9 June 2012, Zurich, Switzerland. pp. 540-550.

  • Email: y.yu@open.ac.uk Office: +44 (0) 1908 6 55562