Kernel Test Harness for Automated Ring 0 Unit Testing

Resolve Bottlenecks,
Find Innovative Solutions
Generate 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

VSEngineering 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

Engineering Contradiction:
Improveunit test generationVSAvoidapplicability to ring 0 software
Core Design Contradiction:
Extent of automationVSAdaptability or versatility

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

Inventive Principle:
Principle #24Intermediary (Mediator)

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

Inventive Principle:
Principle #1Segmentation

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

Engineering Contradiction:
Improvetest coverageVSAvoidmanual test development time
Core Design Contradiction:
ReliabilityVSLoss of time

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

Inventive Principle:
Principle #25Self-service

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

Inventive Principle:
Principle #10Preliminary action

Data Source

PatentUS20240232056A1A Concept for Generating a Test Specification
Publication Date: 2024.07.11 INTEL CORP
  • US20240232056A1 patent drawing
  • US20240232056A1 patent drawing
  • US20240232056A1 patent drawing

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.