# Adaptive Test Suits Generation for Self-Adaptive Systems Using SPEA2 Algorithm
## 4 Experiments and Results  
### Objective Functions  
The objectives (fitness) function as input utilized in the optimization is also defined with assistance from the elitist chromosome representation as mentioned above in the previous sections. Due to the fact that the framework itself does not rely on any assumptions on how those objectives are organized internally, it is important to note that SPEA2-SAS works with a variety of measurable quality objectives while being indifferent to how the actual objective operates. It is also feasible to take into account more than two objectives with SPEA2-SAS, but we only do so in this article for the sake of a more understandable explanation because the basic idea behind multi-objective optimization holds optimization regardless of the number of objectives. As long as they are consistent with the genes described by SPEA2-SAS, the actual goal functions used by SPEA2-SAS can be constructed using a variety of modeling methodologies from the literature (e.g., machine learning-based [18; 30; 31], analytical [32], and simulation-based [33]). The elicited dependency chains and combinations of the genes are smoothly fed into the mutation operation at runtime to stop the generation of invalid offspring while mutating the solutions. In this study, we base our analysis on the boundary mutation operator, in which each gene is affected according to a mutation rate. A gene's optional values are assigned at random utilizing the mutation rate. The mutation operator was selected for experimentation because (a) it is widely used operator and (b) it deals with optimization problems to pick a random value from predefined values in the form of a tree for a SAS feature model, which is especially appropriate for our proposed optimization problem regarding SAS systems. However, because the breach of dependence is avoided anytime a gene is altered, SPEA2-SAS may easily be modified to work with any additional operators that change the genes similarly to the mutation operator. When exchanging elements of the solutions, it is vital to eliminate invalid offspring, just like during the mutation process. To do this, the supplied crossover operator in the MOEA can be utilized with the extracted dependency chains and the merged value trees. In our study, there is also dependency on the crossover method, which involves two genes from different parents that are located in the same place on the chromosome and may be switched depending on the crossover rate. These uniform crossover operators were selected because they reduce the issue of gene position, which makes it easier to moderate  
Figure 3: SPEA2 procedure workflow. other SAS design constraints by making them less sensitive to the proximity of highly reliant genes (features) in the encoding. It is simple to adapt SPEA2-SAS to operate with any other operator like mutation or crossover, provided that each pair of switched genes is always at the same place in the encoding. This is because whenever a pair of genes is switched, the violation of dependency is averted. The violation of dependence is, however, avoided anytime a pair of genes is switched; hence, it is simple to adapt the SPEA2-SAS approach to operate with any other operators such that every pair of replaced genes would always be in the same place in the encoding. The following two objectives need to be optimized:  
1. Minimizing the Test Cases (OBJ1)
2. Minimizing the Cost (OBJ2)  
We performed extensive tests to assess the efficacy of the SPEA2-SAS approach by contrasting it with its variations and cutting-edge frameworks under various metrics utilizing the actual operating feature model SAS. We specifically employ hyper-volume and a population size of 500 for SPEA2. The volume of the goal space is presented using the hype volume measure, and Pareto front A dominates this space. To assess the quality of the spread and convergence of the non-dominated solution set, a hyper-volume quality indicator is used. The greater the performance of an algorithm, the higher the HV value will be.