TL;DR
This paper introduces Code Combinations Coverage based Prioritization (CCCP), a novel approach to regression testing that prioritizes test cases based on combinations of covered code units rather than treating them in isolation. By leveraging the principles of combinatorial testing, CCCP significantly improves fault detection rates compared to traditional state-of-the-art techniques while maintaining comparable computational efficiency.
What Problem Does This Paper Address?
As software evolves, regression testing—running existing tests to ensure new changes haven't broken old functionality—becomes a massive bottleneck. In large industrial systems, executing a full test suite can take weeks. Regression Test Case Prioritization (RTCP) aims to solve this by reordering tests so that those most likely to find bugs run first.
Most existing RTCP techniques rely on code coverage (e.g., which statements or branches a test hits). However, they typically treat these code units as independent entities. The authors argue this is a fundamental flaw: bugs often arise from the interaction between different parts of the code. By ignoring how code units are covered in combination, traditional methods lose valuable information that could lead to faster bug discovery.
Methods
The authors propose a new criterion called Code Combinations Coverage (CCC). The core idea is to treat each code unit (statement, branch, or method) as a parameter that can be either "covered" or "not covered" by a test case.
- Abstract Test Cases: Each test case is transformed into a binary tuple representing its coverage profile across all code units.
- $\lambda$-wise Combinations: Instead of just looking at individual units ($\lambda=1$), the technique looks at combinations of $\lambda$ units. For example, if $\lambda=2$, the algorithm tracks which pairs of code units are covered together.
- Greedy Prioritization: The CCCP algorithm uses a greedy strategy: it iteratively selects the next test case that covers the maximum number of previously uncovered $\lambda$-wise combinations.
The study compares CCCP against four standard RTCP techniques:
- Total: Prioritizes tests with the highest absolute coverage.
- Additional: Prioritizes tests covering the most new code units (a widely used greedy baseline).
- Adaptive Random: Selects tests that are "farthest" from already selected ones in the coverage space.
- Search-based: Uses genetic algorithms to find an optimal test sequence.
The researchers evaluated these using two primary metrics: APFD (Average Percentage of Faults Detected) and APFDc, a cost-cognizant version that accounts for varying test execution times.
Datasets
The empirical study was conducted on a robust set of benchmarks summarized in the table below:
- Java Programs: 14 versions of four programs (ant, jmeter, jtopas, xmlsec) from the Software-artifact Infrastructure Repository (SIR).
- C Programs: 30 versions of five real-world Unix utilities (flex, grep, gzip, make, sed) from the GNU FTP server.
- Faults: Since real-world fault data is often sparse, the authors used mutation testing, seeding thousands of synthetic bugs (mutants) to measure how quickly each prioritization technique could "kill" them.
Key Insights and Ideas
- Code Units are Not Islands: The central "aha" moment is that the relationship between code units matters. Even at $\lambda=1$, CCCP's way of handling "not covered" units as part of the combination profile gives it a slight edge, and at $\lambda=2$, it captures deeper interaction logic that other methods miss.
- Granularity Matters: The effectiveness of prioritization is highly sensitive to test case granularity. Prioritizing at the test-method level (individual tests) is significantly more effective than at the test-class level (groups of tests), likely because it allows for a more flexible and precise ordering.
- Efficiency vs. Effectiveness: While search-based and adaptive random techniques are often touted for their sophistication, this paper reinforces that greedy-style approaches (like Additional and CCCP) remain incredibly hard to beat in terms of the balance between prioritization time and bug-finding speed.
Key Results
- Superior Fault Detection: CCCP consistently outperformed all four baseline techniques. Even with the lowest combination strength ($\lambda=1$), it achieved higher APFD scores than the state-of-the-art.
- The Power of Pairs: Increasing the combination strength to $\lambda=2$ further boosted fault detection rates. For C programs, CCCP with $\lambda=2$ was significantly better than all other methods across statement, branch, and method coverage.
- Comparable Costs: Despite tracking combinations, the prioritization time for CCCP was found to be comparable to the standard "Additional" strategy and much faster than search-based or adaptive random methods.
- Robustness: The performance gains were consistent regardless of whether the underlying coverage was measured at the statement, branch, or method level.
Limitations and Future Work
The authors acknowledge a few key areas for further exploration:
- Scalability of Higher $\lambda$: While $\lambda=2$ is effective, calculating combinations for $\lambda=3$ or higher on very large systems could become computationally prohibitive.
- Real vs. Mutation Faults: While mutation testing is a standard research proxy, the authors plan to validate CCCP against larger suites of real-world, non-synthetic bugs.
- Alternative Strategies: This paper applied combination coverage to a greedy algorithm. Future work could involve integrating CCC into search-based or other more complex prioritization frameworks to see if even greater gains are possible.
Summary updated