Hierarchy-Aware Regression Test Prioritization
Hao Wang,Pu Luke Yi,Jeremias Parladorio,Wing Lam,Darko Marinov,Tao Xie
DOI: https://doi.org/10.1109/issre62328.2024.00041
2024-01-01
Abstract:Regression testing is widely used to check whether software changes lead to test failures. Regression Test Prioriti-zation (RTP) aims to order tests such that tests that are more likely to fail are run earlier. Prior RTP techniques—which we call hierarchy-unaware (HU)—ignored an important aspect: real test suites are organized hierarchically, and individual tests belong to composites that can be hierarchically nested. Prior RTP work overlooked the runtime cost to switch across hierarchical test compositesand used the APFD c metric, which represents the runtime of tests till test failures, to rank orders generated by RTP techniques. However, APFD c can misleadingly rank orders if their runtimes differ (e.g., two orders may have different numbers of composite switches and, consequently, runtimes). To account for runtime differences, we propose a new metric, HAPFD c . Unlike APFD c , HAPFD c enables proper comparison of test orders with different runtimes by "extending" runtimes as needed. To reduce the cost of composite switching, we introduce hierarchy-aware (HA) RTP by presenting meta-techniques that first prioritize composites and then tests within composites. We evaluate HA RTP on test classes in multi-module Java and Maven projects from two large datasets used in prior work. The results show that our HA RTP improves both HAPFD c values and time-based metrics over HU RTP.