Runtime Class Recompilation for Parallel Mutation Testing
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Current mutation testing tools for JVM-based programming languages like Gosu require full re-compilation of all object code for each individual mutation, leading to inefficiencies and prolonged testing times, especially in environments with large numbers of unit tests.
Innovation Solution
Implement a compiler that performs iterative, per-class compilation and dynamic recompilation during runtime, allowing individual mutations to be tested without recompiling the entire object code, using a Dynamic Code Evolution Virtual Machine (DCEVM) to support class recompilation.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If full re-compilation of all object code is performed for each individual mutation, then testing completeness is improved, but testing time and computing resource consumption increase significantly
Solution Approach 1:
The patent divides the monolithic compilation process into granular per-class compilation units. Instead of recompiling all object code for each mutation, the system identifies and recompiles only the specific class files that contain mutations, allowing parallel compilation of multiple classes simultaneously. This segmentation reduces the compilation scope from the entire codebase to individual mutation-affected classes.
Solution Approach 2:
The patent implements dynamic recompilation during runtime using a custom virtual machine (DCEVM) that supports loading and executing recompiled class files without restarting the entire application. The system dynamically identifies which classes need recompilation based on mutation locations, recompiles them on-the-fly, and loads the updated classes into the running JVM, enabling continuous testing without static compilation constraints.
2Measurement precision
If full re-compilation of all object code is performed for each individual mutation, then mutation detection accuracy is improved, but computing resource consumption increases
Solution Approach 1:
The compilation workload is segmented into independent per-class units that can be processed in parallel. The system analyzes the mutation impact scope to identify only the minimal set of classes requiring recompilation, rather than recompiling the entire object codebase. This selective segmentation maintains mutation detection accuracy while reducing CPU and memory consumption.
Solution Approach 2:
The patent performs partial recompilation by compiling only the specific classes containing mutations and their immediate dependencies, rather than performing excessive full-codebase recompilation. The system calculates the minimal recompilation scope by tracing mutation impacts through class relationships, recompiling only what is necessary to detect the mutation, thus conserving computing resources while preserving detection accuracy.
3Reliability
If thousands of unit tests are run against each mutation with full re-compilation, then test quality assessment is improved, but productivity decreases
Solution Approach 1:
The patent segments the testing process into independent parallel workflows where multiple classes with mutations can be compiled and tested simultaneously. Each mutation is associated with specific class files that are independently compiled and tested, allowing the test suite to process multiple mutations in parallel rather than sequentially, thereby maintaining thorough quality assessment while increasing overall testing throughput.
Solution Approach 2:
The system performs preliminary analysis to identify and isolate mutation-affected classes before compilation begins. By pre-calculating the minimal set of classes requiring recompilation based on mutation locations and class dependencies, the system avoids unnecessary compilation overhead and prepares the exact compilation scope in advance, enabling efficient parallel processing of test suites against multiple mutations.
Data Source
AI summary
In mutation testing, source code is mutated at various positions, and test suites are run against the original object code and each version of the mutated object code, to determine the quality of test suites against arbitrary changes in the object code. The present disclosure provides a mutation test manager configured to initialize multiple computing threads configuring a computing host to perform parallel computation; mutate class files within context of each computing thread; recompile mutated class files independently in each respective computing thread to generate heterogeneous mutants; and execute pending unit tests against heterogeneous mutants independently in each respective computing thread. Consequently, the mutation testing process is decoupled from computational bottlenecks which would result from linear, sequential generation, compilation, and testing of each mutation, especially in the context of JVM® programming languages configured to generate class-rich object code.


