A Genetic Algorithm-Based Approach for Composite Metamorphic Relations Construction
Abstract
:1. Introduction
2. Related Works
2.1. Metamorphic Relation Inference
2.2. Genetic Algorithm
2.3. Search-Based Software Testing
3. Our Approach
3.1. Metamorphic Testing
3.2. Multi-Layer Composite Metamorphic Relations
3.3. GA-Based Approach for Searching Composite MRs
Algorithm 1 Genetic algorithm applied to CMR construction. |
|
3.3.1. Representation of Individuals
3.3.2. Genetic Operators
3.3.3. Fitness Function
4. Experimental Results
4.1. Experimental Settings
4.2. CMR Inference
4.3. Quality of Inferred CMRs
4.4. Influence of Composite Layers
5. Conclusions
Author Contributions
Funding
Acknowledgments
Conflicts of Interest
References
- Barr, E.T.; Harman, M.; McMinn, P.; Shahbaz, M.; Yoo, S. The oracle problem in software testing: A survey. IEEE Trans. Softw. Eng. 2014, 41, 507–525. [Google Scholar] [CrossRef]
- Chen, T.Y.; Kuo, F.; Tse, T.H.; Zhou, Z. Metamorphic Testing and Beyond. In Proceedings of the 11th International Workshop on Software Technology and Engineering Practice, Amsterdam, The Netherlands, 19–21 September 2003; pp. 94–100. [Google Scholar]
- Chen, T.Y.; Kuo, F.; Liu, H.; Poon, P.; Towey, D.; Tse, T.H.; Zhou, Z.Q. Metamorphic Testing: A Review of Challenges and Opportunities. ACM Comput. Surv. 2018, 51, 4. [Google Scholar] [CrossRef] [Green Version]
- Guderlei, R.; Mayer, J. Towards Automatic Testing of Imaging Software by Means of Random and Metamorphic Testing. Int. J. Softw. Eng. Knowl. Eng. 2007, 17, 757–781. [Google Scholar] [CrossRef]
- Chan, W.K.; Ho, J.C.F.; Tse, T.H. Finding failures from passed test cases: Improving the pattern classification approach to the testing of mesh simplification programs. Softw. Test. Verif. Reliab. 2010, 20, 89–120. [Google Scholar] [CrossRef] [Green Version]
- Sun, C.; Wang, G.; Mu, B.; Liu, H.; Wang, Z.; Chen, T.Y. A Metamorphic Relation-Based Approach to Testing Web Services Without Oracles. Int. J. Web Serv. Res. 2012, 9, 51–73. [Google Scholar] [CrossRef] [Green Version]
- Segura, S.; Parejo, J.A.; Troya, J.; Cortés, A.R. Metamorphic Testing of RESTful Web APIs. IEEE Trans. Softw. Eng. 2018, 44, 1083–1099. [Google Scholar] [CrossRef]
- Xie, X.; Ho, J.W.K.; Murphy, C.; Kaiser, G.E.; Xu, B.; Chen, T.Y. Testing and validating machine learning classifiers by metamorphic testing. J. Syst. Softw. 2011, 84, 544–558. [Google Scholar] [CrossRef] [Green Version]
- Nakajima, S.; Chen, T.Y. Generating Biased Dataset for Metamorphic Testing of Machine Learning Programs. In Proceedings of the International Conference Testing Software and Systems, Paris, France, 15–17 October 2019; pp. 56–64. [Google Scholar]
- Shahri, M.P.; Srinivasan, M.; Reynolds, G.; Bimczok, D.; Kahanda, I.; Kanewala, U. Metamorphic Testing for Quality Assurance of Protein Function Prediction Tools. In Proceedings of the 2019 IEEE International Conference On Artificial Intelligence Testing, Newark, CA, USA, 4–9 April 2019. [Google Scholar] [CrossRef]
- Lin, X.; Simon, M.; Niu, N. Hierarchical metamorphic relations for testing scientific software. In Proceedings of the International Workshop on Software Engineering for Science, Gothenburg, Sweden, 2 June 2018; pp. 1–8. [Google Scholar]
- Kanewala, U.; Bieman, J.M. Using machine learning techniques to detect metamorphic relations for programs without test oracles. In Proceedings of the 24th International Symposium on Software Reliability Engineering, Pasadena, CA, USA, 4–7 November 2013; pp. 1–10. [Google Scholar]
- Kanewala, U.; Bieman, J.M.; Ben-Hur, A. Predicting metamorphic relations for testing scientific software: A machine learning approach using graph kernels. Softw. Test. Verif. Reliab. 2016, 26, 245–269. [Google Scholar] [CrossRef]
- Liu, H.; Liu, X.; Chen, T.Y. A New Method for Constructing Metamorphic Relations. In Proceedings of the 12th International Conference on Quality Software, Xi’an, China, 27–29 August 2012; pp. 59–68. [Google Scholar]
- Su, F.; Bell, J.; Murphy, C.; Kaiser, G.E. Dynamic Inference of Likely Metamorphic Properties to Support Differential Testing. In Proceedings of the 10th International Workshop on Automation of Software Test, Florence, Italy, 23–24 May 2015; pp. 55–59. [Google Scholar]
- Chen, T.Y.; Poon, P.; Xie, X. METRIC: METamorphic Relation Identification based on the Category-choice framework. J. Syst. Softw. 2016, 116, 177–190. [Google Scholar] [CrossRef]
- Troya, J.; Segura, S.; Cortés, A.R. Automated inference of likely metamorphic relations for model transformations. J. Syst. Softw. 2018, 136, 188–208. [Google Scholar] [CrossRef]
- Holland, J.H. Genetic Algorithms and the Optimal Allocation of Trials. SIAM J. Comput. 1973, 2, 88–105. [Google Scholar] [CrossRef]
- Zhang, J.; Chen, J.; Hao, D.; Xiong, Y.; Xie, B.; Zhang, L.; Mei, H. Search-based inference of polynomial metamorphic relations. In Proceedings of the International Conference on Automated Software Engineering, Vasteras, Sweden, 15–19 September 2014; pp. 701–712. [Google Scholar]
- Deng, Y.; Liu, Y.; Zhou, D. An improved genetic algorithm with initial population strategy for symmetric TSP. Math. Probl. Eng. 2015, 2015. [Google Scholar] [CrossRef] [Green Version]
- Li, X.; Gao, L. An effective hybrid genetic algorithm and tabu search for flexible job shop scheduling problem. Int. J. Prod. Econ. 2016, 174, 93–110. [Google Scholar] [CrossRef]
- Kora, P.; Yadlapalli, P. Crossover operators in genetic algorithms: A review. Int. J. Comput. Appl. 2017, 162. [Google Scholar] [CrossRef]
- Li, X.; Wong, W.E.; Gao, R.; Hu, L.; Hosono, S. Genetic algorithm-based test generation for software product line with the integration of fault localization techniques. Empir. Softw. Eng. 2018, 23, 1–51. [Google Scholar] [CrossRef]
- Sharma, C.; Sabharwal, S.; Sibal, R. A Survey on Software Testing Techniques using Genetic Algorithm. arXiv 2014, arXiv:1411.1154. [Google Scholar]
- Mu, L.; Sugumaran, V.; Wang, F. A Hybrid Genetic Algorithm for Software Architecture Re-Modularization. Inf. Syst. Front. 2019, 1–29. [Google Scholar] [CrossRef]
- Boopathi, M.; Sujatha, R.; Kumar, C.S.; Narasimman, S.; Rajan, A. Markov approach for quantifying the software code coverage using genetic algorithm in software testing. Int. J. Bio-Inspired Comput. 2019, 14, 27–45. [Google Scholar] [CrossRef]
- Goyal, S.; Mishra, P.; Lamichhane, A.; Gandhi, P. Software test case optimization using genetic algorithm. Int. J. Sci. Eng. Sci. 2018, 1, 69–73. [Google Scholar]
- Dai, Y.S.; Xie, M.; Poh, K.L.; Yang, B. Optimal testing-resource allocation with genetic algorithm for modular software systems. J. Syst. Softw. 2003, 66, 47–55. [Google Scholar] [CrossRef]
- Ray, M.; Mohapatra, D.P. Multi-objective test prioritization via a genetic algorithm. Innov. Syst. Softw. Eng. 2014, 10, 261–270. [Google Scholar] [CrossRef]
- Raju, S.; Uma, G. Factors oriented test case prioritization technique in regression testing using genetic algorithm. Eur. J. Sci. Res. 2012, 74, 389–402. [Google Scholar]
- Bank, M.; Ghomi, S.M.T.F.; Jolai, F.; Behnamian, J. Application of particle swarm optimization and simulated annealing algorithms in flow shop scheduling problem under linear deterioration. Adv. Eng. Softw. 2012, 47, 1–6. [Google Scholar] [CrossRef]
- Ramírez, A.; Romero, J.R.; Ventura, S. A survey of many-objective optimisation in search-based software engineering. J. Syst. Softw. 2019, 149, 382–395. [Google Scholar] [CrossRef]
- Jiang, H.; Tang, K.; Petke, J.; Harman, M. Search Based Software Engineering [Guest Editorial]. IEEE Comput. Int. Mag. 2017, 12, 23–71. [Google Scholar] [CrossRef]
- Sun, S.; Guo, J.; Zhao, R.; Li, Z. Search-Based Efficient Automated Program Repair Using Mutation and Fault Localization. In Proceedings of the 42th Annual Computer Software and Applications Conference, Tokyo, Japan, 23–27 July 2018; pp. 174–183. [Google Scholar]
- Zeller, A. Search-Based Program Analysis. In Proceedings of the Search Based Software Engineering—Third International Symposium, Szeged, Hungary, 10–12 September 2011; pp. 1–4. [Google Scholar] [CrossRef]
- Mohan, M.; Greer, D. A survey of search-based refactoring for software maintenance. J. Softw. Eng. R D 2018, 6, 3. [Google Scholar]
- Rezende, A.V.; Silva, L.; Britto, A.; Amaral, R. Software project scheduling problem in the context of search-based software engineering: A systematic review. J. Syst. Softw. 2019, 155, 43–56. [Google Scholar] [CrossRef]
- Harman, M.; Jia, Y.; Zhang, Y. Achievements, Open Problems and Challenges for Search Based Software Testing. In Proceedings of the 8th International Conference on Software Testing, Verification and Validation, Graz, Austria, 13–17 April 2015; pp. 1–12. [Google Scholar] [CrossRef] [Green Version]
- Segura, S.; Fraser, G.; Sánchez, A.B.; Cortés, A.R. A Survey on Metamorphic Testing. IEEE Trans. Softw. Eng. 2016, 42, 805–824. [Google Scholar] [CrossRef] [Green Version]
- Bajaj, A.; Sangwan, O.P. A Systematic Literature Review of Test Case Prioritization Using Genetic Algorithms. IEEE Access 2019, 7, 126355–126375. [Google Scholar] [CrossRef]
- Papadakis, M.; Kintis, M.; Zhang, J.; Jia, Y.; Traon, Y.L.; Harman, M. Chapter Six - Mutation Testing Advances: An Analysis and Survey. Adv. Comput. 2019, 112, 275–378. [Google Scholar]
- Chen, S.; Montgomery, J.; Röhler, A.B. Measuring the curse of dimensionality and its effects on particle swarm optimization and differential evolution. Appl. Intell. 2015, 42, 514–526. [Google Scholar] [CrossRef]
- Eiben, Á.E.; Hinterding, R.; Michalewicz, Z. Parameter control in evolutionary algorithms. IEEE Trans. Evol. Comput. 1999, 3, 124–141. [Google Scholar] [CrossRef] [Green Version]
- Doerr, B.; Doerr, C.; Ebel, F. From black-box complexity to designing new genetic algorithms. Theor. Comput. Sci. 2015, 567, 87–104. [Google Scholar] [CrossRef]
- Kirkpatrick, S.; Gelatt, C.D.; Vecchi, M.P. Optimization by simulated annealing. Science 1983, 220, 671–680. [Google Scholar] [CrossRef] [PubMed]
- Geng, X.; Chen, Z.; Yang, W.; Shi, D.; Zhao, K. Solving the traveling salesman problem based on an adaptive simulated annealing algorithm with greedy search. Appl. Soft Comput. 2011, 11, 3680–3689. [Google Scholar] [CrossRef]
- Delgado, F. Meaningful Learning of Math and Sciences Using Wolfram Alpha Widgets. In Proceedings of the EdMedia+ Innovate Learning, Victoria, BC, Canada, 24 June 2013; pp. 1794–1799. [Google Scholar]
- Ma, Y.; Offutt, J.; Kwon, Y.R. MuJava: An automated class mutation system. Softw. Test. Verif. Reliab. 2005, 15, 97–133. [Google Scholar] [CrossRef]
No. | Basic MRs of | Mutation Score | Basic MRs of | Mutation Score |
---|---|---|---|---|
0.0583 | 0.0116 | |||
0.4187 | 0.4114 | |||
0.4074 | 0.3935 | |||
0.1608 | 0.1733 | |||
0.1849 | 0.1969 | |||
0.1352 | 0.1316 | |||
0.1681 | 0.1711 | |||
0.3014 | 0.3234 | |||
Avg. | 0.2304 | 0.2261 |
Numbers of CMRs for Each Test Trigonometric Functions | |||||||||
---|---|---|---|---|---|---|---|---|---|
Functions | 2-CMRs | 3-CMRs | 4-CMRs | ||||||
Avg. | Max. | Min. | Avg. | Max. | Min. | Avg. | Max. | Min. | |
44 | 59 | 3 | 50 | 102 | 7 | 98 | 143 | 11 | |
40 | 53 | 5 | 52 | 97 | 5 | 86 | 132 | 7 |
Execution Time of CMR Inference for Each Test Trigonometric Functions | |||||||||
---|---|---|---|---|---|---|---|---|---|
Functions | 2-CMRs (s) | 3-CMRs (s) | 4-CMRs (s) | ||||||
Avg. | Max. | Min. | Avg. | Max. | Min. | Avg. | Max. | Min. | |
78.25 | 274.42 | 29.25 | 198.16 | 402.54 | 127.06 | 478.04 | 789.02 | 233.29 | |
84.82 | 291.05 | 42.19 | 246.29 | 412.01 | 158.26 | 524.85 | 710.15 | 272.35 |
Layers | Composite Metamorphic Relations of | Composite Metamorphic Relations of | ||||
---|---|---|---|---|---|---|
CMRs | Details of CMRs | MS | CMRs | Details of CMRs | MS | |
0.585 | 0.579 | |||||
0.586 | 0.580 | |||||
0.585 | 0.588 | |||||
0.584 | 0.581 | |||||
0.586 | 0.586 | |||||
0.582 | 0.588 | |||||
2-CMR | 0.589 | 0.578 | ||||
0.585 | 0.586 | |||||
0.585 | 0.589 | |||||
0.586 | 0.583 | |||||
0.582 | 0.577 | |||||
0.589 | 0.591 | |||||
0.584 | 0.571 | |||||
3-CMR | 0.612 | 0.596 | ||||
0.622 | 0.592 | |||||
4-CMR | 0.633 | 0.603 | ||||
0.623 | 0.614 |
Mutant Types | AODU | AOIS | AORB | ASRS | CDL | COI | LOI | LOR | ODL | ROR | VDL |
---|---|---|---|---|---|---|---|---|---|---|---|
Number | 2 | 42 | 49 | 16 | 12 | 5 | 3 | 2 | 25 | 10 | 2 |
Mutant | Original Statement | Faulty Statement |
---|---|---|
AODU | ||
AOIS | ||
AORB | ||
ASRS | ||
CDL | ||
LOI | ||
COI | ||
LOR | ||
ODL | ||
ROR | ||
VDL |
Test Functions | 2-CMRs | 3-CMRs | 4-CMRs |
---|---|---|---|
0.58594 | 0.6247 | 0.626192 | |
0.52548 | 0.59365 | 0.607526 |
© 2019 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).
Share and Cite
Xiang, Z.; Wu, H.; Yu, F. A Genetic Algorithm-Based Approach for Composite Metamorphic Relations Construction. Information 2019, 10, 392. https://doi.org/10.3390/info10120392
Xiang Z, Wu H, Yu F. A Genetic Algorithm-Based Approach for Composite Metamorphic Relations Construction. Information. 2019; 10(12):392. https://doi.org/10.3390/info10120392
Chicago/Turabian StyleXiang, Zhenglong, Hongrun Wu, and Fei Yu. 2019. "A Genetic Algorithm-Based Approach for Composite Metamorphic Relations Construction" Information 10, no. 12: 392. https://doi.org/10.3390/info10120392
APA StyleXiang, Z., Wu, H., & Yu, F. (2019). A Genetic Algorithm-Based Approach for Composite Metamorphic Relations Construction. Information, 10(12), 392. https://doi.org/10.3390/info10120392