基于神经进化的游戏测试和神谕生成
Neuroevolution-Based Generation of Tests and Oracles for Games
摘要:
类游戏程序在许多软件工程领域(如移动应用程序、Web应用程序或编程教育)中越来越受欢迎。然而,为具有挑战人类玩家的目的的程序创建测试对于自动测试生成器来说是一项艰巨的任务。即使测试生成成功地找到了一个相关的事件序列来执行程序,游戏的随机性意味着它既不可能重现这个序列下的确切程序行为,也不可能创建测试断言来检查观察到的随机游戏行为是否正确。为了克服这些问题,我们提出Neatest,一种新的测试生成器的基础上的神经进化增强拓扑(NEAT)算法。Neatest系统地探索程序的语句,并创建操作程序的神经网络,以可靠地到达每个语句-也就是说,Neatest学习以可靠地覆盖代码的不同部分的方式玩游戏。当网络学习实际的游戏行为时,它们也可以作为测试神谕,通过评估被测程序的观察行为与程序的假定正确版本相比有多令人惊讶。我们在Scratch,一个教育编程环境的背景下评估这种方法。我们对25个非平凡的Scratch游戏的实证研究表明,我们的方法可以成功地训练神经网络,不仅比传统的静态输入序列组成的测试套件更有弹性的随机影响,但也是非常有效的平均突变得分超过65%。
英文摘要:
Game-like programs have become increasingly popular in many software engineering domains such as mobile apps, web applications, or programming education. However, creating tests for programs that have the purpose of challenging human players is a daunting task for automatic test generators. Even if test generation succeeds in finding a relevant sequence of events to exercise a program, the randomized nature of games means that it may neither be possible to reproduce the exact program behavior underlying this sequence, nor to create test assertions checking if observed randomized game behavior is correct. To overcome these problems, we propose Neatest, a novel test generator based on the NeuroEvolution of Augmenting Topologies (NEAT) algorithm. Neatest systematically explores a program's statements, and creates neural networks that operate the program in order to reliably reach each statement -- that is, Neatest learns to play the game in a way to reliably cover different parts of the code. As the networks learn the actual game behavior, they can also serve as test oracles by evaluating how surprising the observed behavior of a program under test is compared to a supposedly correct version of the program. We evaluate this approach in the context of Scratch, an educational programming environment. Our empirical study on 25 non-trivial Scratch games demonstrates that our approach can successfully train neural networks that are not only far more resilient to random influences than traditional test suites consisting of static input sequences, but are also highly effective with an average mutation score of more than 65%.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。