Provenance Annotations for Generated Code
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Generated source code from high-level descriptions often lacks intuitive relationships with the original descriptions, leading to cumbersome development processes as programmers must frequently switch between documents, disrupting their focus and productivity.
Innovation Solution
The use of programming language annotations to establish provenance information between documents, enabling interactive tools to maintain context and relationships, such as through XMLBeans and JSR 175 annotations, facilitates intuitive navigation and integration of generated code within software development environments.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Productivity
If source code is automatically generated from high-level descriptions, then programming productivity is improved, but the generated code becomes cryptic and difficult to understand
Solution Approach 1:
The patent introduces comments as an intermediary element between the generated code and the high-level description. These comments serve as a bridge that connects the cryptic generated code back to its source, making the code understandable without requiring programmers to constantly switch between documents. The comments are automatically inserted at relevant locations in the generated code to explain its origin and purpose.
2Ease of operation
If programmers frequently examine both high-level descriptions and generated code, then code understanding is improved, but focus is lost and productivity decreases
Solution Approach 1:
The patent merges the information from the high-level description and the generated code into a single unified view by embedding comments directly within the generated code. This consolidation eliminates the need for programmers to switch between separate documents, as all necessary contextual information is now available in one place - the generated code itself with its embedded comments.
3Ease of operation
If comments are automatically inserted in generated code, then code readability is improved, but the relationship between high-level description and generated code becomes less explicit
Solution Approach 1:
The patent implements comments with dual functionality: they serve both as readability aids for understanding the generated code and as provenance markers that explicitly link the code back to its high-level description source. Each comment is designed to fulfill both purposes simultaneously, providing contextual explanation while maintaining traceability to the original specification.
Data Source
AI summary
A system, method and media for automatically relating documents, comprising selecting a first element in a first document; selecting a second element based on the first element; annotating the second element in a second document with an annotation and wherein the annotation refers to the first element. This abstract is not intended to be a complete description of, or limit the scope of, the invention. Other features, aspects and objects of the invention can be obtained from a review of the specification, the figures and the claims.


