HIL Test Coverage Determination via Embedded Code Marks
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing HIL testing methods struggle to fully cover the code of a controller, leading to potential dangers in functionality delivery, as it is difficult to check every functionality or function of the controller through black-box testing.
Innovation Solution
A method for determining coverage in HIL testing that involves acquiring an HIL test case, performing HIL testing on a controller, detecting preset marks (such as function status bits and execution counters) for each function, and determining coverage based on statistical data from these marks.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Ease of operation
If black-box testing is used for HIL testing, then the testing process is simple and easy to implement, but the code coverage is insufficient and cannot check every functionality of the controller
Solution Approach 1:
The patent introduces code embedding marks as an intermediary element between the controller code and test cases. These marks are embedded into the controller code and serve as detectable indicators that allow automated tracking of code execution during HIL testing, thereby achieving white-box testing capabilities while maintaining the simplicity of black-box testing approaches
Solution Approach 2:
The patent replaces manual analysis of code coverage with automated detection mechanisms. Statistical data about preset marks are automatically collected and analyzed to determine coverage, substituting manual testing analysis with automated computational methods that provide precise coverage metrics
2Reliability
If manual writing of HIL test cases is performed to cover all functionalities, then comprehensive coverage can be achieved, but the time and effort required for writing and maintaining test cases increases significantly
Solution Approach 1:
The patent enables the testing system to automatically track and report its own code coverage through embedded marks and statistical data collection. The system self-services by automatically determining which code paths have been executed during testing, eliminating the need for manual coverage analysis and reducing the time required for test case maintenance
Solution Approach 2:
The patent implements a feedback mechanism where statistical data about preset marks are collected during testing and used to determine coverage. This feedback loop provides real-time information about code execution status, allowing testers to identify uncovered functionalities and adjust test cases accordingly, thereby improving coverage efficiency
Data Source
AI summary
A method and a device for detecting coverage in HIL testing, and a computer-readable storage medium are. The method includes: acquiring an HIL test case and performing HIL testing on a controller based on the HIL test case; for each of functions in code of the controller, detecting a preset mark of the function and acquiring statistical data about the detected preset mark during the HIL testing; and determining coverage of the HIL test case on the functions based on the statistical data about the preset marks. Both the determination of execution and functionality of the function in the code based on the HIL test case as well as the determination of the coverage of the HIL test case based on the execution of the function in the code are performed during the HIL testing.

