Sunit: A Junit 5 Extension To Reduce Automated Test Execution Time
Automated testing plays a crucial role in the production pipeline of high-quality software, helping reduce maintenance costs and increasing the delivery capacity of agile teams. This paper presents a JUnit 5 extension, called SUnit, designed to reduce the execution time of automated tests by reusing each test’s implicit setup whenever possible, without violating the principle of test independence. Implicit setup execution reuse is achieved by identifying tests that maintain the setup's initial state unchanged — these tests are classified as safe for reuse. Execution time is reduced because the implicit setup defined in a test class is executed only once before running all safe tests. An experiment was conducted to evaluate the effectiveness of the tool in a real-world project containing a test suite with 391 test methods. The results showed an approximate 40\% reduction in test execution time.
