## 2 Theoretical Background
### Genetic Algorithm for Test Data Generation  
Genetic Algorithm borrows its idea and terminology from the biological world. In such a way, it uses different representations for potential solutions referred to as chromosomes, genetic operators such as crossover and mutation used to generate new offspring solutions, and also selection and evaluation mechanisms derived from nature. With regard to the problem considered here, a set of generated test data, which best contributes to the software testing process, can serve as potential solutions. Depending on the values of the input variables supplied to the SUT input, the code execution process can follow various paths determined by the sequence of statements, among which there can be both linear statements following one after another, conditional statements (if-then-else), and loops (while, for), leading to branching of the computations. It is the latter that ultimately determines the variety of paths of the SUT execution. In this paper, we assume that input variables \(var_{1},\ var_{2},\ \ldots,\ var_{N}\) of the SUT can take their values from the continuous domains \(D_{1},\ D_{2},\ \ldots,\ D_{N}\). Therefore, it is reasonable to use continuous (real-valued) GA (unlike the binary GA), where the values of input variables are the genes included into the chromosomes that determine potential solutions to the problem of generating input test data. Denoting chromosomes as \(x_{i}\), we determine a test data population, consisting of \(m\) individuals each containing \(N\) genes (values of the input variables)  
\[\{x_{1},\ x_{2},\ \ldots,\ x_{m}\},\ \text{where}\ x_{i}=\left[var_{1}^{i},\ var_{2}^ {i},\ \ldots,\ var_{N}^{i}\right] \tag{2}\]  
The genetic algorithm for test data generation includes the following main stages:  
1. Initialization. The initial population is formed randomly, taking into account constraints on the values of input variables. The volume \(m\) of the initial population is selected based on the size of the SUT (namely, the number of feasible paths). It should be noted that the results of the initialization stage can be used to compare the method proposed in this work with the simplest random test data generation. 2. Population evaluation. Each of the chromosomes is evaluated by a fitness function. In the following sections, we define and explore a fitness function based on the statement coverage of SUT. The proposed fitness function consists of two terms, the first of which is responsible for the coverage of the current path. Another term is responsible for the variety of paths in one population. 3. Selection. The best 20 percent of chromosomes are selected for the next generation directly; the remaining 80 percent of chromosomes are obtained as a result of crossover. 4. Crossover. Among 80 percent of the offspring obtained as a result of crossover, 50 percent is obtained by randomly crossing 20 percent of the best chromosomes of the previous generation with each other. The remaining 50 percent is obtained by randomly crossing all the chromosomes of the previous generation with each other. 5. Crossover occurs through the random choice of a constant \(\beta_{l}\in[0,1]\) for each \(l=\overline{1,N}\) and subsequent blending where a single \(l\)-th offspring gene comes from a linear combination of \(l\)-th genes of the two random chromosomes from the parents' pool [40]: \[var_{l}^{offspring}=\beta_{l}\cdot var_{l}^{mother}+(1-\beta_{l})\cdot var_{l }^{father},\;l=\overline{1,N}.\]
6. Mutation. With a given mutation probability 0.05 the \(l\)-th gene, \(l=\overline{1,N}\), can change its value randomly within the domain \(D_{l}\). The main goal of mutations is to obtain solutions that could not be obtained from the existing genes. 7. Forming the test cases as a pool of elite chromosomes. In each generation, chromosomes are chosen into the pool of elite chromosomes sequentially, in the order of their fitness, i.e., the ability to cover the most complex SUT paths.