skip to main content
research-article

Feedback-Directed Metamorphic Testing

Published: 13 February 2023 Publication History

Abstract

Over the past decade, metamorphic testing has gained rapidly increasing attention from both academia and industry, particularly thanks to its high efficacy on revealing real-life software faults in a wide variety of application domains. On the basis of a set of metamorphic relations among multiple software inputs and their expected outputs, metamorphic testing not only provides a test case generation strategy by constructing new (or follow-up) test cases from some original (or source) test cases, but also a test result verification mechanism through checking the relationship between the outputs of source and follow-up test cases. Many efforts have been made to further improve the cost-effectiveness of metamorphic testing from different perspectives. Some studies attempted to identify “good” metamorphic relations, while other studies were focused on applying effective test case generation strategies especially for source test cases. In this article, we propose improving the cost-effectiveness of metamorphic testing by leveraging the feedback information obtained in the test execution process. Consequently, we develop a new approach, namely feedback-directed metamorphic testing, which makes use of test execution information to dynamically adjust the selection of metamorphic relations and selection of source test cases. We conduct an empirical study to evaluate the proposed approach based on four laboratory programs, one GNU program, and one industry program. The empirical results show that feedback-directed metamorphic testing can use fewer test cases and take less time than the traditional metamorphic testing for detecting the same number of faults. It is clearly demonstrated that the use of feedback information about test execution does help enhance the cost-effectiveness of metamorphic testing. Our work provides a new perspective to improve the efficacy and applicability of metamorphic testing as well as many other software testing techniques.

References

[1]
John Ahlgren, Maria Eugenia Berezin, Kinga Bojarczuk, Elena Dulskyte, Inna Dvortsova, Johann George, Natalija Gucevska, Mark Harman, Maria Lomeli, Erik Meijer, Silvia Sapora, and Justin Spahr. 2021. Testing web enabled simulation at scale using metamorphic testing. In Proceedings of the 2021 IEEE/ACM 43rd International Conference on Software Engineering: Software Engineering in Practice (ICSE-SEIP’21). 140–149.
[2]
Andrea Arcuri and Lionel Briand. 2011. A practical guide for using statistical tests to assess randomized algorithms in software engineering. In Proceedings of the 33rd International Conference on Software Engineering (ICSE’11). 1–10.
[3]
Mahmuda Asrafi, Huai Liu, and Fei-Ching Kuo. 2011. On testing effectiveness of metamorphic relations: A case study. In Proceedings of the 15th International Conference on Secure Software Integration and Reliability Improvement (SSIRI’11). 147–156.
[4]
Jon Ayerdi, Valerio Terragni, Aitor Arrieta, Paolo Tonella, Goiuria Sagardui, and Maite Arratibel. 2021. Generating metamorphic relations for cyber-physical systems with genetic programming: An industrial case study. In Proceedings of the ACM Joint European Software Engineering Conference and Symposium on the Foundations of Software Engineering (ESEC/FSE’21). 1264–1274.
[5]
Earl T. Barr, Mark Harman, Phil McMinn, Muzammil Shahbaz, and Shin Yoo. 2015. The oracle problem in software testing: A survey. IEEE Transactions on Software Engineering 41, 5 (2015), 507–525.
[6]
Arlinta Christy Barus, Tsong Yueh Chen, Fei-Ching Kuo, Huai Liu, Robert Merkel, and Gregg Rothermel. 2016. A cost-effective random testing method for programs with non-numeric inputs. IEEE Transactions on Computers 65, 12 (2016), 3509–3523.
[7]
Arlinta Christy Barus, Tsong Yueh Chen, Fei-Ching Kuo, Huai Liu, and Heinz W. Schmidt. 2016. The impact of source test case selection on the effectiveness of metamorphic testing. In Proceedings of the 1st International Workshop on Metamorphic Testing (MET’16), Co-Located with the 38th International Conference on Software Engineering (ICSE’16). 5–11.
[8]
Pierre Bourque and Richard E. Fairley (Eds.). 2014. SWEBOK: Guide to the Software Engineering Body of Knowledge (version 3.0 ed.). IEEE Computer Society, Los Alamitos, CA.
[9]
Susan S. Brilliant, John C. Knight, and P. E. Ammann. 1990. On the performance of software testing using multiple versions. In Proceedings of the 20th International Symposium on Fault-Tolerant Computing (FTCS’90). 408–415.
[10]
Kai-Yuan Cai. 2002. Optimal software testing and adaptive software testing in the context of software cybernetics. Information and Software Technology 44, 14 (2002), 841–855.
[11]
Kai-Yuan Cai, Tsong Yueh Chen, and T. H. Tse. 2002. Towards research on software cybernetics. In Proceedings of the 7th IEEE International Symposium on High Assurance Systems Engineering (HSE’02). 240–241.
[12]
Kai-Yuan Cai, Bo Gu, Hai Hu, and Yong-Chao Li. 2007. Adaptive software testing with fixed-memory feedback. Journal of Systems and Software 80, 8 (2007), 1328–1348.
[13]
João W. Cangussu, Kai-Yuan Cai, Scott D. Miller, and Aditya P. Mathur. 2007. Software cybernetics. Wiley Encyclopedia of Computer Science and Engineering (2007).
[14]
Alvin Chan, Lei Ma, Felix Juefei-Xu, Yew-Soon Ong, Xiaofei Xie, Minhui Xue, and Yang Liu. 2021. Breaking neural reasoning architectures with metamorphic relation-based adversarial examples. IEEE Transactions on Neural Networks and Learning Systems (2021).
[15]
Tsong Yueh Chen, Shing C. Cheung, and Shiu Ming Yiu. 1998. Metamorphic Testing: A New Approach for Generating Next Test Cases. Technical Report. Department of Computer Science, Hong Kong University of Science and Technology, Hong Kong, Tech. Rep. HKUST-CS98-01.
[16]
Tsong Yueh Chen, Joshua W. K. Ho, Huai Liu, and Xiaoyuan Xie. 2009. An innovative approach for testing bioinformatics programs using metamorphic testing. BMC Bioinformatics 10, 1 (2009), 24–32.
[17]
Tsong Yueh Chen, D. H. Huang, T. H. Tse, and Zhi Quan Zhou. 2004. Case studies on the selection of useful relations in metamorphic testing. In Proceedings of the 4th lberoAmerican Symposium on Software Engineering and Knowledge Engineer-ing (JIISIC’04). 569–583.
[18]
Tsong Yueh Chen, Fei-Ching Kuo, Huai Liu, Pak-Lok Poon, Dave Towey, T. H. Tse, and Zhi Quan Zhou. 2018. Metamorphic testing: A review of challenges and opportunities. ACM Computing Surveys 51, 1 (2018), 4:1–4:27.
[19]
Tsong Yueh Chen, Fei-Ching Kuo, Ying Liu, and Antony Tang. 2004. Metamorphic testing and testing with special values. In Proceedings of the 5th ACIS International Conference on Software Engineering, Artificial Intelligence, Networking and Parallel/Distributed Computing (SNPD’04). 128–134.
[20]
Tsong Yueh Chen, Fei-Ching Kuo, Wenjuan Ma, Willy Susilo, Dave Towey, Jeffrey Voas, and Zhi Quan Zhou. 2016. Metamorphic testing for cybersecurity. Computer 49, 6 (2016), 48–55.
[21]
Tsong Yueh Chen, Hing Leung, and Ieng Kei Mak. 2004. Adaptive random testing. In Proceedings of the 9th Asian Computing Science Conference (ASIAN’04). 320–329.
[22]
Tsong Yueh Chen, Pak-Lok Poon, and Xiaoyuan Xie. 2016. METRIC: Metamorphic relation identification based on the category-choice framework. Journal of Systems and Software 116 (2016), 177–190.
[23]
Tsong Yueh Chen and T. H. Tse. 2021. New visions on metamorphic testing after a quarter of a century of inception. In Proceedings of the 29th ACM Joint Meeting on European Software Engineering Conference and Symposium on the Foundations of Software Engineering (ESEC/FSE’21). 1487–1490.
[24]
Tsong Yueh Chen and Yuen-Tak Yu. 1994. On the relationship between partition and random testing. IEEE Transactions on Software Engineering 20, 12 (1994), 977–980.
[25]
David Coppit and Jennifer M. Haddox-Schatz. 2005. On the use of specification-based assertions as test oracles. In Proceedings of the 29th IEEE/NASA Software Engineering Workshop (SEW’05). 305–314.
[26]
Hyunsook Do, Sebastian Elbaum, and Gregg Rothermel. 2005. Supporting controlled experimentation with testing techniques: An infrastructure and its potential impact. Empirical Software Engineering 10, 4 (2005), 405–435.
[27]
Guowei Dong, Tao Guo, and Puhan Zhang. 2013. Security assurance with program path analysis and metamorphic testing. In Proceedings of the 4th IEEE International Conference on Software Engineering and Service Science (ICSESS’13). 193–197.
[28]
GNU Project. 2006. GNU grep. (2006). Retrieved from http://www.gnu.org/software/grep.
[29]
Mark Grechanik, Chen Fu, and Qing Xie. 2012. Automatically finding performance problems with feedback-directed learning software testing. In Proceedings of the 34th International Conference on Software Engineering (ICSE’12). 156–166.
[30]
Richard Hamlet. 2002. Random testing. In Proceedings of the Encyclopedia of Software Engineering. John Wiley & Sons, Inc.
[31]
Pinjia He, Clara Meister, and Zhendong Su. 2020. Structure-invariant testing for machine translation. In Proceedings of the 42nd International Conference on Software Engineering (ICSE’20). 961–973.
[32]
Xiao He, Xingwei Wang, Jia Shi, and Yi Liu. 2020. Testing high performance numerical simulation programs: Experience, lessons learned, and open issues. In Proceedings of the 29th ACM SIGSOFT International Symposium on Software Testing and Analysis (ISSTA’20). 502–515.
[33]
Larry Hedges and Ingram Olkin. 2014. Statistical Methods for Meta-Analysis. Academic Press.
[34]
John Hughes. 2019. How to specify it!. In Proceedings of the 20th International Symposium on Trends in Functional Programming (TFP’19) (Lecture Notes in Computer Science), Vol. 12053. 58–83.
[35]
Zhan-Wei Hui, Song Huang, Tsong Yueh Chen, Man F. Lau, and Sebastian Ng. 2017. Identifying failed test cases through metamorphic testing. In Proceedings of the 28th International Symposium on Software Reliability Engineering Workshops (ISSREW’17). 90–91.
[36]
René Just and Franz Schweiggert. 2010. Automating software tests with partial oracles in integrated environments. In Proceedings of the 5th Workshop on Automation of Software Test (AST’10). 91–94.
[37]
Caroline Lemieux, Rohan Padhye, Koushik Sen, and Dawn Song. 2018. Perffuzz: Automatically generating pathological inputs. In Proceedings of the 27th ACM SIGSOFT International Symposium on Software Testing and Analysis (ISSTA’18). 254–265.
[38]
Caroline Lemieux and Koushik Sen. 2018. Fairfuzz: A targeted mutation strategy for increasing greybox fuzz testing coverage. In Proceedings of the 33rd ACM/IEEE International Conference on Automated Software Engineering. 475–485.
[39]
Ye Li, Bei-Bei Yin, Junpeng Lv, and Kai-Yuan Cai. 2015. Approach for test profile optimization in dynamic random testing. In Proceedings of the 39th International Computer Software and Applications Conference (COMPSAC’15), Vol. 3. 466–471.
[40]
Huai Liu, Fei-Ching Kuo, Dave Towey, and Tsong Yueh Chen. 2014. How effectively does metamorphic testing alleviate the oracle problem? IEEE Transactions on Software Engineering 40, 1 (2014), 4–22.
[41]
Huai Liu, Xuan Liu, and Tsong Yueh Chen. 2012. A new method for constructing metamorphic relations. In Proceedings of the 12th International Conference on Quality Software (QSIC’12). 59–68.
[42]
Junpeng Lv, Hai Hu, and Kai-Yuan Cai. 2011. A sufficient condition for parameters estimation in dynamic random testing. In Proceedings of the 35th IEEE Annual International Computer Software and Applications Conference Workshops (COMPSACW’11). 19–24.
[43]
Junpeng Lv, Bei-Bei Yin, and Kai-Yuan Cai. 2014. On the asymptotic behavior of adaptive testing strategy for software reliability assessment. IEEE Transactions on Software Engineering 40, 4 (2014), 396–412.
[44]
Pingchuan Ma, Shuai Wang, and Jin Liu. 2020. Metamorphic testing and certified mitigation of fairness violations in NLP models. In Proceedings of the 29th International Joint Conference on Artificial Intelligence (IJCAI’20). 458–465.
[45]
Yu-Seung Ma, Jeff Offutt, and Yong Rae Kwon. 2005. MuJava: An automated class mutation system. Software Testing, Verification and Reliability 15, 2 (2005), 97–133.
[46]
Phu X. Mai, Fabrizio Pastore, Arda Goknil, and Lionel C. Briand. 2020. Metamorphic security testing for web systems. In Proceedings of the 13th IEEE International Conference on Software Testing, Validation and Verification (ICST’20). 186–197.
[47]
Muhammad Numair Mansur, Maria Christakis, and Valentin Wüstholz. 2021. Metamorphic testing of datalog engines. In Proceedings of the ACM Joint European Software Engineering Conference and Symposium on the Foundations of Software Engineering (ESEC/FSE’21). 639–650.
[48]
Dusica Marijan, Arnaud Gotlieb, and Mohit Kumar Ahuja. 2019. Challenges of testing machine learning based systems. In Proceedings of the 1st IEEE International Conference On Artificial Intelligence Testing (AITest’19). 101–102.
[49]
Johannes Mayer and Ralph Guderlei. 2006. An empirical study on the selection of good metamorphic relations. In Proceedings of the 30th Annual International Computer Software and Applications Conference (COMPSAC’06). 475–484.
[50]
Andrew McNutt, Gordon Kindlmann, and Michael Correll. 2020. Surfacing visualization mirages. In Proceedings of the 2020 CHI Conference on Human Factors in Computing Systems (CHI’20). 1–16.
[51]
Thomas J. Ostrand and Marc J. Balcer. 1988. The category-partition method for specifying and generating fuctional tests. Communications of the ACM 31, 6 (1988), 676–686.
[52]
Carlos Pacheco, Shuvendu K Lahiri, and Thomas Ball. 2008. Finding errors in. net with feedback-directed random testing. In Proceedings of the 7th International Symposium on Software Testing and Analysis (ISSTA’08). 87–96.
[53]
Carlos Pacheco, Shuvendu K. Lahiri, Michael D. Ernst, and Thomas Ball. 2007. Feedback-directed random test generation. In Proceedings of the 29th International Conference on Software Engineering (ICSE’07). 75–84.
[54]
Krishna Patel and Robert M Hierons. 2018. A mapping study on testing non-testable systems. Software Quality Journal 26, 4 (2018), 1373–1413.
[55]
Kun Qiu, Zheng Zheng, Tsong Yueh Chen, and Pak-Lok Poon. 2022. Theoretical and empirical analyses of the effectiveness of metamorphic relation composition. IEEE Transactions on Software Engineering 48, 3 (2022), 1001–1007.
[56]
Marco Túlio Ribeiro, Tongshuang Wu, Carlos Guestrin, and Sameer Singh. 2020. Beyond accuracy: Behavioral testing of NLP models with checkList. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics (ACL’20). 4902–4912.
[57]
Shlomo S. Sawilowsky. 2009. New effect size rules of thumb. Journal of Modern Applied Statistical Methods 8, 2 (2009), 467–474.
[58]
Itai Segall and Rachel Tzoref-Brill. 2015. Feedback-driven combinatorial test design and execution. In Proceedings of the 8th ACM International Systems and Storage Conference. 1–6.
[59]
Sergio Segura, Gordon Fraser, Ana B. Sanchez, and Antonio Ruiz-Cortés. 2016. A survey on metamorphic testing. IEEE Transactions on Software Engineering 42, 9 (2016), 805–824.
[60]
Sergio Segura, José A. Parejo, Javier Troya, and Antonio Ruiz-Cortés. 2018. Metamorphic testing of RESTful web APIs. IEEE Transactions on Software Engineering 44, 11 (2018), 1083–1099.
[61]
Helge Spieker and Arnaud Gotlieb. 2020. Adaptive metamorphic testing with contextual bandits. Journal of Systems and Software 165 (2020), 110574:1–110574:14.
[62]
Chang-ai Sun, Hepeng Dai, Huai Liu, Tsong Yueh Chen, and Kai-Yuan Cai. 2018. Adaptive partition testing. IEEE Transactions on Computers 68, 2 (2018), 157–169.
[63]
Chang-ai Sun, Hepeng Dai, Guan Wang, Dave Towey, Tsong Yueh Chen, and Kai-Yuan Cai. 2022. Dynamic random testing of web services: A methodology and evaluation. IEEE Transactions on Services Computing 15, 2 (2022), 736–751.
[64]
Chang-ai Sun, An Fu, Pak-Lok Poon, Xiaoyuan Xie, Huai Liu, and Tsong Yueh Chen. 2021. METRIC+: A metamorphic relation identification technique based on input plus output domains. IEEE Transactions on Software Engineering 47, 9 (2021), 1765–1786.
[65]
Chang-ai Sun, Yiqiang Liu, Zuoyi Wang, and W. K. Chan. 2016. \(\mu\)MT: A data mutation directed metamorphic relation acquisition methodology. In Proceedings of 2016 IEEE/ACM the 1st International Workshop on Metamorphic Testing (MET’16), Co-Located with the 38th International Conference on Software Engineering (ICSE’16). 12–18.
[66]
Chang-ai Sun, Zuoyi Wang, and Guan Wang. 2014. A property-based testing framework for encryption programs. Frontiers of Computer Science 8, 3 (2014), 478–489.
[67]
Yuchi Tian, Kexin Pei, Suman Jana, and Baishakhi Ray. 2018. DeepTest: Automated testing of deep-neural-network-driven autonomous cars. In Proceedings of the 40th International Conference on Software Engineering (ICSE’18). 303–314.
[68]
Xiaoyuan Xie, W. Eric Wong, Tsong Yueh Chen, and Baowen Xu. 2013. Metamorphic slice: An application in spectrum-based fault localization. Information and Software Technology 55, 5 (2013), 866–879.
[69]
Hongji Yang, Feng Chen, and Suleiman Aliyu. 2017. Modern software cybernetics: New trends. Journal of System and Software 124 (2017), 157–169.
[70]
Zijiang Yang, Beibei Yin, Junpeng Lv, Kai-Yuan Cai, Stephen S. Yau, and Jia Yu. 2014. Dynamic random testing with parameter adjustment. In Proceedings of the 38th IEEE Annual International Computer Software and Applications Conference Workshops (COMPSACW’14). 37–42.
[71]
Yuanyuan Yuan, Shuai Wang, Mingyue Jiang, and Tsong Yueh Chen. 2021. Perception matters: Detecting perception failures of VQA models using metamorphic testing. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR’21). 16908–16917.
[72]
Jie Zhang, Junjie Chen, Dan Hao, Yingfei Xiong, Bing Xie, Lu Zhang, and Hong Mei. 2014. Search-based inference of polynomial metamorphic relations. In Proceedings of the 29th ACM/IEEE International Conference on Automated Software Engineering (ASE’14). 701–712.
[73]
Jie Ming Zhang, Mark Harman, Lei Ma, and Yang Liu. 2022. Machine learning testing: Survey, landscapes and horizons. IEEE Transactions on Software Engineering 48, 1 (2022), 1–36.
[74]
Lei Zhang, Bei-Bei Yin, Junpeng Lv, Kai-Yuan Cai, Stephen S. Yau, and Jia Yu. 2014. A history-based dynamic random software testing. In Proceedings of the 38th International Computer Software and Applications Conference Workshops (COMPSACW’14). 31–36.

Cited By

View all

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Transactions on Software Engineering and Methodology
ACM Transactions on Software Engineering and Methodology  Volume 32, Issue 1
January 2023
954 pages
ISSN:1049-331X
EISSN:1557-7392
DOI:10.1145/3572890
  • Editor:
  • Mauro Pezzè
Issue’s Table of Contents

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 13 February 2023
Online AM: 24 May 2022
Accepted: 22 April 2022
Revised: 25 February 2022
Received: 06 August 2021
Published in TOSEM Volume 32, Issue 1

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. Metamorphic testing
  2. metamorphic relation
  3. test execution
  4. feedback control
  5. random testing
  6. adaptive partition testing

Qualifiers

  • Research-article
  • Refereed

Funding Sources

  • National Natural Science Foundation of China
  • Australian Research Council Discovery Project
  • Beijing Natural Science Foundation
  • Aeronautical Science Foundation of China
  • Fundamental Research Funds for the Central Universities

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)291
  • Downloads (Last 6 weeks)19
Reflects downloads up to 09 Jan 2025

Other Metrics

Citations

Cited By

View all

View Options

Login options

Full Access

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Full Text

View this article in Full Text.

Full Text

HTML Format

View this article in HTML Format.

HTML Format

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media