Supporting Integrative Code Generation with Traceability Links and Code Fragment Integrity Checks
摘要
It is not always desirable or even possible to separate generated from handwritten code. However, trying to have generated and handwritten code intertwined and integrated means that the problem of persisting manual changes has to be solved in another way. This paper proposes a general workflow based on incremental code generation and API-based generators to allow integrative code generation. We combine traceability links with API-based generation to simplify tracking previously generated code elements. Additionally, we automate detecting manually introduced changes with code fragment integrity checks. To facilitate implementing this workflow, we introduce our solution. The solution includes the extension of RoseLib, our library that allows API-based code generation in C# language. The extension includes support for CSPath, a new language for selecting C# code elements that can be used for tracing, and functionalities that allow performing integrity checks. Finally, we showcase an implementation of the workflow with a proof-of-concept example.