Rohit Kulshreshtha, Adobe Systems
The size of a test suite for a given functionality increases with introduction of test files. Often, test files are introduced without considering the redundancy they add in terms of code coverage. It is possible that we may get similar code coverage with a smaller set of files.
The codebase may contain a large number of ‘points’ of code coverage that are touched during the execution of the code. Also, the test suite itself may contain a large number of test cases – each exercising a different set of code coverage points. We describe a technique that enables us to find the smallest subset of test cases that exercises the exact same set of code coverage points as the test suite itself. We also demonstrate a prototype of this application that uses code coverage data supplied by a commercially available code coverage tool.
The immediate benefits of such an exercise are:
- One of our test-suites was reduced down to 133 files from their original size of 600 files (down by 78%).
- Developers may use the smaller set to quickly test their new changes.
- Increase in productivity: Regular regression tests takes less time
- Fuzzing for security: Provides a better starting point for fuzzing.
Subset can be identified based on multiple criteria:
- Test Case Count
- Time Taken to execute test cases
- Input Size of test data