arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 1407.3091cs.SE
收藏

UCov:一种用于测试用例意图验证的自定义覆盖准则

UCov: a User-Defined Coverage Criterion for Test Case Intent Verification

Rawad Abou Assi, Fadi A. Zaraket, Wes Masri

摘要:

回归测试的目标是确保现有代码的行为不会被新的程序更改所改变。回归测试的主要焦点应该是与以下相关的代码:a)早期的bug修复; b)测试人员认为重要的特定应用程序场景。现有的覆盖标准无法实现这种重点,例如,100%的分支覆盖率并不能保证给定的bug修复得到执行,或者给定的应用程序场景得到测试。因此,需要一个补充的覆盖标准,其中用户可以定义一个测试要求,表征一个给定的行为被覆盖,而不是从一个池中选择预定义的和通用的程序元素。我们提出了UCov,一个用户定义的覆盖标准,其中的测试要求是一个执行模式的程序元素和谓词。我们提出的标准并不是要取代现有的标准,而是要补充它们,因为它将测试集中在重要的代码模式上,否则可能无法测试。UCov支持测试用例意图验证。例如,在bug修复之后,测试团队可能会用揭示bug的测试用例来增强回归套件。但是,由于与错误无关的代码修改,此测试用例可能会过时。但是,如果用户定义了表征错误的执行模式,UCov将确定测试用例意图验证失败。我们实现了我们的方法的Java平台,并将其应用到两个现实生活中的案例研究。我们的实现包括以下内容:1)一个Eclipse插件,允许用户轻松指定非平凡的测试需求; 2)交叉引用测试需求的能力,跨给定程序的后续版本;以及3)检查用户定义的测试需求是否得到满足的能力,即,测试用例意图验证。

英文摘要:

The goal of regression testing is to ensure that the behavior of existing code is not altered by new program changes. The primary focus of regression testing should be on code associated with: a) earlier bug fixes; and b) particular application scenarios considered to be important by the tester. Existing coverage criteria do not enable such focus, e.g., 100% branch coverage does not guarantee that a given bug fix is exercised or a given application scenario is tested. Therefore, there is a need for a complementary coverage criterion in which the user can define a test requirement characterizing a given behavior to be covered as opposed to choosing from a pool of pre-defined and generic program elements. We propose UCov, a user-defined coverage criterion wherein a test requirement is an execution pattern of program elements and predicates. Our proposed criterion is not meant to replace existing criteria, but to complement them as it focuses the testing on important code patterns that could go untested otherwise. UCov supports test case intent verification. For example, following a bug fix, the testing team may augment the regression suite with the test case that revealed the bug. However, this test case might become obsolete due to code modifications not related to the bug. But if an execution pattern characterizing the bug was defined by the user, UCov would determine that test case intent verification failed. We implemented our methodology for the Java platform and applied it onto two real life case studies. Our implementation comprises the following: 1) an Eclipse plugin allowing the user to easily specify non-trivial test requirements; 2) the ability of cross referencing test requirements across subsequent versions of a given program; and 3) the ability of checking whether user-defined test requirements were satisfied, i.e., test case intent verification.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑