Traceability Verification for Model-Based Code Generation
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Current methods for generating source code from models in procedural programming languages lack assurance of traceability, leading to potential unwanted functional behaviors, particularly in critical systems like aircraft, where manual verification is necessary to ensure code reliability and structural coverage.
Innovation Solution
A method involving syntactic and semantic analysis of both procedural and modeling language instructions to identify and match functional blocks, ensuring each block in the generated code corresponds to an equivalent block in the model, using equipment with data processing and storage means to implement this analysis.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Productivity
If automatic code generation from models is used, then productivity is improved, but traceability reliability deteriorates
Solution Approach 1:
The patent applies preliminary action by establishing traceability links between model elements and code instructions during the code generation process itself, rather than verifying them afterward. The verification method performs syntactic and semantic analysis on the generated code to confirm traceability relationships before the code is considered complete, ensuring that traceability is built into the generation process from the start.
Solution Approach 2:
The patent implements feedback by using the results of syntactic and semantic analysis to verify whether generated code instructions maintain traceability to their source model elements. The system checks if the structural relationships and semantic meanings are preserved through the generation process, providing feedback on whether traceability has been maintained and enabling corrective actions if traceability gaps are detected.
2Reliability
If manual verification of code traceability is performed, then traceability reliability is improved, but productivity deteriorates
Solution Approach 1:
The patent replaces manual mechanical verification with an automated computer-based verification system that performs syntactic and semantic analysis. Instead of human reviewers manually checking traceability, the system uses algorithmic analysis to automatically verify that generated code instructions correspond to model elements, maintaining high reliability while eliminating the time-consuming manual process.
Solution Approach 2:
The verification system performs self-service by automatically analyzing its own generated code to confirm traceability relationships. The code generation process includes built-in verification capabilities that autonomously check whether the generated code maintains proper traceability to the source model, eliminating the need for separate manual verification activities.
3Measurement precision
If structural coverage measurement is performed at code level, then measurement precision is improved, but device complexity increases
Solution Approach 1:
The patent introduces an intermediary layer of abstract syntax trees (AST) that mediates between the complex code structure and the verification process. By representing code in terms of AST nodes that correspond to model elements, the system achieves precise measurement of structural coverage without directly navigating the full complexity of the generated code, thereby reducing verification system complexity while maintaining measurement precision.
Data Source
Figure 1
Figure 2
Figure 3
AI summary
The present invention concerns a method for verifying traceability of first code instructions in a procedural programming language generated from second code instructions in a modelling language, characterised in that it comprises the implementation, by a piece of equipment (1), of steps of: (a) Syntactic analysis: o of the first instructions so as to generate an AST, and o of the second instructions so as to generate an MDT; (b) Semantic analysis: o Of the AST so as to identify patterns representative of basic functional blocks of the first instructions; o Of the MDT so as to identify characteristic properties of basic functional blocks of the second instructions; (c) Matching, pairwise, the identified basic functional blocks, and confirming the traceability of first code instructions only if: o for each block of the first instructions, there is a functionally equivalent block in the second instructions, and o for each block of the second instructions, there is a functionally equivalent block in the first instructions. Figure