【24h】

MSeqGen

机译:MSeqGen

获取原文

摘要

An objective of unit testing is to achieve high structural coverage of the code under test. Achieving high structural overage of object-oriented code requires desirable method-call sequences that create and mutate objects. These sequences help generate target object states such as argument or receiver object states (in short as target states) of a method under test. Automatic generation of sequences for achieving target states is often challenging due to a large search space of possible sequences. On the other hand, code bases using object types (such as receiver or argument object types) include sequences that can be used to assist automatic test-generation approaches in achieving target states. In this paper, we propose a novel approach, called MSeqGen, that mines code bases and extracts sequences related to receiver or argument object types of a method under test. Our approach uses these extracted sequences to enhance two state-of-the-art test-generation approaches: random testing anddynamic symbolic execution. We conduct two evaluations to show the effectiveness of our approach. Using sequences extracted by our approach, we show that a random testing approach achieves 8.7% (with a maximum of 20.0% for one namespace) higher branch coverage and a dynamic-symbolic-execution-based approach achieves 17.4% (with a maximum of 22.5% for one namespace) higher branch coverage than without using our approach. Such an improvement is significant as the branches that are not covered by these state-of-the-art approaches are generally quite difficult to cover.
机译:单元测试的目的是要在测试的代码中获得较高的结构覆盖率。实现面向对象代码的高度结构化溢出,需要创建和变异对象的理想方法调用序列。这些序列有助于生成目标对象状态,例如被测方法的自变量或接收器对象状态(简称为目标状态)。由于可能的序列的搜索空间较大,因此自动生成用于实现目标状态的序列通常具有挑战性。另一方面,使用对象类型(例如接收器或自变量对象类型)的代码库包括可用于协助自动测试生成方法实现目标状态的序列。在本文中,我们提出了一种名为MSeqGen的新颖方法,该方法挖掘代码库并提取与被测方法的接收者或参数对象类型有关的序列。我们的方法使用这些提取的序列来增强两种最新的测试生成方法:随机测试和动态符号执行。我们进行了两次评估,以证明我们方法的有效性。使用我们的方法提取的序列,我们显示出一种随机测试方法可以实现8.7%的分支覆盖率(一个命名空间最大为20.0%),基于动态符号执行的方法可以达到17.4%(最大为22.5%)一个命名空间的百分比)比没有使用我们的方法的分支覆盖率高。这些改进非常重要,因为这些最新技术方法未涵盖的分支通常很难覆盖。

著录项

获取原文

客服邮箱:kefu@zhangqiaokeyan.com

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

  • 服务号