28 - Regression Test Case Optimization Using Honey Bee Mating Optimization Algorithm With Fuzzy Rule Base
28 - Regression Test Case Optimization Using Honey Bee Mating Optimization Algorithm With Fuzzy Rule Base
net/publication/336133351
CITATIONS READS
3 98
2 authors:
Some of the authors of this publication are also working on these related projects:
All content following this page was uploaded by Deepak Rai on 30 September 2019.
Submitted: Oct 9, 2013; Accepted: Feb 27, 2014; Published: Mar 12, 2014
Abstract: Maintenance of the software is concerned with the changes and modifications implemented to the
software. It needs to be validated that the modifications has not led to the degradation in the quality of the
software. Software regression testing is required to instill confidence that changes are valid. Regression testing
is very expensive. It requires the optimization of regression test cases. Recently, evolutionary and meta-
heuristic algorithms are coming into existence as search and optimization tools. This paper proposes a
regression test case optimization technique based on honey bee mating optimization and fuzzy rule base, which
reduces the size of the test suite by selecting the test cases from the existing test suite. The test cases which
are necessary for validating the recent changes in the software and have the ability to find the faults and cover
maximum coding under testing in minimum time are selected. An algorithm is designed which takes as input
the test suite containing several test cases and based on their execution time and fault coverage, reduces the
number of test cases. The test suite is reduced by 50% which optimizes the overall regression testing process.
The proposed algorithm reduces the test suite data by approximately 50%. Although the percentage reduction
is found little bit low in comparison to existing algorithm but the overall algorithm is found efficient as it
provides an authentic way of selecting test cases using fuzzy rule base.
Key words: Software testing Regression testing Test cases Honey bee mating Fuzzy logic Inference
system Optimization.
Corresponding Author: Deepak Rai, M. Tech Computer Science and Engg, Ajay Kumar Garg Engineering College,
Ghaziabad, UP, India.
654
World Appl. Sci. J., 31 (4): 654-662, 2014
655
World Appl. Sci. J., 31 (4): 654-662, 2014
information among themselves, the honey bee focus on very high. Both the system have different sets of rules,
more-promising areas and discard the solutions from less based on which they provide the outcomes. FIS1 provides
promising areas. the selection priority as very low, low, medium, high and
In this there is a single egg-laying long-lived queen, very high, whereas FIS2 provides the priority of the final
several thousands of drones responsible for mating with solution as low, medium, high and very high. The detailed
queen and 10 to 60 thousands of workers responsible for description is there in the implementation section.
local search and newly born broods care [8]. Queen is
specialized in egg-laying, she mate with different drones Background Study: Over the last one or two decades, the
during the mating flight far from the nest [9]. Queen mates emerging area for research of SI is, modeling the behavior
multiple times, but the drones only once. This makes the of social insects for searching and optimization problems.
bee mating the most spectacular mating among insects. Colonies of various social insects are characterized by
After mating, the queen bee returns to hive and starts swarm behavior. Studies are primarily based on the
breeding. The worker bees are chosen proportional to collective decision, pheromone laying, reproduction,
their fitness in order to improve the generated broods. mating, marriage, foraging behavior of the swarms. Most
The best brood is selected and the queen is replaced with closely studied social insects are bees. Mating behavior
the selected brood. Remaining broods are killed and a new of the bees is considered as one of the swarm based
mating flight begins until the stopping condition is approach for optimization.
reached or all mating flights are completed. Researches using honey bees started in late 90’s.
Honey bee behavior was used in the year 1996 by Y.
HBMO and Fuzzy Logic: In most of the models it is Yonezawas for giving an ecological algorithm for optimal
assumed that the problem data are deterministic ordering [13]. In the very next year in 1997, T. Sato and M.
quantities. But, here in this paper the choice of modeling Hagiwara had given a bee system for finding solution by
HBMO with fuzzy logic started from the assumption that a concentrated search [14]. Later, in 2001 H.A. Abbas
the perceptions of bees are “fuzzy”. In HBMO the used marriage in honey bee optimization approach and
selection of the queen bee and the best brood is uncertain proposed MBO algorithm [15]. Researches using honey
and not defined clearly. Hence, in order to improve this bees algorithms continued for different purposes like,
uncertainty we combine HBMO with fuzzy logic [10]. In fault-tolerant routing algorithms [16], dynamic transport
this, the bees use approximate reasoning and fuzzy rules planning [17], cluster analysis [18], numerical function
for their action and communication. During the selection optimization [19], for training feed forward neural network
of queen bee and the best brood the bees perceives the [20], scheduling problems in codesign [21], optimization
selection priority of other bees as ‘very low’, ‘low’, of fuzzy logic controller [22], resource allocation [23, 24],
‘medium’, ‘high’ and ‘very high’. Based on the values of optimization of neural network for identification of wood
number of faults covered and execution time the selection defects [25]. HBMO algorithm was first used by A. Afshar
priority of each bee is calculated with the designed FIS. et.al in 2007 [26]. This was applied to a single reservoir
optimization problem. Later, the same algorithm was
Fuzzy Inference System (FIS): It is a system that uses the applied to three benchmark mathematic problem by Bozor
theory of fuzzy set in order to map the inputs to outputs. Hadded et.al [27]. Recently, honey bee algorithms have
There are two FIS namely mamdani and sugeno [11]. found their utility in many fields of software engineering.
In this paper we have used mamdani style of inferencing. In the year 2011, Kilic et.al had proposed an approach
Here we have designed two inference systems namely using honey bees for automated software refactoring
FIS1 and FIS2. FIS1 gives the selection priority of the test problem [28]. Soimart et.al had applied bee algorithm for
cases [12]. FIS2 gives the priority of the subset of test the development of an automated MLD programming tool
cases in the final list. FIS1 take faults covered and [29]. Li and Ma had proposed honey bees based solution
remaining execution time (difference of given time method for logic reasoning [30].
constraint and execution time), as input. Whereas, FIS2 Research on regression testing spans a wide variety
takes one more parameter, number of test cases as its of topics. Recently, the optimization of size-constrained
input. FIS1 categorizes faults covered and remaining regression testing was taken up by Siavash Mirarab et.al
execution time as very low, low, medium, high and very in 2012 [31]. A safe regression testing based on the
high. FIS2 categorizes faults covered, remaining execution program dependence graph was given by Jianchum Xing
time and number of test cases as low, medium, high and et.al in the same year [32]. Honey bee algorithms have
656
World Appl. Sci. J., 31 (4): 654-662, 2014
also been used for the purpose of optimizing the software NF_Drone = Number_of_faults_covered by Drone_bee
test cases and the overall testing process. Mala et al had NF_Brood = Number_of_faults_covered by Brood_bee
applied bee algorithm for the purpose of software test FC_Queen = Faults_Covered by Queen_bee
suite optimization in 2010 [33]. In the very next year Adi FC_Drone = Faults_Covered by Drone_bee
Srikanth et.al had introduced a software test case FC_Brood = Faults_Covered by Brood_bee
optimization method using honey bees [34]. ET_Queen = Execution_time of Queen_bee
Researches for the purpose of regression testing ET_Drone = Execution_time of Drone_bee
using fuzzy logic are very scant. It started in the year 2005 ET_Brood = Execution_time of Brood_bee
when Xu, Gao et.al had firstly shown the application of RET_Brood = Remaining Execution_time of Brood_bee
fuzzy for regression testing [35]. Recently in 2012 and
2013 Ali M. Alakeel and H.B. Gupta proposed a technique Begin Main:
for the regression testing using fuzzy logic respectively Begin For:
[36] [37]. For( i=0; i<NT; i++)
RET_Ti = TC - ET_Ti
Proposed Algorithm: In this paper we have combined the P_Ti = FIS1 ( NF_Ti, RET_Ti )
fuzzy rule base with HBMO algorithm for the purpose of
regression test case optimization. In order to optimize the End for:
regression test cases the proposed technique selects the Each Test Case Is Assigned to Each Bee.
subset of test cases from the available test suite that Begin For:
covers all the faults in minimum execution time.
For( i=0; i<NT; i++ )
Input: < NT, NF, TC, S, Available, r = 0, c = 0 >
Queen = Best bee based on the priority.
Drones = Available - Queen
Where,
NT = Number_of_Test_case
Begin for:
NF = Number_of_faults
For( j=0; j<n; j++)
S = Test_suite = {Ti, FC_Ti, NF_Ti, ET_T ,i
FC_Brood[j] = FC_Queen || FC_Drone[j]
RET_Ti}; 1 <= i <= NT
NF_Brood[j] = Number of 1’s in FC_Brood[j]
TC = Time_Constraint
ET_Brood[j] = ET_Queen + ET_Drone[j]
Ti = ith Test_case; 1 <= i <= NT
RET_Brood[j] = TC - ET_Brood[j]
FC_Ti = Faults_covered by ith Test_case
NF_Ti = Number_of_faults_covered by ith
Test_case Begin if:
ET_Ti = Execution_time of ith Test_case if( NF_Brood[j] == NF &andET_Brood[j] <= TC )
RET_Ti = Remaining Execution_time of ith Test- then List[r][c] = Brood[j]
_case. c=c+1
Available = <T1, T2, T3,.......TNT> P_Brood[j] = FIS2(NF_Brood[j], RET_Brood[j])
List[r][c] = P_Brood[j]
Other Terms Used: r = r + 1, c = 0
Queen = Queen_bee
Drone = Drone_bee End if:
Brood = Brood_bee P_Brood[j] = FIS1 (NF_Brood[j], RET_Brood[j])
FIS = Fuzzy_Inference_System
P_Ti = Priority of ith Test_case End for:
List = Subset of Test_cases with all faults 6) Select Best Brood based on Priority
covered within TC 7) Begin if:
List_Final = List in order of decreasing priority.
n = |Available|= Number_of_Test_case in if (P_Selected_brood[j] > P_Queen)
Available then Queen = Selected_brood[j];
NF_Queen = Number_of_faults_covered by Drones = Drones - Queen;
Queen_bee Repeat from Step 5;
657
World Appl. Sci. J., 31 (4): 654-662, 2014
Here, we are using binary representation for Mating flight begin with queen (T4). The queen will mate
representing the faults covered by the particular test case. with all the drones one by one and breed respectively in
1 at an index means that the test case detects the fault at the hive. The process of mating is as follows:
that index and 0 for vice-versa. Like, if test case T1 covers
faults F1, F4, F7 and F9. Then we will represent it as FC_Queen = 0 0 0 1 0 1 0 1 1 0
1001001010 from left to right. NF_Queen = 4
ET_Queen = 5
Let, set S = {Ti, <FC_Ti>, NF_Ti, ET_Ti, RET_Ti} FC_Drone [1] = FC_T1 = 1 0 1 0 0 1 0 0 1 0
NF_Drone [1] = NF_T1 = 4
Number of Remaining
Test Faults Faults Execution Execution ET_Drone [1] = ET_T1 = 7
Cases Covered Covered Time Time
T1 1010010010 4 7 15 After mating, the brood generated is brood [1].
T2 0100000100 2 3 19
T3 0100101000 3 5 17
T4 0001010110 4 5 17 FC_Brood [1] = FC_Queen || FC_Drone [1] = 0001010110
T5 1000010001 3 3 19
T6 0001100100 3 6 16
|| 1010010010 = 1 0 1 1 0 1 0 1 1 0
T7 1000001100 3 3 19 NF_Brood [1] = Number of 1’s in FC_Brood [1] = 6
T8 0100000001 2 2 20 ET_Brood [1] = ET_Queen + ET_Drone [1] = 5 + 7 = 12
RET_Brood [1] = TC - ET_Brood [1] = 22 - 12 = 10
Available = < T1, T2, T3, T4, T5, T6, T7, T8 > P_Brood [1] = FIS1 (µNF_Brood [1], µRET_Brood [1]) = FIS1 (0.6,
0.4545) = 0.5023
The selection priority of each test case is calculated
by using the fuzzy inference system (FIS 1). The Similarly all the broods are generated as shown in table.
Brood Test FC_Brood NF_Brood ET_Brood RET_Brood P_Brood
membership values for faults covered and remaining [i] Cases [i] [i] [i] [i] [i]
execution time corresponding to each test case is I=1 T4, T1 1 0 1 1 0 1 0 1 1 0 6 12 10 0.5023
2 T4, T2 0 1 0 1 0 1 0 1 1 0 5 8 14 0.5751
calculated. As, 3 T4, T3 0 1 0 1 1 1 1 1 1 0 7 10 12 0.7168
For, test case T1 4 T4, T5 1 0 0 1 0 1 0 1 1 1 6 8 14 0.5751
5 T4, T6 0 0 0 1 1 1 0 1 1 0 5 11 11 0.5033
µfaults_covered (T1) = NF_T1 / NF = 4 / 10 = 0.4 6 T4, T7 1 0 0 1 0 1 1 1 1 0 6 8 14 0.5751
µremaining execution_time (T1) = RET_T1 / TC = 15 / 22 = 0.682 7 T4, T8 0 1 0 1 0 1 0 1 1 1 6 7 15 0.6575
658
World Appl. Sci. J., 31 (4): 654-662, 2014
As, the selection priority of none of the brood is As, the selection priority of brood [2] is better than
better than the queen. So all the broods are killed and the the queen. So the queen is replaced and all the remaining
process continues with the selection of next queen from broods are killed. The process continues with the new
the previous stage. queen.
Next best Queen is: Drones = Drones - Queen = < T2, T4, T5, T7, T8 >
Queen = T1 FC_Queen NF_Queen ET_Queen RET_Queen P_Queen
1010010010 4 7 15 0.6545 Drones = T2 T4 T5 T7 T8
Drones = Again the mating flight begins with queen (T1, T6, T3).
Available - Queen = < T2, T3, T4, T5, T6, T7, T8> The queen mates with all the drones one by one and
breed respectively in the hive to generate broods
Drones = T2 T3 T4 T5 T6 T7 T8
Brood Test FC_Brood NF_Brood ET_Brood RET_Brood P_Brood
[i] Cases [i] [i] [i] [i] [i]
Again the mating flight begins with queen (T1). The I=1
2
T1, T6, T3, T2
T1, T6, T3, T4
1111111110
1111111110
9
9
21
23
1
-1
0.8762
-----
queen mates with all the drones one by one and breed 3 T1, T6, T3,T5 1111111111 10 21 1 0.5000
4 T1, T6, T3, T7 1111111110 9 21 1 0.8762
respectively in the hive to generate broods. 5 T1, T6, T3, T8 1111111111 10 20 2 0.5000
659
World Appl. Sci. J., 31 (4): 654-662, 2014
660
World Appl. Sci. J., 31 (4): 654-662, 2014
16. Wedde, H.F., M. Farooq and Y. Zhang, 2004. 26. Afshar, A., O. Bozorg Haddada, M.A. Marin and B.J.
BeeHive: An efficient fault-tolerant routing algorithm Adams, 2007. Honey-bee mating optimization
inspired by honey bee behavior. In Ant Colony (HBMO) algorithm for optimal reservoir operation. J.
Optimization and Swarm Intelligence. LNCS 3172, Frank. Instit. 344: 452-462.
Springer-Verlag, Berlin, pp: 83-94. 27. Bozorg Haddad, O., A. Afshar and M.A. Mariño,
17. Wedde, H.F., S. Lehnhoff, B. Van Bonn, Z. Bay, S. 2005. Honey bees mating optimization algorithm
Becker, S. Bottcher, C. Brunner, A. Buscher, T. (HBMO); a new heuristic approach for engineering
Furst, M. Lazarescu, Rotaru, E. Senge, B. optimization, in: Proceeding of the First International
Steinbach, F. Yilmaz and T. Zimmermann, 2007. A Conference on Modeling, Simulation and Applied
Novel Class of Multi-Agent Algorithms for Highly Optimization (ICMSA0/05), Sharjah, UAE, pp: 1-3.
Dynamic Transport Planning Inspired by Honey Bee 28. Kilic, H., E. Koc and I. Cereci, 2011. Search-based
Behaviour. In Proceedings of the 12th IEEE parallel refactoring using population-based direct
International Conference on Factory Automation, approaches. In: Cohen M, Cinnide M (eds) Search
Patras, Greece, pp: 1157-1164. based software engineering. Lecture notes in
18. Fathian, M., B. Amiri and B. Maroosi, 2008. computer science, vol 6956. Springer, Berlin,
A honeybee-mating approach for cluster analysis. pp: 271-272.
Int. J. Adv. Manuf. Technol., 38: 809-821. 29. Soimart, P. and P. Pongcharoen, 2011. Multi-row
19. Karaboga, D. and B. Basturk, 2007. A powerful and machine layout design using aritificial bee colony. In:
efficient algorithm for numerical function 2011 International Conference on Economics and
optimization: artificial bee colony (ABC) algorithm. J. Business Information, 9: 103-108.
30. Li, L.F. and M. Ma, 2011. Artificial bee colony
Global. Optim. 39: 459-471.
algorithm based solution method for logic
20. Karaboga, D., B. Basturk Akay and C. Ozturk, 2007.
reasoning. Comput Technol Dev doi:CNKI: SUN:
Artificial Bee Colony (ABC) Optimization Algorithm
WJFZ.0. pp: 06-035.
for Training Feed-Forward Neural Networks. In:
31. Mirarab, Siavash, Soroush Akhlaghi and Ladan
LNCS: Modeling Decisions for Artificial Intelligence,
Tahvildari, 2012. "Size-Constrained Regression
Springer-Verlag, Berlin Heidelberg, pp: 318-319.
Test Case Selection Using Multicriteria
21. Koudil, M., K. Benatchba and Tarabetand A. El-
Optimization." Software Engineering, IEEE
Batoul Sahraoui, 2007. Using artificial bees to solve
Transactions on 38(4): 936-956.
partitioning and scheduling problems in codesign.
32. Xing, Jianchun, et al., 2012. "Safe Regression Test
Appl. Math. Comput., 186: 1710-1722.
Selection Based on Program Dependence
22. Pham, D.T., A. Haj Darwish and E.E. Eldukhr, 2009.
Graphs." Computer Software and Applications
Optimization of a fuzzy logic controller using
Conference Workshops (COMPSACW), 2012 IEEE
the Bees Algoithm. Int. J. Comp. Aid. Eng. Tech., 36th Annual. IEEE.
pp: 1250-1264. 33. Mala, D.J., V. Mohan and M. Kamalapriya, 2010.
23. Quijano, N. and K.M. Passino, 2007. Honey Bee Automated software test optimisation framework-an
Social Foraging Algorithms for Resource Allocation, artificial bee colony optimisation-based approach.
Part I: Algorithm and Theory. In Proceedings of the IET Softw, 4(5): 334-348.
2007 American Control Conference, New York, 34. AdiSrikanth, N.J. Kulkarni, K.V. Naveen, P. Singh and
pp: 3383-3388. P.R. Srivastava, 2011. Test case optimization using
24. Quijano, N. and K.M. Passino, 2007. Honey Bee artificial bee colony algorithm. In: Abraham A, Mauri
Social Foraging Algorithms for Resource JL, Buford JF, Suzuki J, Thampi SM (eds) Advances
Allocation, Part II: Application. In Proceedings of the in computing and communications, communications
2007 American Control Conference, New York in computer and information science, vol. 192.
pp: 3389-3394. Springer, Berlin, pp: 570-579.
25. Pham ,DT., A.J. Soroka, A. Ghanbarzadeh and E. Koc, 35. Xu, Z., K. Gao and Taghi M. Khoshgoftaar, 2005.
2006. Optimizing Neural Networks for Identification “Application of Fuzzy Expert System In Test Case
of Wood Defects Using the Bees Algorithm. In Selection For System Regression Test”, Information
Proceedings of the IEEE International Conference on Reuse and Integration, Conf, 2005. IRI -2005 IEEE
Industrial Informatics, Singapore, pp: 1346-1351. International Conference on, pp: 120-125.
661
World Appl. Sci. J., 31 (4): 654-662, 2014
36. Alakeel, Ali, 2012. "A Fuzzy Test Cases Prioritization 37. Bhasin, H., S. Gupta and M. Kathuria, 2013.
Technique for Regression Testing Programs with “Regression Testing Using Fuzzy Logic”,
Assertions." In ADVCOMP 2012, The Sixth International Journal of Computer Science and
International Conference on Advanced Information Technologies (IJCSIT), 4 (2): 378-380.
Engineering Computing and Applications in
Sciences, pp: 78-82. 2012.
662