Context: Machine learning (ML) may enable effective automated test generation. Objective: We characterize emerging research, examining testing practices, researcher goals, ML techniques applied, evaluation, and challenges. Methods: We perform a systematic mapping on a sample of 102 publications. Results: ML generates input for system, GUI, unit, performance, and combinatorial testing or improves the performance of existing generation methods. ML is also used to generate test verdicts, property-based, and expected output oracles. Supervised learning - often based on neural networks - and reinforcement learning - often based on Q-learning - are common, and some publications also employ unsupervised or semi-supervised learning. (Semi-/Un-)Supervised approaches are evaluated using both traditional testing metrics and ML-related metrics (e.g., accuracy), while reinforcement learning is often evaluated using testing metrics tied to the reward function. Conclusion: Work-to-date shows great promise, but there are open challenges regarding training data, retraining, scalability, evaluation complexity, ML algorithms employed - and how they are applied - benchmarks, and replicability. Our findings can serve as a roadmap and inspiration for researchers in this field.
翻译:背景:机器学习可能实现有效的自动化测试生成。目标:我们梳理新兴研究,审视测试实践、研究者目标、所采用的机器学习技术、评估方式及挑战。方法:我们对102篇文献样本进行系统映射。结果:机器学习为系统测试、图形用户界面测试、单元测试、性能测试和组合测试生成输入,或提升现有生成方法的性能。机器学习也被用于生成测试判定、基于属性的测试预言及预期输出预言。监督学习(常基于神经网络)和强化学习(常基于Q学习)较为常见,部分文献还采用无监督或半监督学习。(半/无)监督方法同时使用传统测试度量标准和机器学习相关度量标准(如准确率)进行评估,而强化学习通常使用与奖励函数相关的测试度量标准进行评估。结论:现有研究展现出巨大潜力,但在训练数据、重训练、可扩展性、评估复杂度、所采用的机器学习算法及其应用方式、基准测试和可复现性方面仍面临挑战。我们的发现可作为该领域研究者的路线图与启发。