Kernel Test Harness for Automated Ring 0 Unit Testing
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Current methods for generating unit tests for safety-critical software, particularly in operating systems and hypervisors, are resource-intensive and require significant manual effort due to the need for privileged instructions access, which existing tools like LDRA cannot address effectively.
Innovation Solution
A method and apparatus for automatically generating unit tests by extracting symbols from software code, creating test vectors with expected results, and generating a test specification to achieve 100% coverage of entry points, statements, and branches, using a lightweight approach that abstracts privileged instructions and provides a code advisor for improving code coverage.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Extent of automation
If commercial tools like LDRA are used to create unit tests, then some test generation effort is addressed, but the tool cannot access privileged instructions in ring 0 software such as operating systems and hypervisors
Solution Approach 1:
The patent introduces a kernel test harness as an intermediary component that bridges the gap between user-mode testing tools and kernel-mode software. The harness runs in user mode but can invoke and test functions in the kernel through defined interfaces, allowing automated testing of ring 0 software without requiring direct privileged instruction access from the testing tool itself
Solution Approach 2:
The testing system is segmented into distinct layers: user-mode testing tools, a kernel test harness layer, and the kernel-mode software under test. This segmentation allows each component to operate within its appropriate privilege level while maintaining testability through well-defined interaction interfaces
2Reliability
If manual work is performed to create unit tests for ring 0 software, then test coverage can be achieved, but the effort and resources required increase significantly
Solution Approach 1:
The system enables automated self-testing of kernel functions through the test harness framework. Test cases can be automatically generated and executed without requiring extensive manual intervention, as the framework provides structured templates and execution mechanisms that reduce human effort while maintaining comprehensive coverage
Solution Approach 2:
The test harness framework is established in advance with predefined interfaces and execution mechanisms. This preliminary setup allows for automated test generation and execution without requiring manual configuration during each test case development, significantly reducing the time required for test creation
Data Source
AI summary
Examples relate to an apparatus, a device, a method, and a computer program for generating a test specification for testing software code of a function under test. The apparatus for generating the test specification for testing software code of a function under test comprises circuitry configured to extract a plurality of symbols from the software code of the function under test, generate a plurality of test vectors with corresponding sets of expected results for the function under test based on the plurality of symbols, and generate a test specification based on the plurality of test vectors and the corresponding sets of expected results.


