Branch coverage test case generation using genetic algorithm and harmony search - Abedinpourshotorban, Hosein (2015)
Due to the vital role of software in the modern world, there is a great demand for reliability, and it can be achieved through the process of testing. White-Box testing is one of the testing methods that aims to uncover errors of coding by investigating the internal structure of the software. Moreover, generation of test cases for White-Box testing of software can be done manually or automatically. However, due to possible mistakes and expenses of manual test case generation, trend is toward making this activity automatic. So far, proposed techniques for automatic test case generation are mostly based on Genetic Algorithm (GA). However, existing GA techniques are quite slow and unable to achieve full coverage when it comes to test case generation for complex software with a wide range of inputs. Thus, in this research an improved fitness function is proposed based on Control Dependence Graph (CDG) and branch distance that can improve the speed and coverage of test cases generation by the means of evolutionary algorithms like GA. Also, a GA-based branch coverage test case generation technique is proposed in this research that takes advantage of our proposed fitness function, and comparison results based on two benchmark case studies show that our proposed technique outperforms the original CDG technique in speed and coverage of test case generation. In addition, we evaluated our proposed fitness function with harmony search algorithm (HS), which is a more recent optimization algorithm compared to GA, and find out that HS outperforms GA in speed of test case generation for branch coverage of software code.