Test Suite Reduction and Prioritization Framework in Regression Testing

Most of the test cases minimization reduced test cases during regression testing to generate new test suite to cover the same software requirements.The objective of this paper is to present new framework that integrate the idea of minimization and prioritization.Hence, reduction and prioritization able to reduce test cases based on the statements covered by the previous test cases to avoid redundancy.Beginning from the reduction of the test cases, followed by weighted prioritizationaccording to their usefulness.The framework was tested using sample test suite and the results obtained shown increases on the average percentage of faults detection (APFD). Future plan is to test on the larger size of test suite.


Introduction
According to Roger (2001) more than half of the total amount of the software develpment is spend on maintainingactivity of software. Rothermel and Harrold (1994) and Hussain et al., 2020assert that one of the most important phase in software maintenance is regression testing in order to be certain that amendments due to corrections or update did not change the initial functionality and the requirement. Test cases are use to evaluate the quality of the system by executing them. Sumalath and Raji (2014) state that measuring of the quality of the generated test cases needs to be conducted systematically.
The reduction and elimination of redundant test cases generated are what lead to test case minimization (TCM). TCM is the act of reducing the number of test cases using systematic method and procedure while maintaining the initial coverage criteria (Sumalath and Raji 2014). Yoo and Harman (2012) state that test suite reduction is aims at reducing the number of tests to test. However, the main objective of most of proposed algorithms is to reduce the test suite size According to Musa et al. (2014a) after having the test case, the challenge in regression testing is the prioritization of the test cases by identifying and selecting of best ones from them, and prioritizing the test cases will result in less time of execution and increase the coverage of errors detection. Regression test case prioritization (RTCP) prioritized test cases for execution during regression testing efficiently. RTCP relied on the available resources to prioritize test cases since the position and nature of the errors are not given prio to the activity (Orso, Shi and Harrold 2004). Also Kim and Porter (2002) define RTCP as a method in which it can be structured with the aim of finding errors in good time in the test execution process. Since it become bigger in number as result of many changes and new versions of the existing one and only some part of it can be retested within given period.
RTCP technique is a process that allow the testers to arrange tests into certain order so that those with the most higher need are executed before the less need test case, and it can be utilized with tests selection when tests removal is satisfactory (Rothermel et al. 2001), also tests prioritization might increase the utilization of testing time more beneficial than non-prioritize when the process of re-executing the test cases is terminated without prior notice. Rothermel et al. (2002) define the testsuite minimization problem as: Given a set of test cases T = t1, t2, … tn and set of requirements R = r1, r2, … rn which can be satisfied by the test cases in T, and a minimal subset of T that satisfies the same requirements as T itself.
Studies were conducted in regression test case minimization, one of them was conducted to generate a minimized number with the same coverage criteria as the original generated test cases (Ahmed 2016). Khan, Bora and Gupta (2017) developed a heuristic based testsuite minimization approach such that the size of the previous testsuite is reduced in order to generate new testsuite that will guarantee the same software requirements coverage that was achieved before the test suite minimization for an effective and efficient regression testing. But the approach minimized the test suite by throwing away unused testcases from the test suite according to different code coverage criteria's without prioritizing the test suite. Varadarajan et al. (2019) present a minimized test suite approach by eliminating unused test cases that tests same functionalities as other test case after generating the test cases based on the requirements. But approach eliminates test case by removing functionalities that were tested by the previous test cases and it doesn't used any criteria to order the testcases.
In this research we present a framework and an algorithm forRTC reduction and prioritization technique that reduce test cases based on the statements covered by the previous testcases to avoid redundancy of statements. After the reduction of the test cases, we prioritized the test cases based on their weight in order arrange them based on their usefulness.

Materials and Methods
This section describes the framework and algorithm for proposed RTC reduction and prioritization approach.  Algorithm 1 and 2 show the testsuite reduction and testsuite prioritization of the proposed approach. The generated test suite serves as input. For each testcase ti in T, If any of the previous test case contains the statement sk, delete the statement from the statements covered by ti. If the statement was not visited by any of the previous test cases, it should be added to the set of the visited test case. After executing all the test cases, we will have the remaining test cases those with statements not removed. This set of test cases T', serves as input to the prioritization part.

Algorithm 2 Test suite prioritization
For each test case tr, calculate it weight and add it to T" and finally order the test cases T".

Results and Discussion
The end goal is to guarantee that the regression test case reduction and prioritization algorithms work legitimately; of course, we give a preparatory acceptance of the algorithms in this section prior to their useful usage and observational/empirical assessment. This proof has been prepared by brief reduction and prioritizing tests for a program written in java program. The feasible paths presented for each test case and the information covered of triangle code based on the test suite is shown in Figure 3.1.

reducePriorHuce (T) BEGIN T = {set of generated test cases based on requirements} T' = { } visitedStat = { } T" = { } // reduce the test suite T For each test case tj in test suite T Begin If statement sk is in visitedStat
Remove the statement sk Otherwise Add the statement sk to its test case Add the statement sk to the visitedStat End T' = {set of test cases with remaining statements} priorReduceTest (T', T") END

Conclusion
The results show that the proposed approachRTRPHuce yielded better results in term APFDas compared to reduced and retest-all approaches. The RTRPHuceframework was tested using small size test cases to show it workability. Besides, the order of the initial test suite my also affect the results. In conclusion, this framework can be adopted for regression testing since it increases the rate of faults detections. Our future plan is to test on the larger size of test suite.