1. Introduction
A software reliability prediction model can be used to predict the failure time and defects of software and plays an important role in the evaluation of software quality. The purpose of software reliability prediction is to discover the faults and their distribution during software testing. By understanding these faults, the software in the actual operation of the fault state and hidden faults can be predicted.
The non-homogeneous Poisson process model is a simple discrete stochastic process with a time-continuous state. It is a common model to describe software reliability, and the Goel-Okumoto model (G-O) is a classic software reliability growth model derived from it [
1,
2]. The G-O model simplifies SRGM parameters, and it has become a commonly used model in the testing process [
3].
The maximum likelihood method and least square method are two of the most common method of parameter estimation, but both are related to probability theory and mathematical statistics characteristics, and this is likely to have broken the constraint condition of software reliability model parameters are estimated. Furthermore, if you encounter more complex model or the failure of large-scale data, neither of these two methods can find the optimal parameter estimator. If the traditional numerical calculation method is adopted, it often faces problems such as non-convergence or over-reliance on initial value in the iterative process. Therefore, it is particularly important to find a better and more effective method of reliability model parameter estimation. In addition to the two-parameter estimation methods above, a new idea is to apply swarm intelligence algorithm to model parameter estimation.
Swarm intelligence optimization is a new heuristic computing method based on the observation and inspiration of the behavior of aggregative organisms. Based on these swarm intelligence optimizations, new [
4,
5,
6] and hybrid algorithms [
7,
8] are proposed to obtain better solutions.
The Beetle Antennae Search Algorithm (BAS) is an intelligent optimization algorithm proposed by Jiang et al. [
9] in 2017 which simulates the search mode of a foraging beetle. The algorithm is easy to implement and has fewer control parameters and a faster speed. In addition, the algorithm does not need to know the specific form of the optimization objective, nor does it need gradient information to achieve efficient optimization. Compared with the particle swarm optimization algorithm, BAS only needs one longhorn, which greatly reduces the amount of computation. Yu et al. [
10] fused Particle Swarm Optimization (PSO) with BAS, improved the step size and inertia weight adjustment strategy, and proposed an Improved Antennae Beetle Search (IBAS), which can better solve the global optimal solution and is not easy to fall into the local optimal solution. Jia et al. [
11] combined BAS with the Artificial Fish-Swarm Algorithm (AFSA) to transform a single individual into a longhorn whisker group, and combined BAS with the clustering behavior, tail-chasing behavior and random behavior of artificial fish. It could quickly obtain the global optimal value.
The Artificial Bee Colony Algorithm (ABC) is a global optimization algorithm based on swarm intelligence proposed by the Karaboga group in 2005. Its intuitive background is derived from honey-seeking and honey-gathering behaviors of bees. Its advantages are that it uses fewer control parameters and has strong robustness. In each iteration process, global and local optimal solutions will be searched, so the probability of finding the optimal solution is greatly increased. In order to avoid the artificial bee colony algorithm from falling into local optimum, Sun [
12] et al. needed to improve its development ability. By referring to the evolutionary mechanism of genetic algorithm, they established a genetic model to carry out genetic operations on the nectar source after adopting the optimal reservation, so as to enrich the diversity of the nectar source. Dai [
13] et al. updated the nectar source by introducing an optimal difference matrix, determined the update dimension by means of multidimensional search and the greedy selection and initialized the population by Tent chaotic sequence, which not only improved the convergence speed but also ensured a high probability of optimization. Yu [
14] et al. proposed an improved discrete artificial bee colony algorithm, namely the evolutionary bee colony algorithm, which discriminates excellent information according to fitness value and historical evolution degree and integrates crossover operator and mutation operator to continuously evolve nectar source, thus fully excavating the value of bee colony and effectively improving iteration efficiency.
In this paper, the BAS-ABC algorithm is used to find the optimal position of the parameter in the software reliability model, and the time of failures is calculated according to the parameter. The algorithm improvement and hybrid method mentioned above have achieved good results to some extent, but the convergence speed needs to be improved. This paper presents a hybrid algorithm of beetle antennae search algorithm and artificial bee colony algorithm (BAS-ABC). The algorithm first uses BAS to get the optimal adaptive value and location, then sets the nectar source location in ABC as the optimal location of each longhorn, and then ABC.
Compared with PSO and other swarm intelligence algorithms, the BAS algorithm requires only one individual, greatly reduces the amount of computation, is easy to implement, and has faster convergence speed and higher convergence quality. Because the BAS algorithm is more effective than the PSO algorithm, it can approach the optimal solution better and faster by dynamically adjusting the search strategy of step size meanwhile keeping randomness, so it has better convergence.
Because of the strong randomness of PSO, the stability of the algorithm is not enough. Because the randomness of the BAS algorithm in the search process is determined by the changes of left and right whiskers, it is generally stable to approach the optimal solution, thus showing better stability.
Section 2 introduces the relevant basic theories: software reliability and its model, the basic principles of BAS and ABC and the implementation of hybrid algorithm. In
Section 3, simulation experiments are performed on the dataset. The parameters of the GO model are predicted and the results are analyzed through five groups of classical software failures. The adaptive function [
3] used in this paper is compared with the traditional adaptive function, and the results of different algorithms are compared to testify to the feasibility and effectiveness of the BAS-ABC algorithm, which can effectively avoid the problems of slow algorithm convergence and low initial range accuracy. Finally,
Section 4 is discussed and
Section 5 is a conclusion.
2. Materials and Methods
2.1. Software Reliability and Model
Software reliability is the probability that a software product can complete a specified function without causing system failure under specified conditions and in a specified time.
Software reliability prediction is mainly achieved through modeling. Software reliability modeling can be used to quantitatively analyze the behavior of software and help develop more reliable software. In this paper, the G-O model of the software reliability model is selected and its parameters are estimated. The estimation function of the GO model for cumulative failures of software systems is as follows:
where
is an expected function of failures that will occur at time
;
is the total number of expected software failures when the software testing is done;
represents the probability that the undiscovered software failures will be discovered, and
. It can be seen that the parameters of the GO model are
and
, and their selection will affect the accuracy of the model prediction.
2.2. Beetle Antennae Search Algorithm
BAS is an algorithm inspired by the principle of longhorn foraging. Beetles do not know the location of food when foraging, but can only forage according to the strength of the food smell. A beetle has two feelers. If the smell on the left side is stronger than on the right side, the beetle flies to the left, otherwise it flies to the right. The smell of food acts as a function that has a different value at each point in the space. The two whiskers of the beetle can collect the smell value of two points nearby. The purpose of the longicorn beetle is to find the point with the maximum global smell value. Mimicking the behavior of longicorn, we can efficiently conduct function optimization.
For an optimization problem in n-dimensional space, we use
to represent the left whisker coordinate,
to represent the right whisker coordinate,
to represent the centroid coordinate, and
to represent the distance between two whiskers. The ratio of step to distance
between two whiskers is a fixed constant:
where
is a constant, that is, the big beetle with a long distance between the two whiskers takes a big step, and the small beetle with a short distance between the two whiskers takes a small step. Assuming that the orientation of the longicorn’s head is random after flying to the next step, the orientation of the vector from the right whisker to the left whisker of the longicorn’s whisker is also arbitrary. Therefore, it can be expressed as a random vector:
Obviously,
and
can also be expressed as centers of mass:
For the function ff to be optimized, calculate the odor intensity values of the left and right whiskers:
If
, in order to explore the minimum value of
, the beetle moves the distance step in the direction of the left whisker:
If
, in order to explore the minimum value of
, the beetle moves the distance step in the direction of the right whisker:
The above two cases can be written as a sign function:
where
is the normalized function.
2.3. Artificial Bee Colony Algorithm
ABC uses fewer control parameters and has strong robustness. In addition, in each iteration process, global and local optimal solutions are searched, so the probability of finding the optimal solution is greatly increased. It is assumed that the solution space of the problem is
dimension, the number of bees gathering and observing is
, and the number of bees gathering or observing is equal to the number of nectar sources. The location of each nectar source represents a possible solution to the problem, and the nectar quantity of the nectar source corresponds to the fitness of the corresponding solution. A bee gatherer corresponds to a nectar source. The bees corresponding to the ith nectar source search for a new nectar source according to the following formula:
where
,
,
is a random number in
. Then, ABC compares the newly generated possible solution with the original one:
The greedy selection strategy is adopted to retain a better solution. Each observing bee selects a nectar source according to probability, and the probability formula is:
where
is the adaptive value of the possible solution
.
For the selected nectar source, the observer bees searched for new possible solutions according to the above probability formula. When all the foragers and observers searched the entire search space if the fitness of a nectar source was not improved within a given step, the nectar source was discarded, and the foragers corresponding to the nectar source became scouts, which searched for new possible solutions by the following formula. Among them,
where
is a random number in
,
and
are the lower and upper bounds of the d-dimension. Repeat the operation to reach the maximum number of iterations.
2.4. Construction of Fitness Function
Using an intelligent optimization algorithm to solve the parameter estimation problem of the software reliability model, the most important thing is to construct the adaptive function and take it as the optimization goal of the algorithm. According to the characteristics of the software reliability model, the adaptive value function is constructed according to the principle of the least square method as follows:
where
represents the distance between the measured value of the number of software faults and the real value. The smaller the distance, the better the estimation and prediction.
and
represent the cumulative number and the estimated number of failures found from the start of software testing to time
.
is the moment when the
i-th failure occurs.
.
represents the total number of failures that occurred at the end of the test [
3].
This paper cites the fitness function constructed by the literature [
3], the formula is:
On this basis, the BAS-ABC hybrid algorithm proposed in this paper is used for iterative search. When the end condition is satisfied, is used as the fitness function to optimize the algorithm. The optimal search results of parameter are obtained to predict software defects.
2.5. Implementation of BAS-ABC
In BAS, the longicorn beetle can select the side with a strong smell as the next moving direction by comparing the smell intensity received by the left and right antennae. Since food source search is more directional, the algorithm is able to converge faster. In the conventional ABC algorithm, when hired bees search for new food sources, they randomly select food sources from existing food sources, which will reduce the convergence speed of the algorithm. In order to solve the problem of random evolution direction and slow convergence, BAS is introduced to improve ABC, and the optimal location obtained by BAS is taken as the location of the food source so that the evolution is carried out in a specific direction.
The optimization function f proposed in reference [
1] has only one optimal value in the search interval. To speed up the algorithm convergence, this section proposes an algorithm combining BAS and ABC, namely BAS-ABC. The algorithm takes the optimal location as the location of a food source in ABC after obtaining the optimal adaptive value and the optimal location from BAS operation, and the running times of BAS are equal to the number of ABC food sources. The algorithm flow is shown in
Figure 1:
Input:
- ✧
The total quantities of software failures n-10 and the occurrence time of each failure;
- ✧
The initial parameters of the BAS-ABC algorithm.
Output:
- ✧
The optimal position and the optimal fitness value are obtained by the BAS-ABC algorithm, and the optimal position is the estimated value of parameter b;
- ✧
The time of the next ten failures is predicted according to parameter b, and then the difference between the predicted value and the actual value and the root mean square error are calculated, which are represented by error_1 and RMSE, respectively.
- (1)
Set the maximum times of BAS algorithm , the running times , and the optimal position array .
- (2)
Determine whether the maximum number of runs reaches runtime, that is, determine whether is satisfied. If not, go to Step (3); otherwise, go to Step (10).
- (3)
Initialize parameters of BAS algorithm, the step length of beetle: , the maximum number of iterations: , the ratio between step and , the coefficient of variable step size: , the number of iterations .
- (4)
Determine whether the termination condition is met, that is or . If so, go to Step (8); otherwise, go to Step (5).
- (5)
Set the orientation of longicorn beetles.
- (6)
Update the coordinate of whiskers, the smell intensity of whiskers, and the next position of the longicorn.
- (7)
Iterations +1: , go to Step (4).
- (8)
Save the optimal position in the array .
- (9)
Run times +1: , go to Step (2).
- (10)
After the BAS algorithm runs, the optimal location array is obtained, and the food source of the ABC algorithm .
- (11)
Initialize the parameters of the ABC algorithm, the size of a bee colony: , the maximum number of iterations: , the number of food: , the maximum number of searches for a nectar source: , the upper and lower limits of parameters: , the number of iterations .
- (12)
Determine whether the termination conditions are met. If the termination conditions are met , go to Step (18); otherwise, go to Step (13).
- (13)
Honeybees generate new solutions, calculate adaptations, and select food sources based on greedy strategies.
- (14)
Calculate the probability of selecting nectar source .
- (15)
Observed bees select nectar source according to probability generate a new nectar source near the nectar source, calculate the adaptation value, and selected the nectar source according to the greedy strategy.
- (16)
Determine whether there is a nectar source to be abandoned. If there is, a nectar source will be randomly generated to replace it.
- (17)
Iterations +1: , go to Step (12).
- (18)
After the ABC algorithm runs, the optimal position is obtained, which is the desired parameter b.
In order to show the steps of the hybrid algorithm more clearly, the algorithm architecture is expressed in interpretable code as
Figure 2:
As shown in the interpretable code, the time complexity of BAS-ABC is , where represents the running times of the BAS algorithm, that is, the number of honey sources in the ABC algorithm. and represents the maximum number of iterations in the BAS and ABC algorithms. Therefore, according to the calculation principle of algorithm time complexity, the time complexity of BAS-ABC is .
4. Discussion
In
Section 3, the three algorithms are compared and analyzed in part A on the basis of using the control function. In
Section 3.1.1, an intuitive comparison is made between the failed curves and the model results of different algorithms, and the result shows that the estimation and prediction of the model by the hybrid algorithm are closest to the actual results.
Section 3.1.2 Carries out statistical analysis on the optimal value, the worst value and the average value of the algorithm running 20 times, and finds that the accuracy of the hybrid algorithm is higher than that of the single algorithm. In
Section 3.1.3 and
Section 3.1.4, the convergence speed and stability of the hybrid algorithm are better than that of the single algorithm. In part B, the BAS-ABC hybrid algorithm proposed in this paper is compared with the PSO-SSA hybrid algorithm proposed in [
3]. In
Section 3.2.1, the actual failure curve is compared with the fitted curve of the two-hybrid algorithms, and it is found that the BAS-ABC is closer to the actual situation. In
Section 3.2.2, the two-hybrid algorithms are run twenty times, respectively, and the optimal value, worst value and average value are statistically analyzed, and it is found that the accuracy rate of the BAS-ABC is higher than that of the PSO-SSA hybrid algorithm. In
Section 3.2.3 and
Section 3.2.4, the convergence speed and stability of the BAS-ABC are better than the PSO-SSA.
The algorithm is required to be able to quickly converge, the faster the better, and to improve the convergence speed that can be from two aspects including the initialization of the algorithm and the search process. The setting of the initial parameter value plays an important influence on the convergence of the algorithm, and a good initial parameter value can accelerate the convergence speed of the algorithm. As a result, using the BAS algorithm to get the optimal estimate of parameter , and then using the ABC algorithm to start searching around it can speed up the convergence of the algorithm and improve the stability and accuracy of the results. The optimal value obtained by the BAS algorithm can avoid the randomness of honey source generation and realize the optimization of the search process of the artificial bee colony algorithm.
In fact, adding the BAS algorithm before the ABC algorithm can be regarded as optimizing the initial value of the ABC algorithm. All in all, the improved method of the algorithm convergence speed in this paper is to control the initialization of parameters in a better range, so as to ensure a smooth solution process.
5. Conclusions
In this paper, a hybrid algorithm based on BAS and ABC is proposed to estimate and predict the failure data of the G-O model by using a swarm intelligence algorithm.
According to the above experimental results, it can be found that the BAS-ABC algorithm proposed in this paper can predict parameters of the software reliability model more accurately and improve the prediction accuracy of software failure time. Compared with single BAS and ABC algorithms, the BAS-ABC algorithm can converge faster and its stability is greatly improved, which enables the algorithm to converge to the optimal value quickly, and the results obtained are more stable. In addition, comparing the BAS and ABC hybrid algorithm proposed in this paper with the PSO and SSA hybrid algorithm proposed in the literature [
3], it can be found that the BAS-ABC hybrid algorithm has a faster convergence rate, and the obtained results have higher stability and accuracy. Furthermore, the hybrid BAS and ABC are faster in running time than the single ABC and BAS.
This paper selects the classic G-O model to estimate and predict. If the parameters of other software reliability models can be treated in the same way, the BAS-ABC hybrid algorithm proposed in this paper can achieve the same performance. In future research, a variety of models can be used for research, and the convergence of the algorithm can be judged in advance. When the algorithm is no longer convergent, the iterative search can be jumped out to improve the efficiency of the algorithm.