Optimization of Software Quality Attributes using Evolutionary Algorithm

Website: www.ijeer.forexjournal.co.in Optimization of Software Quality Attributes using Evolutionary ░ ABSTRACT - Software quality is a multidimensional concept. Single attribute can’t define the overall quality of the software. Software developer aims to develop software that possesses maximum software quality which depends upon various software quality attributes such as understand ability, flexibility, reusability, effectiveness, extendibility, functionality, and many more. All these software quality attributes are linked with each other and conflicting in nature. Further, these quality attributes depend upon the design properties of the software. During the designing phase of software, developers must optimize the design properties to develop good software quality. To obtain the appropriate value optimization is done. This paper implemented two multi-objective evolutionary algorithms (NSGA-2 and MOEA/D) to optimize software design properties to enhance software quality. While comparing NSGA-2 algorithm with original values it is found that there is a 1.73% improvement in the software quality on the other hand MOEA/D shows a 3.58% improvement in the software quality.


░ 1. INTRODUCTION
Dependencies on the software are increasing day by day. From time-to-time software requires regular updates and modifications to satisfy the customer needs. While updating the software it is essential to focus on the quality. Poor quality of the software has serious consequences such as it may cause loss of life, mission failure, financial loss, and permanent injury. To ensure the quality, measuring software quality is essential. In literature, several quality models are available to measure the software quality, and a few such models are, Boehm's Quality Model [12], FURPS Quality Model [19], Dromey's Quality Model [16], ISO 9126 Quality Model [10], and Quality Model for Object-Oriented (OO) Design (QMOOD) [15]. Out of all these models, this research work focuses on QMOOD hierarchical model to analyze the quality of software. QMOOD considers both internal as well as external quality attributes of the software. As well as it also maps source code metrics to a higher abstraction level. Researchers have used various metrics to measure these attributes. All these quality attributes further depend upon ten  [17] and four other OO metrics are Number of Attributes, Number of Method, Number of Private Attributes, and Number of public methods. These metrics are a decent indicator to describe the software quality during the design phase. The objective of this research is to optimize the design properties of the software by using the Multi-Objective Evolutionary Algorithm based on Decomposition (MOEA/D) and Non-Dominated genetic algorithm (NSGA-2) algorithms. Software developers can use these optimized values of design properties while updating the software it will enhance the software quality. This paper covers background study in section II; explanation of QMOOD in Section III, research methodology is described in Section IV. The proposed model is applied to QMOOD to maximize software quality, and this is explained in Section V. The final section concludes the paper and highlights the future scope.

░ 2. BACKGROUND STUDY
In literature various techniques has been used by many researchers to enhance the software quality such as fault prediction, refactoring, class prioritization, optimization of software quality attributes. Author R. Malhotra et al. [9] emphasis the importance of software quality attributes and proposed a model used QMOOD for fault prediction at early stage of software life cycle by using statistical method and machine learning for improving software quality attributes. And it is found that metrics WMC and LOC are help in predicting the software quality. Author Puneet at al. [8] develop a model use to evaluate the quality of java program based on QMOOD. Author gave input as java program which vary in functionality and complexity, and it was concluded that Total Quality Index (TQI) of software having single class is very less whereas program which are having low complexity and high design metrics have high TQI. Usman Mansoor et al. [5] proposed the novel approach that enables software developers to apply refactoring technique on model level. This technique improves the inter diagram consistency, as well as overall software quality. For model-based technique UML based class diagram and activity diagram are used to improve software design quality by applying NSGA-II and MOEA/D multi-objective evolutionary algorithms. Authors also found the best tradeoff between multiple criteria and suggested feasible and good design refactoring solution. The results of the proposed approach were statistically examined on four open-source software. Salazar et al. [13] present 3 multi-Objective reliability optimization problems first to find the optimal number of redundant components second is to find the reliability of the components and third is to identify both reliability and redundancy. These issues were stated as single objective mixed-integer non-linear programming problems with one or more constraints. These challenges are framed as multiple-objective problems (MOPs) and were solved with a second-generation Multiple-Objective Evolutionary Algorithm (MOEA) that handles constraints. The Pareto front, or set of optimal solutions, as well as optimal solution space, are found using NSGA-II. Ouni et al. [7] proposed a technique based on multi objective optimization approach to find the optimum trade-off between semantic coherence and software quality using NSGA-II. Two criteria, vocabulary similarity and structural coupling, are used to achieve semantic coherence. The proposed approach's helps in the development of more meaningful refactoring solutions that addressed design flaws while maintaining semantic coherence. From the survey it is observed most of the work has been done on statistical method, machine learning. Evolutionary Algorithms (EA) are another approach of optimization which has gained lot of popularity among researcher and software developers. In this research EA are used to optimize the software quality.

░ 3. QUALITY MODEL FOR OBJECT-ORIETED DESIGN (QMOOD)
In 2002 Bansiya and Davis proposed the model QMOOD [15], which measures the quality of software in terms of attributes like reusability, functionality, flexibility, extendibility, understand ability, and effectiveness. QMOOD explains the relationship between Qualities Attributes (QA) with design properties like abstraction, encapsulation, and Coupling. Figure 1 represents the QMOOD. It implies four levels L1: design quality attributes, L2: OO design properties, L3: OO design metrics, L4: OO design components, and three mappings' links L12 linking design property to quality attributes, L23 linking design metrics to design properties, and L34 linking OO design component to design properties. Table 1 represents the relationship between design properties and QA. External quality attributes are computed with these equations designed by Bansiya et al. [15] according to the author metrics that are used to access design properties can be changed or a distinct set of design properties can be used. Therefore, in Table 2 mapping of design properties with software design metrics according to the dataset is justified.

░ 4. RESEARCH METHODOLOGY
In the late 1960s, Genetic Algorithms (GA) was introduced by John Holland [18]. GA help in evaluating the complicated optimization problem, which cannot be solved using mathematical techniques. GA evaluates on randomly generated initial population which contains solutions also called individuals. These individuals or chromosomes are used to calculate their fitness value or objective function of the problem. It represents the quality of the solution.
In this research paper, we are optimizing the quality of software having six objective function reusability, functionality, flexibility, extendibility, understandability, and effectiveness called fitness function. The fitness value depends upon the quality of the solution.

Dataset and Parameter Setting
Open-source dataset Eclipse Java Development Tool (JDT) Core is chosen for this research. This dataset has 1041 classes, 91 software versions, 23 metrics are available out of these 10 metrics are used in this research work. Table 3 represents the detail of parameter settings that have been taken to perform these experiments. The performance of GA depends upon its control parameters [3][4]. ░

Optimization
An optimization algorithm is a process that compares numerous solutions iteratively until an optimum or satisfying result is obtained. To obtain optimized results various optimization algorithms are available. In this research work two evolutionary algorithms MOEA/D and NSGA-2 are used to optimize the fitness function.

4.2.1
Steps Step 2-µ i , for each uniformly distributed weight element, calculate the Q nearest weights, µ i(1) , µ i(2) … µ i(Q) using the Euclidean distance and set neighborhood .
Step 3-Produce the initial population and evaluate the fitness of each population using the objective function . (Here, the fitness functions are six quality attributes of QMOOD.) Step 4-Set where α is the reference point. Step 6-Output EP MOEA/D was proposed in 2007 by Li and Zhang [11]. MOEA/D decomposes the multi-objective problem (MOP) into several sub-problems rather than solving a problem as a whole and solves all these N sub-problems concurrently by providing solutions in terms of the population. It has less computational complexity at each generation and improved decomposition approaches than NSGA-2, NSGA-3, and multiobjective local search (MOLS). MOEA/D uses a small population size and can produce very evenly distributed solutions of a small number. MOEA/D is applied to optimized class quality parameters. First, the data set is imported having the class name and class quality attribute values for multiple versions then creates the sub-problem. MOEA/D randomly selects 50 classes that build the initial population of classes from the imported data which is sufficient to calculate the quality of complete software. There is no rigid rule for selecting the initial population size. The size of the random population determines by the programmer. If the size is large, it comes with a quick or better solution but will cost more time. On the other hand, if a population's size is less, it quickly terminates the solution but may not give the correct result always and affect the overall working of GA. After initializing the population, the fitness function with the help of QMOOD is calculated. Determine the decomposed cost of selected classes in the population takes the maximum cost value from the population. Calculate the domination of the population. This loop will run until the maximum iteration, and this is the exit criteria. Run the loop for i= 1 to nPop (50). Select two random class versions from sub-problems, called positions as per QMOOD [1][2]. Apply single-point crossover between selected positions and generate a new chromosome.

Steps of NSGA-2
NSGA-2 was proposed by Deb et al. [14] in the year 2002. Figure 2 represents the working of NSGA-2 algorithm. This algorithm is applied to the same randomly selected classes. In NSGA-2 first initialize the population then sorting takes place based on the non-domination criteria of the population. Once the sorting is complete front number is assigned to the solution. The individuals in the population are selected based on front rank and those solution having same front are selected on the basic of crowding distance.
The selection of individuals is carried out using a binary tournament selection with the crowded-comparison operator. Real coded GA using simulated binary crossover and polynomial mutation. The offspring population and current generation population are combined, and the individuals of the next generation are set by selection. The new generation is filled by each front subsequently until the population size exceeds the current population size.

░ 5. SIMULATION RESULTS
The proposed technique has been carried out on an Intel(R) Core (TM) i5-2430M Processor running at 2.40 GHz with RAM of 4 GB. MATLAB R2016a is used to implement algorithms. The solutions obtained over100 runs are optimal and non-dominated after that these optimized values are normalized between zeros to one. The modified MOEA/D and modified NSGA-2 algorithm return multiple optimal solutions because of the random selection procedure of this algorithm some time multiple solutions have similar objective values but for brevity, all the similar solutions except one have been removed and graphs are generated between them. The dots or small circles represent the Pareto optimal solutions obtained from modify MOEA/D modified NSGA-2. As the problem is maximization, the points which are farthest from the axis are to be considered. Figures 5 and 6 represents the graphs obtained from modify MOEA/D and modify NSGA-2. Figures  5 and 6 (A) represents the graph between objective function 1 (Understandability), and objective function 2 (Functionality). Figures 5 and 6 (B) represents a graph between objective function 2 (Extendibility), and objective function 4 (Effectiveness). Figures 5 and 6 (C) represents a graph between objective function 5 (Reusability), and objective function 4 (Flexibility) the graphs are called Pareto front. The implementation result is summarized in Table 4. It represents the total optimized values of all six objective functions obtained after applying the modified MOEA/D and modified NSGA-2 algorithms on fifty classes. It eliminates dominated solutions and produces newer solutions from the external population if newer solutions are not dominated by any member in EP, and adds newer solutions to EP. After adding all the quality attributes of six objective functions of a class the Total Quality Index (TQI) of the class is obtained. It is found that the TQI of the software after applying to modify MOEA/D algorithm gets increased. Table 5 represents the quality improvement in percentage. While comparing modify NSGA-2 algorithm with original values it is found that there is a 1.73% improvement in the software quality on the other hand modify MOEA/D shows a 3.58% improvement in the software quality. In this research work, modify MOEA/D and modify NSGA-2 algorithms are used to optimize the quality parameter and obtain improved quality parameters. The work presented as well as the dataset has not been explored by any of the researchers. Both the algorithms have been modified to work with the dataset used in this research. It has been found that modified MOEA/D gave a better TQI value of a class as compared to NSGA-2 and original data. After having the optimized values of class parameters, it is easy for software engineers to work on those parameters, which overall degrade the software quality. It can easily identify which class has lowquality attributes in terms of functionality, reusability, effectiveness, understandability, extendibility, and flexibility. So that, while updating the next version of the software, the developer will keep in mind which class has low-quality value. ░

Comparative Analysis
Author Mandeep et al. [8] also calculated the quality attributes using the QMOOD quality model. By capturing the objectoriented software metrics of eclipse plugin tool Metrics 1.3.6 metrics scores are normalized but no genetic algorithm is used. Mansoor et al. [5] apply refactoring technique to improve software quality for this both MOEA/D and NSGA-2 algorithm were used on QMOOD, and it was found that functionality of the software get decreases. ;

░ 6. CONCLUSION & FUTURE SCOPE
In this paper, modify MOEA/D and modify NSGA-2 algorithms provide the optimized values of class design properties through which external quality, as well as TQI of the software, get improved. And it is found modify MOEA/D shows better results. The range of improvement of each class lie between 1to 5% and overall improvement in the software is found 3.58%. It also provides a population of the class having an optimized value of class quality attributes. After having the optimized values of class parameters, it is easy for software engineers to work on those parameters, which overall degrade the software quality. It can easily identify which class has lowquality attributes in terms of functionality, reusability, effectiveness; understand ability, extendibility, and flexibility. So that while updating the next version of the software developer will keep in mind which classes have low-quality parameters.
In the future, more work can be done by adding more quality attributes. The proposed technique is computed using static features of the software however the same work can be further extended for dynamic features and for software engineers to work on those parameters, which overall degrade the software quality. It can easily identify which class has low-quality attributes in terms of functionality, reusability, effectiveness, understand ability, extendibility, and flexibility. So that, while updating the next version of the software, the developer will keep in mind which class has low-quality value can be further considered for complex and large real-time software.