首页> 外文期刊>ACM transactions on software engineering and methodology >Generating Test Cases for Programs that Are Coded against Interfaces and Annotations
【24h】

Generating Test Cases for Programs that Are Coded against Interfaces and Annotations

机译:为针对接口和注释编码的程序生成测试用例

获取原文
获取原文并翻译 | 示例

摘要

Automatic test case generation for software programs is very powerful but suffers from a key limitation. That is, most current test case generation techniques fail to cover testee code when covering that code requires additional pieces of code not yet part of the program under test. To address some of these cases, the Pex state-of-the-art test case generator can generate basic mock code. However, current test case generators cannot handle cases in which the code under test uses multiple interfaces, annotations, or reflection. To cover such code in an object-oriented setting, we describe a novel technique for generating test cases and mock classes. The technique consists of collecting constraints on interfaces, annotations, and reflection, combining them with program constraints collected during dynamic symbolic execution, encoding them in a constraint system, solving them with an off-the-shelf constraint solver, and mapping constraint solutions to test cases and custom mock classes. We demonstrate the value of this technique on open-source applications. Our approach covered such third-party code with generated mock classes, while competing approaches failed to cover the code and sometimes produced unintended side-effects such as filling the screen with dialog boxes and writing into the file system.
机译:软件程序的自动测试用例生成功能非常强大,但存在关键限制。也就是说,当前大多数测试用例生成技术都无法覆盖被测试者代码,因为覆盖该代码需要尚未被测试程序一部分的其他代码。为了解决其中的一些情况,Pex最新的测试用例生成器可以生成基本的模拟代码。但是,当前的测试用例生成器无法处理被测代码使用多个接口,注释或反射的情况。为了在面向对象的设置中覆盖此类代码,我们描述了一种用于生成测试用例和模拟类的新颖技术。该技术包括收集接口,注释和反射上的约束,将它们与在动态符号执行期间收集的程序约束相结合,在约束系统中对其进行编码,使用现成的约束求解器对其进行求解,以及映射约束解决方案以进行测试案例和自定义模拟类。我们在开源应用程序上演示了此技术的价值。我们的方法使用生成的模拟类覆盖了此类第三方代码,而竞争性方法则无法覆盖该代码,并且有时会产生意想不到的副作用,例如用对话框填充屏幕并写入文件系统。

著录项

相似文献

  • 外文文献
  • 中文文献
  • 专利
获取原文

客服邮箱:kefu@zhangqiaokeyan.com

京公网安备:11010802029741号 ICP备案号:京ICP备15016152号-6 六维联合信息科技 (北京) 有限公司©版权所有
  • 客服微信

  • 服务号