Instrumented Intermediate Code for Dynamic Software Testing
Find Innovative SolutionsGenerate 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
Engineering 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
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.
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.
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
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.
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.
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
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.
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.
Data Source
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.


