Multi-trajectory Fitness Function-based Method of Automated Test Coverage for Code Using Evolutionary Algorithms
Testing is a time consuming and resource intensive task. Testing often takes about half of the total project development time.Hence, in recent times, a lot of studies have considered the issues of the process automation of creating and running tests. Recently, a lot of papers have been published in the field concerned. However, most of them use unit testing, in which the coverage of different program fragments occurs independently of each other. Therefore, the internal structure of the program was not taken into account.The article presents a method to build a test suite based on evolutionary algorithms that takes into account the features of the entire program, as a whole.Evolutionary algorithms are a class of optimization algorithms that has been widely developed lately, using the ideas of artificial intelligence and intended for conducting directed search. They allow successful solving the problems of software testing, such as testing embedded systems and automatic construction of unit tests.With implementing evolutionary approach the article has solved the following tasks. Proposed a method for determining the fitness function, which allows us to consider an approximation along all possible trajectories, which provides a solution to the problem of coverage in almost any case. However, the number of such trajectories can be quite large, which leads to a significant increase in test execution time. Proposed a method of approximation along all possible trajectories, allowing testing to be done in a reasonable time. Time costs to achieve the goal are reduced by selecting such a trajectory among all possible ones for which a distance value to the instruction is minimal.To study the proposed method, there were four different tasks each of which involved about 1000 runs. The presented research results have shown that the given method is more reliable than the commonly used approaches in which the reference trajectory is selected. In addition, an estimate of time costs has shown that the discussed method has higher efficiency.