Instrumented Intermediate Code for Dynamic Software Testing

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing dynamic software testing methods fail to identify specific code blocks and jump paths accessed during testing, making it difficult to locate bugs effectively.

Innovation Solution

The method involves compiling a code file to obtain an intermediate code file, instrumenting it with code block identifiers and jump relationship identifiers, and performing dynamic testing to generate a testing result, which includes alternately performing grey box fuzz testing and concolic execution based on these identifiers.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Measurement precision

If dynamic testing is performed on an intermediate code file or object file obtained from compiling a code file, then the testing process can be executed, but the specific code blocks and bug locations cannot be identified

Engineering Contradiction:
Improvebug location precisionVSAvoidcode block identification information
Core Design Contradiction:
Measurement precisionVSLoss of information

Solution Approach 1:

The patent applies preliminary action by inserting instrumentation code into the intermediate code file before execution. This instrumentation code includes code block identifiers and jump relationship identifiers that are embedded in advance, enabling the system to track and identify specific code blocks and control flow paths during testing without modifying the original source code structure.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The patent uses an intermediary approach by introducing an instrumentation layer between the intermediate code file and the testing process. This instrumentation layer acts as a mediator that captures execution information (code block IDs, jump relationships) and transmits it to the testing system, enabling precise bug location without directly modifying the testing framework or compiler.

Inventive Principle:
Principle #24Intermediary (Mediator)

2Reliability

If code block identifiers and jump relationship identifiers are inserted into the intermediate code file, then code coverage and bug location capability are improved, but the complexity of the testing system increases

Engineering Contradiction:
Improvetesting accuracyVSAvoidtesting system complexity
Core Design Contradiction:
ReliabilityVSDevice complexity

Solution Approach 1:

The patent applies segmentation by dividing the instrumentation process into distinct functional components: code block identifier insertion, jump relationship identifier insertion, and execution tracking. This segmentation allows each component to be independently implemented and managed, reducing overall system complexity while maintaining high testing accuracy.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent implements universality by designing the instrumentation mechanism to serve multiple functions simultaneously: it identifies code blocks, tracks jump relationships, measures code coverage, and locates bugs. This multi-functionality reduces the need for separate testing mechanisms, thereby managing system complexity while enhancing reliability.

Inventive Principle:
Principle #6Universality (Multi-functionality)

3Reliability

If grey box fuzz testing and concolic execution are alternately performed based on code block identifiers and jump relationship identifiers, then bug detection capability is enhanced, but the testing time and computational resources increase

Engineering Contradiction:
Improvebug detection capabilityVSAvoidtesting time
Core Design Contradiction:
ReliabilityVSLoss of time

Solution Approach 1:

The patent applies periodic action by alternately executing grey box fuzz testing and concolic execution in cycles. This periodic alternation allows the system to leverage the strengths of both methods while managing resource consumption, as each method can focus on specific types of bug detection during its active phase rather than running continuously.

Inventive Principle:
Principle #19Periodic action

Solution Approach 2:

The patent implements dynamics by making the testing approach adaptive based on execution context. The system dynamically switches between grey box fuzz testing and concolic execution based on code block identifiers and jump relationship identifiers, allowing optimal resource allocation and bug detection strategy selection during different phases of testing.

Inventive Principle:
Principle #15Dynamics

Data Source

PatentUS11151018B2Method and apparatus for testing a code file
Publication Date: 2021.10.19 BAIDU USA LLC
  • US11151018B2 patent drawing
  • US11151018B2 patent drawing
  • US11151018B2 patent drawing

AI summary

Embodiments of the present disclosure disclose a method and an apparatus for testing a code file. A preferred embodiment of the method comprises: compiling a to-be-tested code file to obtain an intermediate code file; instrumenting a code block identifier of each code block in the intermediate code file to the intermediate code file; determining an identifier of a jump relationship between two code blocks that have the jump relationship in the intermediate code file; performing dynamic testing to the instrumented intermediate code file based on respective code block identifiers and respective identifiers of jump relationships. This embodiment enhances bug detection capabilities for testing a code file.