Literature DB >> 35746156

Test Case Prioritization, Selection, and Reduction Using Improved Quantum-Behaved Particle Swarm Optimization.

Anu Bajaj1, Ajith Abraham1, Saroj Ratnoo2, Lubna Abdelkareim Gabralla3.   

Abstract

The emerging areas of IoT and sensor networks bring lots of software applications on a daily basis. To keep up with the ever-changing expectations of clients and the competitive market, the software must be updated. The changes may cause unintended consequences, necessitating retesting, i.e., regression testing, before being released. The efficiency and efficacy of regression testing techniques can be improved with the use of optimization approaches. This paper proposes an improved quantum-behaved particle swarm optimization approach for regression testing. The algorithm is improved by employing a fix-up mechanism to perform perturbation for the combinatorial TCP problem. Second, the dynamic contraction-expansion coefficient is used to accelerate the convergence. It is followed by an adaptive test case selection strategy to choose the modification-revealing test cases. Finally, the superfluous test cases are removed. Furthermore, the algorithm's robustness is analyzed for fault as well as statement coverage. The empirical results reveal that the proposed algorithm performs better than the Genetic Algorithm, Bat Algorithm, Grey Wolf Optimization, Particle Swarm Optimization and its variants for prioritizing test cases. The findings show that inclusivity, test selection percentage and cost reduction percentages are higher in the case of fault coverage compared to statement coverage but at the cost of high fault detection loss (approx. 7%) at the test case reduction stage.

Entities:  

Keywords:  QPSO; nature-inspired algorithms; particle swarm optimization; regression testing; test case prioritization; test case reduction; test case selection

Mesh:

Year:  2022        PMID: 35746156      PMCID: PMC9227216          DOI: 10.3390/s22124374

Source DB:  PubMed          Journal:  Sensors (Basel)        ISSN: 1424-8220            Impact factor:   3.847


1. Introduction

With the advent of healthcare applications and the tremendous amount of information processing, there is a need for fault handling [1]. Therefore, software testing is becoming essential for critical safety systems, e.g., IoT devices and sensor networks connected with it in one or another, where failure may lead to loss of money and life. In other words, it is an important part of the software development lifecycle since it ensures that the software is of high quality. It accounts for around half of the entire cost [2]. Testing during the evolution and maintenance phases becomes more important to assure the software’s dependability. All of the test cases must be re-implemented to guarantee that the quality is not affected; this is known as regression testing [3]. In other words, the software is continually changing to sustain the competitive market by updating and maintaining to satisfy the changing needs. Complete retesting accounts for around eighty percent of the entire maintenance cost [4]. On the other hand, it is difficult to test each upgraded version of software nowadays. Software becomes more complex with frequent upgrades, and the amount of time and effort required for regression testing may increase. Test case reduction, selection and priority strategies can help solve these bottleneck problems [5]. Test Case Prioritization (TCP) It ranks the test cases based on some predefined goals, such as maximum code coverage, fault coverage and requirements coverage. It finds such that ; for a given test suite, T, its permutations set , and f denotes a function from to real numbers [2]. In other words, it claims to identify from with a value of larger than any other test case in . The coverage rate is represented by f, which calculates the performance of the permutation series in terms of real numbers. Test Case Selection (TCS) It chooses essential test cases that are linked with the update of the software. In other words, it finds a subset of T, for testing the modified version of P, [5]. Test Case Reduction (TCR) It focuses on removing redundant test cases by finding a representative test case set, , from T that satisfies test requirements set R: {} for the defined coverage of the program [2]. TCP is the most commonly used out of these three strategies by researchers because it does not eliminate or pick test cases. Instead, it simply rearranges them such that the most critical ones are checked first. The significance of these test cases is determined by a number of factors. It might be code coverage, fault coverage, requirement priority or critical components [3]. TCS and TCR, on the other hand, may leave out certain crucial test cases that can be useful for upcoming versions of the product [2]. On the other side, finding the best order for the test cases, as well as the best way to limit or choose the test cases, makes it a NP- hard problem [6]. Optimization strategies can be used to successfully overcome these issues. Nature-inspired algorithms have been successfully employed to solve difficult optimization problems in many domains [7]. Alternatively, they can improve the cost-effectiveness of regression testing. Nature-inspired algorithms appeal to researchers because of their basic structure and ease of use. The methods are theoretically built by modeling natural events [3]. These algorithms are broadly classified into three classes: biology-inspired, physics/chemistry-inspired and social-phenomena-inspired algorithms. These techniques have also been applied in regression testing [2]. The most often used algorithms are evolutionary algorithms and swarm intelligence-based algorithms from the biology-inspired family of nature-inspired approaches [8]. PSO algorithms have been used by researchers for solving regression testing problems. We have also used similar approaches in our previous works. For Example, Dragonfly was hybridized with PSO for prioritizing the test cases using fault coverage information. It reduced the test suite to 87–96%, which thereby removed some of the critical test cases. Therefore, tri-level regression testing was performed by layering the test case selection in between the test case prioritization and reduction. The promising results of the nature-inspired algorithms on statement coverage motivated us to validate the results on fault coverage as well. As a result, this work analyses the effect of fault and statement coverage criteria on the performance of the technique. It also suggests a swarm-intelligence-based algorithm, Quantum-behaved particle swarm optimization (QPSO) and its improved version, IQPSO, for tri-level regression testing to improve the quality of results. The main contributions of this research are: Improved QPSO Algorithm to solve the TCP for fault and statement coverage criteria. Extended the algorithm for selecting the modification-revealing test cases using historical information and further reduction of the test suite size. Performance analysis of the algorithms using different testing goals, i.e., code coverage and fault coverage. Verified robustness of the proposed algorithm against Genetic Algorithm (GA), Bat Algorithm (BAT), Grey Wolf Optimization (GWO), Particle Swarm Optimization (PSO), Adaptive PSO (AdPSO) and the hybrid of PSO with Gravitational Search Algorithm (PSOGSA) and Dragonfly Algorithm (DAPSO). Alternatively, the nature-inspired algorithms prioritize test cases based on the most extensively used criteria: statement and fault coverage. The modification-revealing test cases are included with the help of the adaptive test case selection method. It takes into account test case history and picks failed test cases based on probabilistic potentials. Since the test selection percentage is large at the expense of high inclusiveness; the TCR is introduced to minimize test suite size by removing duplicate test cases. The empirical results show that the proposed technique works for both fault and statement coverage. Inclusivity, test selection percentage and cost reduction percentages are higher in the case of fault coverage compared to statement coverage but at the cost of slightly high fault detection loss at the test case reduction stage. The organization of the paper is structured as follows: Section 2 describes the research work done in the application of PSO algorithms for solving regression testing problems. In succession, Section 3 presents the working mechanism of the basic PSO and QPSO. The proposed algorithms are discussed in Section 4. Section 5 and Section 6 present the experimental setup and results analysis. The paper is concluded in Section 7.

2. Literature Review

A review of the literature on the applications of nature-inspired algorithms for regression testing is presented in this section. For Example, Li et al. [4] compared search-based methods to traditional algorithms. It was discovered that the search space is better explored with GA. It prompted more research into the use of nature-inspired algorithms. For example, Zhang et al. [9] used a distance-based and index-based implementation of ACO to prioritize test cases, and the results were superior to GA, PSO and RS. Using the Cuckoo Search Algorithm (CSA), a new fixup mechanism for permutation encoding was developed to address the TCP problem [3]. CSA was also used to reduce the test suite for configuration-aware software testing [10]. Mohapatra and Prasad [11] have employed Ant Colony Optimization on Java programs, and analyzed the performance for reduced suite and complexity to traditional techniques. The quantum-inspired ACO approach for test suite reduction was developed by Zhang et al. [12]. The suggested method outperformed previous ACOs in terms of a % decrease in size. NSGA-II was employed by Mondal et al. [13] for TCS by taking the test suite variety and code coverage as a fitness metric. With a maximum time limit of 20%, it was discovered that diversity enhanced the defect detection rate by up to 16 percent. Several researchers have employed PSO, such as Khatibsyarbini et al. [14], who used string distances to arrange the test instances and validated it on the real-world TSL dataset. To choose test cases based on redundancy, binary constraint PSO and its hybrid variants with local search algorithms were developed [15]. PSO was implemented with local search to select test cases, having goals of increased branch coverage and lower costs [16]. Because of the positive findings, PSO was also combined with harmony search, which performed better than NSGA-II [17]. Correia [18] developed a test suite diversity diagnosability measure, and the results were improved by applying local search algorithms with PSO to maximize requirement coverage while lowering associated costs. The test case reduction was also implemented with TCP by hybridizing the PSO with the Dragonfly Algorithm. The observations suggested that hybrid algorithms outperformed other search algorithms [6]. Tri-level regression tesing was proposed to prioritize, select and minimize the test cases based on statement coverage. It was observed that the hybrid of PSO with Gravitational Search Algorithm (PSOGSA) outperformed GA, PSO and GSA [5]. The test suite was minimized using hybrid PSO and the Firefly Algorithm, considering the fault coverage [19]. The modified condition decision coverage criteria were employed as fitness measures in PSO for prioritizing the test cases [20]. Deneke et al. [21] also proposed the PSO Algorithm for reducing the test suite based on requirement coverage and cost. Samad et al. [22] proposed multi-objective PSO for optimizing the code and fault coverage and cost. Agrawal and Kaur selected the test cases using the fault information with the application of PSO [23]. Table 1 shows the application of PSO Algorithms for regression testing methods along with their optimization criteria.
Table 1

Summary of PSO Algorithms used in Regression Testing.

Author(s) (Year)MethodNature-Inspired ApproachesCriteria
De Souza et al., 2013, 2014TCSBinary PSORequirement Coverage with Time
De Souza et al., 2015TCSBinary PSO-HSBranch Requirement Coverage with Cost
Khatibsyarbini et al., 2018TCPPSOString Distances
Agrawal and Kaur 2018TCSPSOFault Coverage and Time
Correia, 2019TCSPSO-LSRequirement Coverage
Nayak and Ray 2019TCPPSOModified Condition Decision Coverage
Samad et al., 2021TCPMOPSOCode and Fault Coverage with Cost
Bajaj and Abraham, 2021TCP and TCRDAPSOFault Coverage
Bajaj and Sangwan, 2021TCP, TCS, TCRPSOGSAStatement Coverage
Bharathi, 2022TCRPSO-FFAFault Coverage
Deneke et al., 2022TCRPSORequirement Coverage and cost
PSO algorithms have become one of the state-of-the-art algorithms and show promising results in various domains, e.g., reduction of CO emissions in air baggage systems [24]. The original PSO, on the other hand, had issues, such as getting trapped in local optima and premature convergence [25]. According to the findings, upgraded and hybrid versions of PSO outperformed PSO for complicated systems [15]. One such algorithm is Quantum-behaved PSO (QPSO). It is based on quantum mechanics in which particles can travel through a large search space for global convergence [26]. This method has shown good results in a variety of applications, such as cancer classification [27], feature extraction ([28,29,30]) and constrained engineering problems [31], and others [32]. However, it has not been investigated in the TCP domain, which might be due to the fact that it was originally designed for continuous problems. Therefore, to shift infeasible solutions into feasible ones, we suggested a discrete QPSO method based on an adaptation strategy. It does, however, have significant drawbacks, such as early convergence. As a result, we have improved it with a dynamic contraction-expansion coefficient to speed up the performance in the last iterations [31]. Besides this, we have extended the algorithm for selecting the modification-revealing () test cases from the current best solution of TCP. It is occasionally necessary to reduce the test suite by reducing redundancy because of time limits; thus we employed the TCR approach in the end. Our key focus in this research is on performing regression testing in three steps, including TCP, TCS and TCR processes for fault and statement coverage. Alternatively, the effect of different testing criteria on the overall performance of algorithms was analyzed. The observations suggest that the tri-level regression technique is effective for both coverage criteria. The proposed algorithm, IQPSO, is statistically not significant from PSOGSA; however, its variance and mean fitness values are better.

3. Preliminaries

This Section briefly explains the working mechanism of Particle Swarm Optimization (PSO) and Quantum-behaved PSO.

3.1. Particle Swarm Optimization

PSO is inspired by particle behavior, such as flocking, swarming and herding. Each particle changes its flight based on self or companion’s previous flight experience. Each particle, based on its own experience, is aware of the location of food, which is referred to as the personal best position (P). Simultaneously, the particle has knowledge of the swarm’s best-discovered position, the global best position (G). This phenomenon is reproduced in order to solve real-world issues. In other words, the swarm is made up of particles that fly randomly in the solution space with velocity at position and change positions based on personal experience, social behavior and cognitive behavior ([33]). The position and velocity of each particle i at generation are defined mathematically as: w is the inertia weight used to regulate the impact of prior velocity; and are the constants used to adjust the attractiveness speeds among these social and cognitive elements; and and are uniform random values in the range .

3.2. Quantum-Behaved PSO

A more robust variant of PSO called QPSO is created [25], as PSO cannot ensure global convergence [32]. It determines the Quantum-behaved particles’ route, assuming that N particles with specified energy and potential are well-centered in each dimension of the n-dimensional Hilbert search space. The component of tje particle’s position at iteration is given by the Monte Carlo technique: where is a uniformly distributed value between 0 and 1, is the individual’s local attractor and is the contraction-expansion coefficient. As a result, the particle’s location in the QPSO Algorithm may be calculated as follows: In each generation, the particles travel around the local attractor , which is formed with the P and G optimal locations as follows: The next generation’s particle position distribution is computed using the mean of the P best locations of the particles. The fundamental difference between the PSO and the QPSO is twofold: (1) a large search space owing to the exponential distribution of the particles; and (2) the particle’s distance from its partners is considered, whereas in PSO, particles move freely to converge to the global best. Another benefit is that it only has one parameter, , which must be managed for convergence and whose value is reduced linearly using the equation: Because it is simple to use and has been tried and tested on a variety of applications, ref. [32], we sought to apply the QPSO method to a discrete optimization problem in this study and compare its performance to that of state-of-the-art techniques.

4. Proposed Work

This section explains an improved QPSO Algorithm. It is described in three stages. First, it incorporates the asexual reproduction operator into the population (ARO). Second, the adaptive contraction-expansion coefficient is used to alleviate the issue of stagnation. Finally, the adaptive TCS method is then used to choose the test cases. It is followed by the TCR technique for minimizing the size of the test suite as follows:

4.1. Population Update

Appropriate mapping increases the algorithm’s speed and efficacy, so the real numbers are being updated to permutation series by applying the asexual reproduction method. The fix-up process creates a link between real numbers and test case sequences, such that the current solution acquires the parent solution’s properties by forming the bud from the parent while keeping the offspring’s possible values (larva). Alternatively, the algorithm recalculates and rounds the output to natural values. Do not care conditions (*) are used to replace out-of-range and identical particles [3].

4.2. Dynamic Contraction-Expansion Coefficient ()

The value of the contraction-expansion coefficient in QPSO indicates the population’s search radius. The bigger the value, the wider the particle search range; on the other hand, the smaller value, the more narrow the search range. The evolution velocity coefficient is introduced to adaptively alter  [34]: since the global optimal solution is always replaced by the solution with superior fitness as the iteration advances; specifically, . The fitness value of global best varies significantly when the value of is tiny. The evolution is speeding up at small due to significant changes in as the particles are beyond the ideal location. As a result, needs to be increased to ensure a quick optimization. The evolution gets slowed down with large , and the particle search range is reduced, and so is the for better optimization. The solution converges, and the evolution stops at . Therefore, Equation (8) is replaced with: here and are the minimum and maximum values, and is the evolution velocity coefficient’s weight. Further, the difference between approaches zero as the iterations proceed, so this value is replaced with the mutation operator , where r and s are the particles selected randomly from the population [34]. It is mathematically formulated as:

4.3. Adaptive Test Case Selection

The test case selection approach was proposed [5] that takes into account the statements they cover in the modified version and the impact of failed test cases. It is a dynamic algorithm that picks test cases depending on their pass or fail information after each iteration of TCP step. During the selection process, it requires exact input information, which is quite important in uncovering errors. It is called adaptive as it revises the fault detection capabilities of unallocated test cases and chooses test cases based on existing and earlier historical data. The technique is described as: Before picking the test case , is the chance of any statement s having additional errors. p and q are constants with values between 0 and 1, such that . It measures the influence of pass or fail status on the of any statement s. The values of p and q are set to and , and q is set high since the goal is to acquire a larger proportion of failed test cases than passed ones. It also uses Equation (13) to update the of the unallocated test cases t: The test case t with the highest is chosen, and other test cases’ potentials are updated using the chosen test case’s state. The of unassigned test cases t is also updated depending on their revised potentials. In other words, the unassigned test cases’ fault detection capacity is recalculated. The shortlisting sequence is based on the most recent data obtained, and it picks the test case t that has the highest rank in the modified . If the test cases are tied, the initial copy of the test case order is used to break the tie. is created by removing the specified test case from . The previous steps are continued until the stopping requirements are fulfilled, i.e., it creates a sufficient test case to achieve 100 percent statement and fault coverage (), as presented in Algorithm 1. As the algorithm contains two loops that run up to the size of the test suite, the time complexity of the algorithm is . Define potentials p and q, p + q = 1 Initialize PT = Prioritized suite ST = empty test set with capacity mx Select the first r test cases that covers all faults and statements st = 1 and t = PT(1) = ST(1) Find Pot(s) and empty PT(1) Find other test cases needed for full coverage while  do if (st = mx) then break end if st = st + 1 for t do = 1:PT Calculate P(t) end for t = max(P) Update Pot(s), PT = PT − t, ST = ST + t Empty P array for reassignment end while Return selected test cases

4.4. Test Case Reduction (TCR)

To reduce suite size and cost, the current best solution of every generation is followed by the duplicate verification, and the very first test cases covering the faults/statements completely are chosen. This technique has the advantage of exposing how the test cases are ranked precisely [6]. The pseudo-code of TCR is given in Algorithm 2. Since it contains one loop for the test cases and another for finding the faults or statements , so the time complexity of the algorithm can be calculated as . Algorithm 3 presents an Improved IQPSO Algorithm consisting of two loops, and . It also contains ATCS and TCR algorithms, so the overall complexity of the algorithm is . Define test fault matrix M, Ranked test cases T, Initialize Faults position array Pos and test cases indices array I for  do for  do if (M(T(t), Pos(f)) = 1 and I(f) = 0)) then I(f) = t end if end for end for Reduced array R = T(I) Define , , , and Initialize random population for  do for  do Calculate fitness Update and G solutions Update and using (9) and (10) if  for attempts Update using (11) end if Update using (5) end for Apply ATCS Algorithm 1 Apply TCR Algorithm 2 end for Return: Final solution

5. Experimental Setup

This section outlines the empirical study, including research questions, datasets, evaluation metrics and the algorithms with which the proposed algorithm is compared. The formulated research questions are: RQ1. What is the performance of the proposed algorithm for TCP? The objective is to see if the suggested algorithm outperforms others. It also identifies which algorithm produces the best results, as well as the effect of various testing settings on algorithm performance. RQ2. What is the performance of the proposed algorithm for TCS? The goal is to investigate the efficiency of the provided strategies for the ATCS method, namely, test selection percentage, inclusivity of test cases and reduction in cost percentage. RQ3. What is the performance of the proposed algorithm for TCR? The aim is to evaluate the effectiveness of the suggested algorithm to that of the other methods. Furthermore, to figure out which testing criteria improve TCR. Alternatively, to see how it impacts the coverage and fault detection capabilities of the test suite.

5.1. Experimental Design

PSO, QPSO and the latest variants of PSO, i.e., PSOGSA [5], DAPSO [6] and Adaptive PSO (AdPSO) [35], are the algorithms considered for comparison. Apart from these, the algorithm is also validated against state-of-the-art algorithms, such as GA, BAT and the recently proposed Grey Wolf Optimization (GWO) [36]. These methods were developed using MATLAB R2017 on a Dell laptop with an Intel i5 CPU, Windows 11 and 8GB of RAM. Due to their stochastic nature, the algorithms are performed 30 times. These are used on three different Java applications (jtopas, ant and jmeter) that are pulled from the software infrastructure repository (SIR) [37]. We have applied the algorithm to different versions of these programs. Table 2 provides more information.
Table 2

Subject Programs.

ProgramsVersionsKLOCClassesMethodsTest CasesType
ant780.46507524878JUnit
jmeter543.4389361397JUnit
jtopas45.450748209JUnit
The performance of the algorithms is influenced by parameter choices [38]. As a result, we carefully choose the parameters based on a comprehensive review of related works as well as a trial-and-error process for determining optimal values. Table 3 also contains the data retrieved using the Taguchi approach.
Table 3

Parameter settings of the algorithms.

AlgorithmsParameter Values
GApcr=0.8, pm=0.1, tournament selection, ordered crossover
BAro=0.001, Ao=1, fmin=0, fmax=1.5, α=0.9, γ=0.99
PSO, AdPSOc1=1.5, c2=2, wmin=0.4, wmax=0.9
QPSOθmin=0.5, θmax=1.7
IQPSOθmin=0.5, θmax=1.7, δ=5
PSOGSAc1=1.5, c2=2, wmin=0.4, wmax=0.9, α=15, G0=100, Sinemap
DAPSOs=0.2, a=0.25, c=0.6, f=0.8, e=0.8, c1=1.5, c2=2, wmin=0.4,
wmax=0.9
Common ParametersPop=100, Maxit=1000

5.2. Performance Measures

The following performance measures were used to validate the efficiency and efficacy of these algorithms:

5.2.1. Test Case Prioritization

To assess the robustness of the proposed technique, the test cases were selected using two separate testing criteria: fault and statement coverage. As a result, the commonly used fitness measurements and effectiveness measures are defined as follows: Average Percentage of Fault Detection (APFD) is a measure of how well a system detects faults. It finds a weighted average of the detected defects based on where they are in the test suite [39]. It is computed as follows: The location of the test case that detects the fault is denoted by , and the faults covered by n test cases is denoted by m. Its value lies between 0 and 100, with greater being better. The Average Percentage of Statement Coverage (APSC) is calculated in the same way as the APFD.

5.2.2. Test Case Selection and Reduction

Test selection percentage, cost reduction percentage, fault detection percentage and coverage loss percentage are commonly used efficacy measures. In addition to these, the inclusivity measure is also used for TCS as follows: Test Selection Percentage (TSP): It is a percentage selection in the size of the test suite. here indicates the test cases selected from n test cases. Inclusivity (I): The extracted test cases divided by the total test cases gives the inclusivity measure. Fault Detection Loss Percentage (FDLP): The ratio of faults not covered by minimized test suite to total faults covered by the original suite [40]: Cost Reduction Percentage (CRP): It is a percentage of the test suite’s cost that is reduced when compared to the original suite’s cost .

6. Results and Analysis

This section experimentally assesses the proposed algorithm for TCP using statement and fault coverage criteria. TCS and TCR have been studied for their effects on fault coverage loss, statement coverage loss and cost benefits. To determine the experimental results of a software, the cumulative average of all its iterations was employed. The performance metrics for each version were calculated using the average of 30 runs. For fitness metrics, boxplots and convergence curves are also shown. A one-way ANOVA test with a p-value was used to analyze the algorithms’ output statistically. If , the null hypothesis was rejected, suggesting that the algorithms’ difference was statistically significant. Further, Tukey’s simultaneous test was used to evaluate the pair-wise comparison of the methods.

6.1. Performance Analysis of TCP (RQ 1)

Table 4 shows the mean fitness and variance of performance metrics as well as their corresponding Tukey group ranks for all of the programs. The observations state that IQPSO is statistically different from all other nature-inspired algorithms, with a p-value of less than 0.05, for both statement and fault criteria except PSOGSA. Moreover, it suggests that there is no significant difference between the means of (1) PSOGSA and QPSO, (2) AdPSO and DAPSO, (3) AdPSO and GWO and (4) GA and PSO for both criteria. The convergence curves for one of the versions of the subject programs are illustrated in Figure 1. It shows that the proposed IQPSO Algorithm possesses high-quality solutions for both criteria.
Table 4

Comparisons of the algorithms for TCP over fault and statement coverages.

ProgramsAlgorithmsMean Fitness, Variance and Tukey Ranking for TCP (%)
APFDVarianceTRAPSCVarianceTR
jtopasIQPSO96.7020.879A98.5590.494A
PSOGSA95.9651.413AB98.2290.842AB
QPSO95.6211.966B97.9980.806BC
DAPSO94.0663.884C97.8410.976BCD
AdPSO93.934.576CD97.7950.817BCD
GWO93.1184.299D97.7061.895DE
GA91.9184.555E97.4631.809DE
PSO91.189.875E97.331.905EF
BAT89.9519.152F96.8634.034F
antIQPSO95.3377.283A98.1050.976A
PSOGSA94.34410.394AB97.4822.135B
QPSO93.9379.935B97.4032.241B
DAPSO93.29214.327BC97.3972.49B
AdPSO92.5315.674C97.2392.85B
GWO92.14915.204CD96.5864.991C
GA91.30417.977DE96.6574.476C
PSO90.57719.975EF96.5294.591C
BAT90.09420.42F95.9246.397D
jmeterIQPSO95.4023.498A99.2180.193A
PSOGSA94.315.603B98.9890.351AB
QPSO93.6966.492B98.9870.358AB
DAPSO92.13710.134C98.9160.359B
AdPSO92.129.617C98.8190.592BC
GWO91.9438.38C98.6250.677C
GA90.6728.894D98.3310.747D
PSO89.39610.309E98.220.703D
BAT89.14512.483E97.7481.914E
Figure 1

Convergence curves of algorithms for fault and statement coverage criteria of TCP.

It was also observed that most of the algorithms had equivalent variance in the case of statement coverage. The boxplots in Figure 2 also depict variation in algorithmic performance for fault coverage that is higher for statement coverage. This is because faults are dispersed across the entire software. In other words, most test cases cover almost the same statements. Therefore, the statement coverage boxplots are more compressed than the fault coverage boxplots. Overall, the proposed IQPSO is superior to all other algorithms in terms of variance.
Figure 2

Boxplots of algorithms for fault and statement coverages of TCP.

6.2. Performance Analysis of TCS (RQ 2)

The performance of the test case selection is evaluated using test selection percentage, inclusivity and cost reduction percentages as follows:

6.2.1. Test Selection Percentage (TSP)

The full version study revealed a random pattern, indicating that all of the algorithms behave similarly. We are unable to determine which algorithm is superior to the others. However, according to the program analysis, DAPSO produced the best TSP for two out of three programs in both coverages (see Table 5). It can be observed that IQPSO, PSOGSA, QPSO and AdPSO are better than PSO, GWO, GA and BAT for fault coverage. On the other side, GA, GWO and PSO performed better than IQPSO, PSOGSA, AdPSO, QPSO and BAT in the case of statement coverage. IQPSO performed better for ant, which includes a significant number of test cases and statements. As a result, it can be said that the improved approach may outperform the large programs. It was also observed that the selection percentage is less in the case of fault coverage than the statement coverage.
Table 5

Comparisons of the algorithms for TCS over fault and statement coverages.

Program VersionsAlgorithmsTSPInclusivityCRP
TSPAPSC TSPAPFD IAPSC IAPFD CRPAPSC CRPAPFD
jtopasIQPSO81.235 51.750 89.024 87.83417.356 48.731
PSOGSA81.56753.56788.45786.23818.98648.001
QPSO83.48551.83387.42281.03419.08448.767
DAPSO 68.960 5987.64484.387 30.265 41.83
AdPSO80.51861.585.087 92.083 19.71129.359
GWO74.03564.7582.3975.6726.12534.918
GA77.92677.86784.26385.54421.82923.966
PSO71.59365.586.67289.79226.89734.695
BAT83.36873.85881.53690.42417.45132.993
antIQPSO 85.333 59.667 80.449 79.509 14.321 31.527
PSOGSA86.46862.87979.29880.68712.68630.878
QPSO88.8167.62279.589.62110.01640.798
DAPSO87.995 55.667 79.42385.06411.378 45.799
AdPSO90.9057778.363 95.803 8.48722.966
GWO90.05772.53378.50688.8898.96127.57
GA89.91472.94477.6893.9539.05428.057
PSO91.01463.88979.75294.0387.88736.914
BAT89.67679.33378.58394.9159.25920.893
jmeterIQPSO86.48362.4 96.940 78.30512.51835.895
PSOGSA88.56763.58895.87677.36511.56834.757
QPSO91.47666.1594.82884.4636.93431.637
DAPSO 82.016 61.540 94.14983.014 15.728 36.501
AdPSO90.84371.8996.02 96.367 7.65626.219
GWO82.90374.1991.69587.44715.02523.725
GA82.36377.5191.55795.50915.25121.195
PSO84.34369.6494.41388.40414.7527.25
BAT86.22378.3793.14792.61712.89418.783

The best results are highlighted with bold.

6.2.2. Inclusivity (I)

All the algorithms are capable of incorporating over 78% and 76% test cases in statement and fault coverages. The proposed algorithm worked well for statement coverage, followed by PSOGSA, QPSO, DAPSO, AdPSO, PSO, GWO, GA and BAT. However, IQPSO and PSOGSA performed least well in the case of fault coverage and the performance-wise algorithms can be ranked as AdPSO, BAT, PSO, GA, QPSO, DAPSO, GWO, IQPSO and PSOGSA. Alternatively, the ATCS method picks a large number of test instances in the case of statement coverage than the fault coverage criteria. Table 5 also showed that the fault coverage criteria is better for inclusiveness of the test cases. The inclusivity of variable state test cases is critical since they necessitate extra care because they do not produce the same results for all versions. In other words, the ATCS method is based on the modification coverage so the fault coverage is the more appropriate choice for inclusivity of the test cases over statement coverage.

6.2.3. Cost Reduction Percentage (CRP)

TCS has witnessed a cost reduction of 6.93–30.26% and 18.78–48.73% for statement and fault coverage criteria. In the case of ant and jmeter, DAPSO delivers the best cost reduction % in most of the cases, whereas IQPSO outperformed DAPSO for statement coverage in ant and fault coverage in jtopas. In other words, DAPSO, GA, GWO and PSO performed better than the PSO variants in statement coverage, whereas IQPSO is the first runner-up for fault coverage after DAPSO (see Table 5). It was also discovered that the TSP and the CRP have an indirect link. In other words, the lower the number of tests in the suite, the higher the CRP.

6.3. Performance Analysis of TCR (RQ 3)

The performance of the test case reduction is analyzed by calculating the test selection percentage, cost reduction percentage and fault detection loss percentages as follows:

6.3.1. Test Selection Percentage (TSP)

Table 6 shows that all the methods perform almost equally well when it comes to reducing the test suite. Nonetheless, the proposed approach performed better than other nature-inspired algorithms for both coverages. Comparatively, BAT had a higher selection percentage. TSP was larger for statement coverage than fault coverage. It is because there was a lot of redundancy in statement coverage, and the faults were spread over the whole program and to balance them APSC had slightly higher TSP than APFD.
Table 6

Comparisons of the algorithms for TSR over fault and statement coverages.

Program VersionsAlgorithmsTSPFDLPCRP
TSPAPSC TSPAPFD FDLPAPSC FDLPAPFD CRPAPSC CRPAPFD
jtopasIQPSO 22.085 19.642 0.9741.707 77.911 82.373
PSOGSA22.13819.7110.9021.90977.65681.876
QPSO22.34119.7170.9052.30277.8581.253
DAPSO22.62619.742 0.000 1.37277.57681.333
AdPSO23.59323.450.974 0.000 76.4476.45
GWO22.42620.5830.9051.94977.7180.775
GA23.71821.7831.112 0.000 76.56978.67
PSO22.62621.8420.8351.06477.50579.164
BAT24.51824.6420.3990.76475.44675.894
antIQPSO 30.998 27.933 0.318 8.134 69.275 73.407
PSOGSA31.75528.2340.4126.68968.58773
QPSO31.42527.9330.4345.97567.29572.07
DAPSO31.283290.337 2.887 67.28871.014
AdPSO32.27830 0.318 3.99866.88670.209
GWO33.26729.6670.895.88865.40870.127
GA33.89127.7800.3597.98265.02873.513
PSO32.6128.3331.1214.57265.85572.17
BAT35.29130.3330.4463.69664.57470.274
jmeterIQPSO 21.767 19.000 0.000 1.387 77.132 81.248
PSOGSA2219.354 0.000 1.07676.45380.653
QPSO22.27219.94 0.000 0.75276.54179.73
DAPSO22.00320 0.000 2.33176.53578.874
AdPSO23.08821.2 0.000 0.000 75.64377.755
GWO22.83422.4 0.000 0.32176.34977.455
GA22.68421.47 0.000 0.000 76.19378.171
PSO22.04421.4 0.000 0.75276.85977.102
BAT23.7523.16 0.000 0.35774.83777.237

The best results are highlighted with bold.

6.3.2. Fault Detection Loss Percentage (FDLP)

The incorporation of ATCS helped the TCR in reducing the suite size with complete statement coverage and minimized the fault loss too. The findings reveal that the direct application of TCR gave quite a high fault loss, i.e., between 5% and 40% [40]. AdPSO outperformed the other methods for statement (0–0.318%) as well as fault coverages (0–2.887%). Table 6 shows that IQPSO had the least loss in statement coverage compared to the other algorithms, except jtopas, where DAPSO worked better. The observations also depict that the fault loss in APFD (0–8.134%) was higher compared to that in APSC (0–1.121%). The reason for this is that the faults are spread over the software. Hence, the fault coverage is lost by removing certain statement redundancy. It may be deduced that the loss of coverage and the reduction in test suite size are inversely proportionate.

6.3.3. Cost Reduction Percentage (CRP)

The experimental findings show that the cost reduction in fault coverage was more than the statement coverage, as it reduced the test suite better too. It was also observed that cost reduction was inversely proportionate to test selection percentage, i.e., the larger the decrease in test suite size, the lower the running cost. TCM costs were estimated to be roughly 60 and 40 percent lower than TCS for statement and fault coverage. Table 6 clearly shows that the CRP of IQPSO outperformed all other algorithms, followed by PSOGSA, QPSO and DAPSO. GA, PSO, GWO and AdPSO had nearly identical performances. Overall, IQPSO demonstrated superior search capabilities for solving the regression testing problem in all three subject programs.

7. Conclusions

In this paper, we have suggested an improved QPSO Algorithm for regression testing and validated it against GA, GWO, BAT and PSO and its variants, DAPSO, PSOGSA and AdPSO. The empirical results show that the proposed algorithm IQPSO has a comparatively low variance for statement and fault coverages. Further, the adaptive test selection approach was able to successfully identify 77–96% of the test cases in both fault and statement coverages. The study also revealed that the adaptive test selection percentage of fault coverage was 40–60% less than the statement coverage with high inclusivity. IQPSO performed better than all other algorithms for test case reduction and cost reduction %. The algorithms showed approximately a 7% difference in the fault detection capability loss for fault coverage over statement coverage. In the future, we will strive to reduce this fault detection loss to almost zero and validate the algorithm’s results in a variety of large-scale real-world applications. We intend to investigate alternative variants of QPSO Algorithms by modification and hybridization to improve the inclusivity and algorithm’s performance even further.
  6 in total

1.  A Novel Feature Extraction Approach Using Window Function Capturing and QPSO-SVM for Enhancing Electronic Nose Performance.

Authors:  Xiuzhen Guo; Chao Peng; Songlin Zhang; Jia Yan; Shukai Duan; Lidan Wang; Pengfei Jia; Fengchun Tian
Journal:  Sensors (Basel)       Date:  2015-06-29       Impact factor: 3.576

2.  A Quantum Hybrid PSO Combined with Fuzzy k-NN Approach to Feature Selection and Cell Classification in Cervical Cancer Detection.

Authors:  Abdullah M Iliyasu; Chastine Fatichah
Journal:  Sensors (Basel)       Date:  2017-12-19       Impact factor: 3.576

3.  AdPSO: Adaptive PSO-Based Task Scheduling Approach for Cloud Computing.

Authors:  Said Nabi; Masroor Ahmad; Muhammad Ibrahim; Habib Hamam
Journal:  Sensors (Basel)       Date:  2022-01-25       Impact factor: 3.576

4.  Enhancing Electronic Nose Performance Based on a Novel QPSO-KELM Model.

Authors:  Chao Peng; Jia Yan; Shukai Duan; Lidan Wang; Pengfei Jia; Songlin Zhang
Journal:  Sensors (Basel)       Date:  2016-04-11       Impact factor: 3.576

5.  Feature Extraction of Electronic Nose Signals Using QPSO-Based Multiple KFDA Signal Processing.

Authors:  Tailai Wen; Jia Yan; Daoyu Huang; Kun Lu; Changjian Deng; Tanyue Zeng; Song Yu; Zhiyi He
Journal:  Sensors (Basel)       Date:  2018-01-29       Impact factor: 3.576

Review 6.  Fault Handling in Industry 4.0: Definition, Process and Applications.

Authors:  Heiko Webert; Tamara Döß; Lukas Kaupp; Stephan Simons
Journal:  Sensors (Basel)       Date:  2022-03-12       Impact factor: 3.576

  6 in total

北京卡尤迪生物科技股份有限公司 © 2022-2023.