In today’s agile-driven software development processes, continuous integration and test-driven development are considered pillars by every software vendor. In such methodologies, unit tests play a crucial role. Regression tests are a particular type of unit test created by developers after fixing bugs to be sure that those bugs do not show up again. Unfortunately, in large software projects, regression tests and unit tests increase in size dramatically, thus increasing the execution time of the testing engine. This fact violates one of the concepts of continuous integration, which says that the developer should receive the results of the tests quickly. The authors report that time execution of test suites in industry may take several weeks to execute fully.
Test suite minimization or prioritization techniques have been proposed to solve this problem. In particular, test suite minimization reduces the number of tests by seeking redundant tests by typically analyzing test coverage. However, identifying test redundancy can be inaccurate and it is an NP-complete problem. In this paper, the authors suggest another approach based on minimizing the total amount of time necessary to execute the test suite as a whole, rather than reducing the tests to be executed. This approach is named unit test virtualization. The approach implementation is named VmVm.
The authors ran their VmVm tool against thousands of Java projects. They found that “for the [largest] applications each test executes in its own process, rather than executing multiple tests in the same process.” Thus, the application is initialized and terminated at each test, resulting in a very time-consuming process. Although this is a desired behavior, not all setup and teardown methods are implemented with efficiency in mind. The key insight of their approach is that in case of memory managed languages such as Java, it is not necessary to reinitialize the entire application to maintain isolation. It is feasible to analyze the software to find potential side effect-causing code and reinitialize automatically only the necessary parts. The work is corroborated by three critical motivation questions answered by analyzing the code of open-source projects to discover the developer’s test behavior.
VmVm requires no modification of the environment and is integrated with popular tools like Maven, Ant, and JUnit. It does not require access to the source code, but it is built on top of the ASM bytecode analyzer.