蜕变测试

蜕变测试（）First introduced in T.Y. Chen, S.C. Cheung, and S.M. Yiu, "Metamorphic testing: a new approach for generating next test cases", Technical Report HKUST-CS98-01, Department of Computer Science, Hong Kong University of Science and Technology, Hong Kong (1998).First regular conference paper: T.Y. Chen, T.H. Tse, and Z. Zhou, "Fault-based testing in the absence of an oracle", in Proceedings of the 25th Annual International Computer Software and Applications Conference (COMPSAC '01), IEEE Computer Society, pp. 172–178 (2001).First journal paper: T.Y. Chen, T.H. Tse, and Z.Q. Zhou, "Fault-based testing without the need of oracles", Information and Software Technology, vol. 45, no. 1, pp. 1–9 (2003).First IEEE TSE paper: T.Y. Chen, T.H. Tse, and Z.Q. Zhou, "Semi-proving: an integrated method for program proving, testing, and debugging", IEEE Transactions on Software Engineering 37 (1): 109-125 (2011).Recent IEEE TSE paper: Z.Q. Zhou, S. Xiang, and T.Y. Chen, "Metamorphic testing for software quality assessment: A study of search engines", IEEE Transactions on Software Engineering, 42 (3): 264-284 (2016).First major survey paper: S. Segura, G. Fraser, Ana B. Sánchez and A. Ruiz-Cortés, "A Survey on Metamorphic Testing", IEEE Transactions on Software Engineering, 42 (9): 805-824 (2016).Second major survey paper: T.Y. Chen, F.-C. Kuo, H. Liu, P.-L. Poon, D. Towey, T.H. Tse, and Z.Q. Zhou, "Metamorphic testing: A review of challenges and opportunities", ACM Computing Surveys 51 (1): 4:1-4:27 (2018). 是一种用来缓解“测试准则问题”的软件测试技术，它最初由 Swinburne University of Technology 的教授 Tsong Yueh Chen 于 1998 年提出。测试准则是一种让测试人员判定程序是否能通过测试的机制。当测试人员对于所选择的测试用例难以确定预期的正确结果，或无法判定程序输出是否满足预期的结果时，便认为存在“测试准则问题”。

定義
蜕变测试中指出，给出一个或多个测试用例（称为“源测试用例”或“原始测试用例”）及其预期输出（如果有的话），一个或多个用来验证系统或待实现函数的必要属性（称为蜕变关系）的后续测试用例可以被构造出来。例如，一个程序正确实现了sin x的100位有效数字。正弦函数的一个蜕变关系是“sin (π − x) = sin x”，因此即使对于源测试用例 x = 1.234 来说，sin x 的预期输出并不知道，但依然可以以此构造一个后续测试用例 y = π − 1.234。然后判断源测试用例和后续测试用例产生的输出是否在蜕变关系下一致。任何不一致的输出表示了程序的实现中存在缺陷。

應用
在一般情况下，蜕变关系并不需要一定是一个等式或方程，也可以是一个关系。蜕变试验可以应用于包含了目标函数多次执行过程、其必要属性可以被定制的任何问题中。一些成功应用蜕变测试的例子包括：偏微分方程T.Y. Chen, J. Feng, and T.H. Tse,"Metamorphic testing of programs on partial differential equations: a case study", in Proceedings of the 26th Annual International Computer Software and Applications Conference (COMPSAC '02), IEEE Computer Society, pp. 327−333 (2002).、普适计算T.H. Tse, S.S. Yau, W.K. Chan, H. Lu, and T.Y. Chen, "Testing context-sensitive middleware-based software applications", in Proceedings of the 28th Annual International Computer Software and Applications Conference (COMPSAC '04), vol. 1, IEEE Computer Society, pp. 458−465 (2004).、服务计算W.K. Chan, S.C. Cheung, and K.R.P.H. Leung, "A metamorphic testing approach for online testing of service-oriented software applications", International Journal of Web Services Research 4 (2): 60−80 (2007).、绘图软件R. Guderlei and J. Mayer, "Towards automatic testing of imaging software by means of random and metamorphic testing", International Journal of Software Engineering and Knowledge Engineering 17 (6): 757−781 (2007).、生物信息学T.Y. Chen, J.W.K. Ho, H. Liu, and X. Xie, "An innovative approach
for testing bioinformatics programs using metamorphic testing", BMC Bioinformatics 10: article no. 24 (2009). 、软件产品线S. Segura, R.M. Hierons, D. Benavides, and A. Ruiz-Cortes, "Automated test data generation on the analyses of feature models: a metamorphic testing approach", in Proceedings of the 3rd International Conference on Software Testing, Verification, and Validation (ICST '10), IEEE Computer Society, pp. 35−44 (2010).以及网络搜索引擎Z.Q. Zhou, S. Zhang, M. Hagenbuchner, T.H. Tse, F.-C. Kuo, and T.Y. Chen, "Automated functional testing of online search services", Software Testing, Verification and Reliability 22 (4): 221−243 (2012).等。

蜕变测试也被应用于机器学习、人工智能算法、以及基于神经网络的深度学习模型中 W.K. Chan, J.C.F. Ho, and T.H. Tse, "Finding failures from passed
test cases: Improving the pattern classification approach to the
testing of mesh simplification programs", Software Testing,
Verification and Reliability 20 (2): 89-120 (2010).
J. Ding, X.-H. Hu, and V. Gudivada, "A machine learning based
framework for verification and validation of massive scale image
data", IEEE Transactions on Big Data (2017).  doi:
10.1109/TBDATA.2017.2680460.
S. Nakajima,
"Generalized oracle for testing machine learning computer programs",
in Software Engineering and Formal Methods, Springer, Berlin, Germany
(2017).
X. Xie, J.W.K. Ho, C. Murphy, G.E. Kaiser, B. Xu, and T.Y. Chen,
"Testing and validating machine learning classifiers by
metamorphic testing", Journal of Systems and Software 84 (4):
544-558 (2011).，并被认为是用来验证机器学习软件的一种很有前景的方法。

 参考文献 

 外部链接 
 ACM SIGSOFT webinar on metamorphic testing 
Category:软件测试