Embedded Software Adaptation Using Interface-Tested Code Generation
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
The challenge of generating accurate and reliable software code elements, particularly for cyber-physical systems, is exacerbated by the unpredictability of machine learning models like Foundation Models or Large Language Models (LLMs), which may hallucinate and fail to meet requirements, complicating adjustments and maintenance.
Innovation Solution
A method involving a machine learning model that generates code elements based on a language specification and interface test criteria, followed by automated testing to ensure compliance, allowing integration only when criteria are met, thus ensuring code quality and reducing manual effort.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Productivity
If machine learning models generate code elements based on language specifications, then productivity and ease of code adjustment are improved, but reliability and accuracy of the generated code deteriorate due to hallucinations and failure to meet requirements
Solution Approach 1:
The system implements automated testing that provides feedback to the machine learning model when generated code fails to meet interface test criteria. The test results are fed back into the generation process, allowing the model to learn from failures and improve subsequent code generation attempts, thereby resolving the reliability issue while maintaining productivity
Solution Approach 2:
Interface test criteria are defined beforehand before code generation occurs. This preliminary action establishes clear requirements that the generated code must satisfy, enabling automated validation and ensuring that productivity gains do not compromise code accuracy and reliability
2Ease of operation
If machine learning models are used to generate code elements, then ease of operation and adaptability are improved, but manufacturing precision and measurement precision deteriorate due to inability to guarantee requirement compliance
Solution Approach 1:
An automated testing system acts as an intermediary between the machine learning model and the final code integration. This intermediary validates generated code against interface test criteria before acceptance, ensuring that ease of code adjustment through AI generation does not sacrifice manufacturing precision and requirement compliance
3Productivity
If code elements are generated without automated testing, then productivity is improved, but reliability and quality assurance deteriorate
Solution Approach 1:
The system implements self-service automated testing where the testing infrastructure automatically validates generated code without requiring manual intervention. This allows frequent code revisions and high productivity while maintaining reliability through continuous automated quality assurance, eliminating the trade-off between revision frequency and code quality
Data Source
AI summary
A computer-implemented method for the automated generation of a code element of a software code includes (i) generating, via a machine learning model, the code element based on a language specification for the code element to be created and an interface test criterion that is to be satisfied by the code element to be created, optionally wherein a prompt to the machine learning model includes the language specification and the interface test criterion, and (ii) testing whether the code element satisfies the interface test criterion, thus providing a test result.

