Runtime Class Recompilation for Parallel JVM 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 classes and unit tests.
Innovation Solution
Implement a compiler that performs iterative, per-class compilation and mutation testing during runtime, allowing for individual class recompilation and loading of mutant object code into a target runtime environment, such as a JVM®, without recompiling the entire application.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If full re-compilation of all object code is performed for each individual mutation, then mutation testing can be performed, but testing time and computing resource consumption increase significantly
Solution Approach 1:
The patent divides the compilation process into individual class-level compilations rather than full application recompilation. Each mutated class is compiled independently using a compiler that can load only the specific class being tested, allowing mutation testing to proceed without recompiling the entire application codebase.
Solution Approach 2:
The patent implements dynamic class loading and recompilation capabilities in the JVM environment. The system can dynamically load individual class files into the runtime environment without requiring full application restart or complete codebase recompilation, enabling flexible and efficient mutation testing.
2Reliability
If full re-compilation is performed for each mutation, then testing completeness is maintained, but productivity decreases
Solution Approach 1:
The compilation process is segmented at the class level, allowing each mutated class to be compiled and tested independently. This maintains testing completeness by covering all mutations while improving productivity by avoiding redundant compilation of unchanged classes.
Solution Approach 2:
Instead of performing complete recompilation (excessive action), the system performs only the necessary partial recompilation of mutated classes. This selective approach maintains sufficient testing coverage while dramatically reducing the time and resources required for mutation testing.
3Loss of time
If iterative per-class compilation is implemented, then mutation testing time is reduced, but device complexity increases
Solution Approach 1:
The compiler is designed as a universal tool that can compile individual classes, load them into the JVM runtime environment, and execute tests against mutations. This multi-functional design reduces overall system complexity by using a single compiler component for multiple operations rather than requiring separate specialized tools.
Solution Approach 2:
The patent introduces an intermediary class loading mechanism that bridges the compiler and the JVM runtime environment. This intermediary layer handles the complexity of class loading, mutation application, and test execution, allowing the compiler itself to remain relatively simple while still achieving efficient mutation testing.
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.


