Implementing Ant Colony Optimization for Test Case Selection and Prioritization Bharti Suri Assistant Professor, Computer Science Department USIT, GGSIPU Delhi, India Shweta Singhal Student M.Tech (IT) USIT, GGSIPU Delhi, India Abstract— Regression Testing is an inevitable and a very costly activity to be performed, often in a time and resource constrained environment. Thus we use techniques like Test Case Selection and Prioritization, to select and prioritize a subset from the complete test suite, fulfilling some chosen criteria. Ant Colony Optimization (ACO) is a technique based on the real life behavior of ants. This paper presents an implementation of an already introduced Ant Colony Optimization Algorithm for Test Case Selection and Prioritization. Graph representation and example runs explained in the paper show how the random nature of ACO helps to explore the possible paths and choose the optimal from them. Results show that ACO leads to solutions that are in close proximity with optimal solutions. Keywords - Regression Testing, Ant Colony Optimization, Implementation, Test Case Selection, Test Case Prioritization I. INTRODUCTION The maintenance phase of a software product needs to go through the inevitable regression testing process. It is required to retest the existing test suite whenever any addition, deletion or modifications are made to the software. Re-running the test cases from the existing test suite to build confidence in the correctness of the modified software is referred to as regression testing. Quite often software developers encounter time and budget constraints, which makes it almost impossible to rerun all the test cases within the specified constraints. Thus we use test case minimization, selection and prioritization techniques for regression testing. Regression test selection is a process of reducing the test suite by selecting a subset from the original test suite. Although this is a very cost effective method for regression testing but it can leave out certain important test cases from the selected subset of test cases. Regression test prioritization means scheduling the test cases in an increasing or decreasing order to meet some performance goal [1]. Various prioritization criteria may be applied to the regression test suite with the objective of meeting those criteria. Test cases can be prioritized in terms of random, optimal, statement coverage total or additional, branch coverage total or additional, failure rates, or total fault exposing potential (FEP) [1] of the test cases. We often perform regression test prioritization in a time constrained environment where testing is done for a fixed period of time. Walcott et al [2] in 1996 gave one such technique for time-aware test case prioritization. Time- aware prioritization intelligently schedules the test suite in terms of both the execution time and potential fault detection information. Walcott et al used Genetic Algorithms to solve this problem. In the year 2010, Singh et al. [3] also proposed a time-constrained prioritization technique using Ant Colony Optimization (ACO). The results shown in the paper provides motivation for implementing the algorithm and automating the technique. This algorithm has been used as the basis of this paper. In this paper we present a tool called ACO_TCSP for the same and show results for the execution of the tool on the same example as used by Singh [3]. The outcome of the execution provides near optimum results and further motivates to test the tool on various larger examples to confirm the generality of its achievements. Bharti Suri et al. / International Journal on Computer Science and Engineering (IJCSE) ISSN : 0975-3397 Vol. 3 No. 5 May 2011 1924