Académique Documents
Professionnel Documents
Culture Documents
ABC Tester - Artificial Bee Colony Based Software Test Suite Optimization Approach
D. Jeya Mala (1), V. Mohan (2)
(1) Department of Computer Applications. Thiagarajar College of Engineering (India). (2) Department of Mathematics. Thiagarajar College of Engineering (India)
E-mail: vmohan@tce.edu E-mail: djmcse@tce.edu
ABSTRACT
In this paper we present a new, non-pheromone-based test suite optimization approach inspired by the behavior of biological bees. Our proposed approach is based on ABC (Artificial Bee Colony Optimization) which is motivated by the intelligent behavior of honey bees. In our proposed system, the sites are the nodes in the Software under Test (SUT), the artificial bees modify the test cases with time and the bees aim is to discover the places of nodes with higher coverage and finally the one with the highest usage by the given test case. Since ABC system combines local search methods carried out by employed bees with global search methods managed by onlookers and scouts, we attain near global optima. We investigate whether this new approach outperforms existing test optimization approach based on Genetic Algorithms (GA) in the task of software test optimization. Taking into account the results of our experiments, we conclude that (i) the proposed approach uses fewer iterations to complete the task; (ii) is more scalable, i.e., it requires less computation time to complete the task, and finally (iii) our approach is best in achieving near global optimal solution.
Keywords: Software under Test (SUT), Software Testing, Artificial Bee Colony Optimization (ABC), Coverage, Software Test Optimization, Genetic Algorithm (GA).
1- INTRODUCTION Software testing process typically consumes at least 50% of the total cost involved in software development [1]. This percentage might
even be higher if the software is safety critical [2]. Automation of the testing process is desirable both to reduce the testing cost and also to improve the quality of software. Many of the automation activities focus on the test script level automation and execution of the test scripts in capture and playback model. Most software development organizations automate test-related tasks. But, the test automation process cannot be generalized. While testing tools available in the market might not be applicable in all test environments, they may be useful in some of them. The automation of test data generation is still a research area since the 1
automated testing tools simply generate test data without any consideration of amount of time spent for test data generation and selection of test cases based on the test adequacy criteria. It is up to the tester to choose the test cases from the generated test cases and they have to stop the testing process whenever they feel exhaust or the specific test adequacy criterion is met. Hence, this process involves a lot of human intervention and thus leads to lack of achieving the expected goal. As Phil McMinn briefed in his paper [6], exhaustive enumeration of a programs input is infeasible for any reasonably-sized program, yet random methods are unreliable and unlikely to exercise deeper features of software that are not exercised by mere chance. Previous efforts have been limited by the size and complexity of the software involved, and the basic fact that in general, test data generation is an undecidable problem. The application of meta-heuristic search techniques to test data generation is a possibility which offers much promise for these problems. Meta-heuristic search techniques are high-level frameworks which utilize heuristics in order to find solutions to combinatorial problems at a reasonable computational cost. Such a problem may have been classified as NP-complete or NP-hard, or be a problem for which a polynomial time algorithm is known to exist but is not practical. The application of artificial intelligence (AI) techniques in Software Engineering (SE) is an emerging area of research that brings about the cross fertilization of ideas across two domains [3,9]. A number of published works have begun to examine the effective use of AI for SE related activities that are inherently knowledge intensive and human-centered. Recent research and development of ABC based systems are focusing mostly on applications such as financial decision making systems, transportation, manufacturing, aerospace, military and so on [19]. In our approach, we extended the functionality of the bee to do the testing and monitoring activity so that, it reduces the manual work and improves the confidence on the software by testing it with the coverage of the given software. In our approach we used state coverage, code coverage, branch coverage and path coverage as coverage based test adequacy criteria. As per Horgaon, these coverage based metrics are used to reveal errors in a powerful way [4].
There are several coverage based test adequacy criterion available (Beizer, 1990). In our approach, we used, state coverage, code coverage, branch coverage and path coverage as test adequacy criteria. State Coverage - Unlike other coverage-based criteria, state coverage measures the extent of checks of program behavior. Let Ni be the set of output-defining nodes of SUT subject to test ti, and Vi be the set of covered output defining nodes of SUT subject to test ti. The optimistic state coverage of test suite T is | Vi| | Ni| (5)
Code Coverage-In code testing, criteria based on coverage of the building blocks of programs can be used to determine the adequacy of tests. Code coverage is a measure used in software testing. It describes the degree to which the source code of a program has been tested. It is a form of testing that inspects the code directly and is therefore a form of white box testing. Branch Coverage - Branch coverage adequacy criterion verifies whether each control structure (such as an if statement) is evaluated both to true and false conditions. Branch Coverage % = No. of Branches covered / Total No. of branches Path Coverage based Test Adequacy Criterion - A test T is considered adequate if it tests all paths. In case the program contains a loop, then it is adequate to traverse the loop body zero time or once. Test Optimization To maximize the profit of coverage and minimize the total number of test cases needed.
models and efficient algorithms to achieve optimization by satisfying the specified test adequacy criteria. The major observations derived as part of the literature study are: In neural networks based approach, the drawbacks are its black-box data processing structure; a slow convergence speed; difficulty in programming, training and verification of rules. In Tabu search based approach, more amount of memory is required in terms of long term memory to avoid stuck up at local optima and short term memory to remember all the test cases in the current search. The experiments with Genetic Algorithms (GA) were not satisfactory even when the mutation rate is excessively increased compared to usual application of GA (mutation rates lower than 2%). Moreover, the results are not stable (strike up at local optima); the convergence is slow and non-explicit memorization of best individuals. The drawbacks of Ant Colony Optimization (ACO) include higher length test sequences and repetition of nodes within the same sequence without any advantage on test adequacy criteria. The approach proposes to increase the number of ants to increase the coverage, which violates the optimality requirement criterion. The assumption made by ACO itself has some serious drawbacks: the assumption is that, the two ants are started at an initial node, and during random selection of next node, they will go to the same next node; since, the process is random; one cannot expect that the two ants always go to the same next node at different instances of time.
system (FBS). In the case of FBS, the agents (artificial bees) use approximate reasoning and rules of fuzzy logic in their communication and acting. In this way, the FBS is capable to solve deterministic combinatorial problems, as well as combinatorial problems characterized by uncertainty [24]. Li-Pei Wong et.al, presented an improved Bee Colony Optimization algorithm with Big Valley landscape exploitation as a biologically inspired approach to solve the Job Shop Scheduling problem. They compared the experimental results of the proposed algorithm with Shifting Bottleneck Heuristic, Tabu Search Algorithm and Bee Colony Algorithm with Neighborhood Search on Taillard JSSP benchmark and they showed that it is comparable to these approaches [23]. Duan TEODOROVI et.al, proposed a bee colony optimization approach to complex transportation problems [22]. Adil Baykaso lu et.al, applied Artificial Bee Colony (ABC) Algorithm to Generalized Assignment Problem in the book on Swarm Intelligence: Focus on Ant and Particle Swarm Optimization [25]. Alok Singh applied Artificial Bee Colony (ABC) Algorithm to the leafconstrained minimum spanning tree problem. Given an undirected, connected, weighted graph, the leaf-constrained minimum spanning tree (LCMST) problem seeks on this graph a spanning tree of minimum weight among all the spanning trees of the graph that have at least l leaves. In this paper, they proposed an artificial bee colony (ABC) algorithm for the LCMST problem. They compared the performance of ABC approach against the existing best approaches. They demonstrated the superiority of the new ABC approach over all the other approaches based on computational results. The new approach obtained better quality solutions in shorter time [26]. R. Srinivasa Rao et.al, applied Artificial Bee Colony Algorithm for Optimization of Distribution Network Configuration for Loss Reduction [27]. Nurhan Karaboga proposed a new design method based on artificial bee colony algorithm for digital IIR filters [28]. Mohammad et.al, have applied honey-bee mating optimization algorithm on clustering in data mining. They applied honey-bee mating technique to avoid local optima in cluster analysis. They also compared the efficiency of the approach with other approaches such as GA, SA, TS, and ACO, on several well known data sets. Their finding shows that the proposed algorithm works well than the best one [29].
2-3 NEED FOR ABC BASED APPROCH IN SOFTWARE TEST SUITE OPTIMIZATION
The drawbacks of existing knowledge based approaches discussed in our literature study have made us to focus on an alternate approach which has 7
the advantages of population based approaches without the problem of local optima. The literature study on ABC has provided us a lot of proof on using it as an alternate optimization approach to hard optimization problems. In the light of the above consideration, we applied ABC for software test suite optimization which is a NP-hard problem. Further our paper is divided into the following sections: Section 3 Artificial Bee Colony Optimization (ABC) An Introduction Section 4- Proposed Approach ABC Model based Software Test Optimization Section 5 Related Work GA based Software Test Optimization Section 6 - Implementation of ABC Tester Section 7 Experimental Evaluation and Comparison ABC Vs. GA
10
SUT
Search Bee
Selector Bee
Step 6 If a test path is not complete, then repeat steps 3 to 6. Otherwise, the nodes and test cases from the temporary-node-list and temporary-test case-list are selected for the next test path generation by the employed bees. Step 7 - If the onlooker bee/selector bee finds that the selected test cases are not efficient, then the scout bee/replace bee generates a new population of test cases and replaces the test cases in the temporary-test case-list with new test cases. Until the specified termination criterion is met. (Maximum number of cycles (MCN) is reached or the specified coverage criterion is met (above 95%))
Where k is a solution in the neighborhood of I, q is a random number in the range [-1, 1] and evaluate them. 6. Apply greedy selection process between xi and vi. 7. Calculate the probability values of test cases xi by means of their fitness values using the equation: Pi=fiti / fiti Where i=1 to SN (7) 13
In order to calculate the fitness values of solutions we employed the following equation: fiti= 1 / 1+hv(i) if hv(i) >=0 1+ abs (hv(i) if hv(i) <0 (8)
Fitness of each node is decided by the happiness value (hv) associated with each node based on constraint satisfaction. For a>b, ci(n) =(b-a) and if ci(n) < 0, hv(i) = MIN, otherwise H (ci (n))=MAX or 0 (9) (ii) For a>=b, ci(n) = (b-a) and if ci(n) <= 0, hv(i) = MIN, otherwise H (ci (n))=MAX or 0 (10) (iii) For a<b, ci(n) = (b-a) and if ci(n) > 0, hv(i) = MIN, otherwise H (ci (n))=MAX or 0 (11) (iv) For a<=b, ci(n) = (b-a) and if ci(n) >= 0, hv(i) = MIN, otherwise H (ci (n))=MAX or 0 (12) (v) For a==b, ci(n) = (b-a) and if ci(n) = 0, hv(i) = MIN, otherwise H (ci (n))=MAX or 0 (13) (vi) For a!=b, ci(n) = (b-a) and if ci(n) != 0, hv(i) = MIN, otherwise H (ci (n))=MAX or 0 (14) (vii) For a OR b, hv(i) = hv(ci(a))+hv(ci(b) (15) (viii) For a AND b hv(i) = MIN (hv(ci(a), hv(ci (b)) (16) Pi values are normalized into [0,1] 8. Produce new test cases vi for the onlookers from the test cases xi, selected depending on Pi and evaluate them. 9. Apply the greedy selection process for the onlookers between xi and vi. 10. Determine the abandoned test case, if exists and replaces it with a new randomly produced test case xi for the scout using the equation : xij = minj+rand(0,1)*(maxjminj) (17) The scout waggle dances to indicate the new test case generation. 11. Memorize the best test case achieved so far using the fitness value. 12. cycle = cycle+1 13. Until cycle=Max. Cycle Number (MCN) (i)
be passed as input. Genetic algorithms contain the functions like crossover, mutation, selection and evaluation [13]. The first step is to represent a legal solution to the problem by a string of genes that can take on some value from a specified finite range or alphabet. This string of genes, which represents a solution, is known as a chromosome. Then an initial population of legal chromosomes is constructed at random. At each generation, the fitness of each chromosome in the population is measured. The fitter chromosomes are then selected to produce offspring for the next generation, which inherit the best characteristics of both the parents. After many generations of selection for the fitter chromosomes, the result is hopefully a population that is substantially fitter than the original.
d. Replace worst ranked part of population with offspring 4. Until <terminating condition>
15
Say for example, For the variables a, b and c Test Case 1: 1, 2, 1 Test Case 2: 1, 1, 1 After 1-point cross-over at the second position, we get new test cases as follows: Test Case 11: 1, 1, 1 Test Case 21: 1, 2, 1 This new generation of test cases is then evaluated based on their effectiveness and then either selection or removal will be done. 5-2-3 Mutation This operation is used to change the member at gene level and reproduce the remaining genes for the creation of new generation. In software testing, the test case sets are considered as the population and individual test case is considered as member and the possibility of individual variables value are method call are considered as the genes. Parent 1 Test Case 1: 1, 2, 1 Parent2-TestCase 2: 1, 1, 1 After mutation operator is applied to these test cases, we will get the new generation of test cases like, Child 1 - Test Case 11: 2, 2, 1 Child 2 - Test Case 21: 1, 1, 2 Now this new generation of test cases will be evaluated and the procedure is repeated. 5-2-4 Test Case Evaluation Code Coverage criterion The population that has most favorable features can be assigned with higher fitness value for evaluation. In software testing, the favorable feature is revealing more number of errors. The test case with highest path and branch coverage criterion should be selected as they can reveal errors in their execution. Test Case 11s Coverage% is 50% Test Case 21s Coverage% is 76% Parent 1s Coverage% is 60% Parent 2s Coverage% is 70%
16
5-2-5 Test Case Selection Filtering Function Selecting the best parent from the current population is called as selection process. This will lead to incremental solution. The test case that has higher fitness value is selected as parent for next generation. After the evaluation is done, Parent1 test case is replaced by Test Case 21. Then during the next iteration, this modified parent will be used for the generation of test cases (offspring).
17
Figure 3 Sample Code for comparing three values For the code in Fig.3, the cyclomatic complexity value is 4 which means that there are four independent paths in the given problem. We have an initial set of test cases for each of these paths created randomly. xij be the initial set of test cases for each of the path as below: Let xj = {1,1,2} for path 1 {1,1,1} for path 2, {1,1,1} for path3 and {1,1,1} for path4. It is indicated in table 1. Table 1 Independent paths and initial set of random test cases:
S.No. 1. 2. 3. 4. Path 1-2-3 1-2-4-5 1-2-4-6-7 1-2-4-6-8 Test Case - (a,b,c) 1,1,2 1,1,1 1,1,1 1,1,1
Where i=1 to 3 for variables a,b and c and j=1 to cyclomatic complexity that indicates the total number of paths in the program. xij indicates a test case i related to path j here it is a triple a,b,c. i=1 means it is for a, 2 for b and 3 for c. qij=(-1 to 1) which is a random number generated during program execution.
18
Now, vij = xij+qij(xij-xkj) ,where k is a solution in the neighborhood of i and q is a random number. Path 1: For i=1 to 3, j=1, k = (i+1) % size of the test case (size = 3 since we have 3 variables) v11=x11+q11(x11-x21) = 1+(1) (1-1) = 1 v21=x21+q21(x21-x31)=1+(-1)(1-2) = 2 v31=x31+q31(x31-x11)=1+(0)(2-1) = 1
Hence, vi = {1,2,1} where i=1 and j=1 Compare the fitness of xij and vij. Apply greedy selection process between xi and vi for path j=1. This must be done for all paths of j. Calculate the probability Pi for the solution xi /vi by means of their fitness values: Pi = fiti / sum(i=1 to SN) fiti Here, the fitness values are calculated using the formula (2) and (3). Based on them, new test cases vi for the onlookers from the solutions xi are selected depending on Pi and evaluate them. Apply the greedy selection process between xi and vi. Unfortunately, both of these test cases have their fitness values as 0 and so we need to abandon these solutions and replace them with new solutions by using scout bees. Determine the abandoned solution and replace it with new randomly produced solution xi for the scout using the formula: o xij = minj + rand(0,1) * (maxj minj) Here the minimum valued test case is {1,1,1} and maximum valued test case is {2,1,1}. Hence, x11 = {1,1,1} + 1 * {2,1,1} {1,1,1}
19
= {1,1,1} + 1*{1,0,0} = {1,1,1}+{1,0,0} = {2,1,1} Now, new xij is {2,1,1}. This test case has highest fitness value for the path j=1 and now scout will start a new search by using this new set of test cases. Memorize the best test case achieved so far based on their fitness (probability value). cycle = cycle +1 Until cycle = max. cycle no. (MCN) The above procedure is coded in Java and we applied the said approach each unit of the software under test. We found that the results were generated so fast because of the operation of three agents working in parallel way. Since, the bees work in parallel the decision making process is simple. After the scout bee identifies a new best solution, it waggle-dances in the dancing area. Here, we have a status flag used by the scout bee to indicate it. The results of ABC based framework in test case optimization is shown in Table 2. Table 2 Results of ABC based framework in Test Case Optimization
Test Case (a,b,c) 1,1,2 1,2,1 2,1,1 2. 1-2-4-5 1,1,1 1,2,1 3. 1-2-4-6-7 1,1,1 1,2,1 2,2,1 4. 1-2-4-6-8 1,1,1 Probability value based on Fitness Value 0 0 1 0 1 0 0 1 1 Coverage % (Test sequence) 0% 0% 100% 0% 100% 0% 0% 100% 100%
S.No.
Test Sequence
1.
1-2-3
be integers greater than 0 and less than or equal to 100. The program output may be one of the following: [Scalene Triangle; Isosceles Triangle; Equilateral Triangle, Not a triangle]. This problem is chosen as the bench mark problem because it is the most famous problem in software testing. // Triangle Classification Problem main() { int a,b,c; boolean isatriangle; 1.Print(Triangle Classification Problem); Print(Enter three integers which are sides of a triangle); Read(a,b,c); 2. If(a<(b+c)) && (b<(a+c)) && (c<(a+b)) 3.isatriangle=true; 4. Else isatriangle=false; 5. If (isatriangle) { 6.If(a==b) xor (a==c) xor (b==c) && !(a==b) && (a==c) 7.Print(Isosceles Triangle); 8. If(a==b) && (b==c) 9. Print(Equilateral Triangle); 10. If(a!=b) && (a!=c) && (b!=c) 11. Print(Scalene Triangle); 12. } 13. Else print(Not a triangle); 14. } Figure 4 Sample code for Triangle Classification Problem For the code in Fig.4, the Cyclomatic Complexity value is 5. There are five independent test paths available in the given SUT and are listed in table 3. The blocks of executable statements are given in Fig. 4.
21
Table 4 Sample Test Cases with expected output and path coverage details
Test Case 1 2 3 4 5 6 7 8 9. 10. A 4 1 1 5 2 2 3 3 2 5 B 1 4 2 5 2 3 2 4 3 4 C 2 2 4 5 3 2 2 5 4 6 Expected Output Not a Triangle Not a Triangle Not a Triangle Equilateral Isosceles Isosceles Isosceles Scalene Scalene Scalene Path Covered 1-2-4-13-14 1-2-4-13-14 1-2-4-13-14 1-2-3-5-6-8-9-10-12-14 1-2-3-5-6-7-8-10-12-14 1-2-3-5-6-7-8-10-12-14 1-2-3-5-6-7-8-10-12-14 1-2-3-5-6-8-10-11-12-14 1-2-3-5-6-8-10-11-12-14 1-2-3-5-6-8-10-11-12-14
The initial test cases are generated as a random population generation. Let Xij be the initial set of test cases. = {2,2,3} where j=2 (path =2) , i=1 to 3 for parameters a, b and c. And the Xij values are a=2,b=2 and c=3. The search bee searches the node corresponds to it and it identified that, the test case is suited for node 2 in path2. Hence, the fitness value is high for node 2, which makes the selector bee to select this node as the best node to traverse. Then the neighbor nodes are explored. And the test case is selected for node6 which is meant for Isosceles Triangle. This exploration is continued until it reaches a node that has no more frontiers to explore. The test case is selected for path j=2. 22
Then the next generation of test cases is generated using the formula 1: o o o V13= 2+1 * (2-2) = 2 V23=2+ (1) * (2-3) = 3 V33=3+(1) * (3-2) = 4
= {2,3,4} which is fit for node 2 and so the test case is selected and Vij exploration is done by the selector bee. While exploration, the search bee identifies test case is fit for node10 which is meant for Scalene Triangle, and now the process continues till no more frontiers to explore. The test case is selected for path j=3. Since, there are no more test cases available for selection, the scout generates a new test case using the formula 4: = minj + rand(0,1)*(maxj-minj) Xij = {2,2,3} + (-1) * {2,2,4} {2,2,3} = {2,2,2} Xij Hence the test case has the highest fitness value for node 2 and then selector bee selects it and explores the neighbor nodes. Now the node 8 is selected as the best node to explore and finally the test path 3. The process is continued by all the bees in parallel to cover the entire SUT. Again, the next test case is generated by scout bee using the formula 4: = minj + rand(0,1) * (maxj minj) Vij = {2,2,2} + (1) * {2,2,4} {2,2,2} Vij = {2,2,4} which leads to the path 1 meant for Not a triangle. This is repeated till all the test paths have been covered or a required path coverage percentage has been achieved. Hence the entire test case generation is done with coverage based analysis by three different types of bees working in parallel. In our case studies, we showed the coverage results of variables of type integer. For other data types like float and double, the value range of q should be determined in such a way that, it will produce the test cases in floating point and double based representations. For char data type, the ASCII equivalent of values is used for generation of test cases. Similar to that for Boolean data types, either true or false values should be generated for the variables which are achieved by toggling the values of q during each cycle. Hence, the proposed approach is well suited for any type of problem that involves different data types.
23
For ABC based test optimization framework, the parameters mentioned in table 3 were applied. The initialization of test cases is done as a random process. Then the subsequent generations were carried out by the three bees using the formulae 6 to 17. The selection of test cases was done based on the heuristic happiness value that shows the coverage of the SUT. For example, the selection of test cases as x [1] =2, x [2] =1, x [3] =1 yields the result as coverage of sequence 1-2-3. The number of test runs is increased to get more accurate values.
Figure 6 Path Coverage of individuals in GA For GA based test case optimization, we used the parameters as mentioned in table 3. Then crossover and mutation operations were applied to generate the further generations. At the end of each generation, the fittest individuals are identified by finding the coverage metric. The individuals that have the highest coverage metric were survived and were used as parents for further generations. This process is continued till we reach the acceptable path coverage value or the number of test cycles. From the figures 5 and 6, we see that, the optimization of the test cases based on their fitness value is higher and is steadily improving in ABC. Whereas in GA, the test cases improvement is non-linear and usually strikes at local optima. The time taken for ABC is less since at the same time three different agents are working in parallel and the solution is obtained by collaborative learning (waggle dance) among them. In the case of GA, there is no such collaborative learning available and hence it usually takes more time for generating the solution.
25
The test objects have been tested using GA and the proposed ABC tester algorithm. The results were gathered in terms of their path coverage, test runs and time taken for the entire test case optimization process and is shown in tables 8 and 9. Table 6 Academic Problems
S.NO. [1] [2] [3] [4] [5] 1. 2. 3. 4. 5. Academic Test Problem Timetable Generation Binary Search Tree Construction Online quiz system Students marks processing system Attendance monitoring system Test Object No ATP1 ATP2 ATP3 ATP4 ATP5
The results indicated that, when compared to GA, ABC based test optimization produced high coverage of test cases within minimal number of test runs. Table 8 Results of Academic test problems
GA Based Optimization S.No. Test Problem Path Coverage % 70% 65% 75% 90% 85% Generations Time ABC Based Optimization Path Coverage % 95% 98% 97% 99% 96% Cycles Time
1. 2. 3. 4. 5.
20 45 18 52 29
50 80 35 50 70
10 14 8 10 12
The results gathered from academic problems indicated that, even after we increased the number of cycles in test case generation, the path coverage percentage is low in GA when compared to ABC. 26
Similarly, for industrial test problems; we identified that, for complex systems which involve multiple data types the performance of ABC is superior and takes only less time for test case generation process.
8-CONCLUSION
In this paper, we demonstrated the application of ABC in software test suite optimization and showed the superiority of the proposed approach over the existing GA based approach. Problems with GA include no memorization, non linear optimization, risk of suboptimal solution and delayed convergence. There is no guarantee for global optimal solution even when it may be reached. But, ABC model based test suite optimization generates near global optimal results and it converges within less number of test runs. As a future work, different versions of ABC have to be applied for test suite optimization and conduct an analytical study in finding the best ABC version in near global optimal solution generation for software testing. Also, the performance of ABC can be compared with Ant Colony Optimization (ACO) for efficiency evaluation.
REFERENCES
[1] Rudolf Ramler, Klaus Wolfmaier, Economic perspectives in test automation: balancing automated and manual testing with opportunity cost, Proceedings of the international workshop on Automation of Software Test, pp.15-23, 2006. [2] Michael Grottke, Kishor S. Trivedi, Fighting Bugs: Remove, Retry, Replicate, and Rejuvenate, IEEE Computer, Vol.40, No.2, pp. 107-109, 2007. [3] Briand, L. C., On the many ways Software Engineering can benefit from Knowledge Engineering, Proc. 14th SEKE, Italy, pp. 3-6, 2002. [4] Horgan, J., London, S., and Lyu, M., Achieving Software Quality with Testing Coverage Measures, IEEE Computer, Vol. 27 No.9 pp. 60-69, 1994. [5] Li, H., Lam, C.P., Optimization of State-based Test Suites for Software Systems: An Evolutionary Approach, International Journal of Computer & 27
Information Science, Vol. 5, No. 3, pp. 212-223, 2004. [6] McMinn, P., Search-based Software Test Data Generation: A Survey, Software Testing, Verification and Reliability, Vol.14, No. 2, pp. 105- 156, 2004. [7] McMinn, P., Holcombe, M., The State Problem for Evolutionary Testing, Proc. GECCO 2003, LNCS Vol. 2724, pp. 2488-2500, Springer Verlag, 2003. [8] Huaizhong Li and C.Peng Lam, Software Test Data Generation using Ant Colony Optimization, Transactions on Engineering, Computing and Technology, ISSN 1305-5313, 2004. [9] Pedrycz, W., Peters, J. F., Computational Intelligence in Software Engineering, World Scientific Publishers, 1998. [10] Tracey, N., Clark, N., .Mander K., and McDermid, N., A Search Based Automated Test Data Generation Framework for Safety Critical Systems, in Systems Engineering for Business Process Change (New Directions), Henderson P., Editor, Springer Verlag, 2002. [11] H. Edwin Romeijn, Panos M. Pardalos, Handbook Of Global Optimization, Volume 2, Kluwer Academic Publishers, 2002 [12] B. Beizer, Software Testing Techniques, Thomson Computer Press, 2nd edition, 1990. [13] R. Pargas, M. Harrold, R. Peck. Test-data generation using genetic algorithms, Software Testing, Verification and Reliability, Vol. 9, No.4, pp.263--282, 1999. [14] Meenakshi Vanmali, Mark Last, Abraham Kandel, Using a neural network in the software testing process, International Journal of Intelligent Systems, Vol.17, No.1, pp. 45 62, 2002 [15] Zhang, Zili, Zhou, Fuzzy Logic Based Approach For Software Testing, International Journal Of Pattern Recognition And Artificial Intelligence, pp.709-722, 2007 [16] Hlne Waeselynck, Pascale Thvenod-Fosse, Olfa Abdellatif-Kaddour, Simulated annealing applied to test generation: landscape characterization and stopping criteria, Empirical Software Engineering, Vol.12, No.1, pp.3563, February 2007. [17] Eugenia Daz, Javier Tuya, Raquel Blanco, A tabu search algorithm for structural software testing, Computers and Operations Research, Vol. 35, No.10, pp. 3052-3072, 2008. [18] D.Jeya Mala, Dr.V.Mohan, Hybrid Tester - An Automated Hybrid Genetic Algorithm Based Test Case Optimization Framework for Effective Software Testing, International Journal of Computational Intelligence: Theory and Practice, Vol.3 No.2, pp 81-94, 2008. 28
[19] D. Karaboga, B. Basturk, On The Performance Of Artificial Bee Colony (ABC) Algorithm, Applied Soft Computing,Volume 8, Issue 1, January 2008, pp. 687-697,2007 [20] Dervis Karaboga, Bahriye Basturk, Artificial Bee Colony (ABC) Optimization Algorithm for Solving Constrained Optimization Problems, LNCS- Book on Foundations of Fuzzy Logic and Soft Computing, pp. 789-798, 2007. [21] Dervis Karaboga, Bahriye Basturk, A powerful and efficient algorithm for numerical function optimization: artificial bee colony (ABC) algorithm, Journal of Global Optimization, Volume 39, Number 3, pp. 459-471, 2007. [22] Dusan Teodorovic, Panta Lucic, Goran Markovic, Mauro D Orco, Bee Colony Optimization: Principles and Applications, Proceedings of Neural Network Applications in Electrical Engineering, pp. 151-156, 2006. [23] Li-Pei Wong, Chi Yung Puan, Malcolm Yoke Hean Low, Chin Soon Chong, Bee colony optimization algorithm with big valley landscape exploitation for job shop scheduling problems, Applied Soft Computing, Volume 8 , Issue 1,pp. 687-697, 2008. [24] Duan Teodorovi, Mauro Dell, Bee Colony Optimization A Cooperative Learning Approach To Complex Transportation Problems, Advanced OR and AI Methods in Transportation, pp 51-60, 2006. [25] Adil Baykasolu, Lale zbakr and Pnar Tapkan, Artificial Bee Colony Algorithm and Its Application to Generalized Assignment Problem, Book on Swarm Intelligence: Focus on Ant and Particle Swarm Optimization, 2007. [26] Alok Singh, An artificial bee colony algorithm for the leaf-constrained minimum spanning tree problem, Applied Soft Computing, Volume 9, Issue 2, pp. 625-631, 2009 [27] R. Srinivasa Rao, S.V.L. Narasimham, M. Ramalingaraju, Optimization of Distribution Network Configuration for Loss Reduction Using Artificial Bee Colony Algorithm, Proceedings Of World Academy Of Science, Engineering And Technology, Volume 35, pp 709-715, 2008. [28] Nurhan Karaboga, A new design method based on artificial bee colony algorithm for digital IIR filters, Journal of the Franklin Institute, Volume 346, Issue 4, pp. 328-348, 2009. [29] Mohammad Fathian, Babak Amiri and Ali Maroosi, Application of honeybee mating optimization algorithm on clustering, Applied Mathematics and Computation, Volume 190, Issue 2, pp. 1502-1513, 2007.
29
APPENDIX A Sample Code A sample code for binary search tree construction is given below for which the path coverage metric has been calculated. //Binary Tree Node Construction public class BinaryTreeNode { private BinaryTreeNode left; private BinaryTreeNode right; private Comparable obj; public BinaryTreeNode(Comparable x) { obj = x; left = null; right = null; } public void insert(BinaryTreeNode z) { if (z.obj.compareTo(obj) == 0) return; if (z.obj.compareTo(obj) < 0) if (left == null) left = z; else left.insert(z); else if (right == null) right = z; else right.insert(z); } public BinaryTreeNode search(Comparable x) { if (x.compareTo(obj) == 0) return this; if (x.compareTo(obj) < 0) if (left == null) return null; else return left.search(x); else if (right == null) return null; else return right.search(x); }} //Binary Tree Construction public class BinaryTree { 30
private BinaryTreeNode root; public BinaryTree() { root = null; } public void insert(BinaryTreeNode z) { if (root == null) root = z; else root.insert(z); } public boolean search(Comparable x) { if (root == null) return false; BinaryTreeNode n = root.search(x); if (n != null) return true; return false; }} Figure A -1 - Bench Mark Problem Binary Search Path Coverage Criterion Evaluation for Binary Search Program class BinaryTree { private BinaryTreeNode root; public BinaryTree(String tg1) {root = null;} public String insert(BinaryTreeNode z,String tg2) { tg2=tg2+2; if (root == null) { root = z; tg2=tg2+3; } else { root.insert(z); tg2=tg2+4; } return tg2; } public String search(Comparable x,String tg3) { tg3=tg3+5; if (root == null) { 31
tg3=tg3+6; return tg3; } BinaryTreeNode n = root.search(x); tg3=tg3+7; if (n != null) {tg3=tg3+8;} else {tg3=tg3+9;} return tg3; }} Figure A-2 - Path Coverage Criterion Evaluation for Binary Search Program
APPENDIx B
Figure B1 ABC Tester Initial Test Case Generation Fig. B-1 shows initial set of test cases for case study 1. The happiness value and path coverage details based on happiness value for each path are calculated using search agent/bee and are shown in Fig. B-2. The selection is shown in Fig. B-3.
32
Figure B-2 Happiness value calculation and path coverage % of initial set of test cases
Figure B-3 Selected test cases along with their Path coverage %
33