Test amplification is a novel technique which extends a manually created test suite with additional test cases to increase the code coverage. The technique is effective, in the sense that it suggests strong and understandable test cases, generally adopted by software engineers. Unfortunately, the current state-of-the-art for test amplification heavily relies on program analysis techniques which benefit a lot from explicit type declarations present in statically typed languages. In dynamically typed languages, such type declarations are not available and as a consequence test amplification has yet to find its way to programming languages like Smalltalk, Python, Ruby and Javascript. We propose to exploit profiling information -readily obtainable by executing the associated test suite- to infer the necessary type information creating special test inputs with corresponding assertions. We evaluated this approach on 52 selected test classes from 13 mature projects in the Pharo ecosystem contain- ing approximately 400 test methods. We show the improvement in killing new mutants and mutation coverage in 33 out of 52 test classes (63%). Moreover, these generated tests are understandable by humans: 10 out of 13 pull-requests submitted were merged into the main code base (76%). These results are comparable to the state-of-the-art, hence we conclude that test amplification is feasible for dynamically typed languages.


翻译:测试放大是一种创新技术,它扩展了人工制作的测试套件,增加了测试案例,从而扩大了代码覆盖范围。该技术是有效的,因为它表明软件工程师普遍采用强力和易懂的测试案例。不幸的是,目前测试放大的先进技术在很大程度上依赖于程序分析技术,这些技术在很大程度上得益于静态类型语言中的明确类型声明。在动态类型语言中,这种类型声明是不存在的,因此,测试扩增尚未找到它去编程语言的方法,如Smalltalk、Python、Ruby和Javascrip。我们提议利用剖析信息――通过执行相关的测试套件可以容易地获得――来推断必要的类型信息,通过相应的描述生成特殊测试投入。我们从13个成熟项目中选择的52个测试类别评估了这一方法,包含大约400种测试方法。我们显示了在53个测试类别(63%)中杀死新变异体和突变异体覆盖范围的改进情况。此外,这些测试为人类所理解的:13个拉普请求中有10个被合并成主要代码基(76 %),这些结果可以与动态测试类型相比较。

0
下载
关闭预览

相关内容

《计算机信息》杂志发表高质量的论文,扩大了运筹学和计算的范围,寻求有关理论、方法、实验、系统和应用方面的原创研究论文、新颖的调查和教程论文,以及描述新的和有用的软件工具的论文。官网链接:https://pubsonline.informs.org/journal/ijoc
专知会员服务
30+阅读 · 2021年9月5日
专知会员服务
38+阅读 · 2020年9月6日
【新书】Python数据科学食谱(Python Data Science Cookbook)
专知会员服务
113+阅读 · 2020年1月1日
强化学习最新教程,17页pdf
专知会员服务
167+阅读 · 2019年10月11日
【新书】Python编程基础,669页pdf
专知会员服务
186+阅读 · 2019年10月10日
[综述]深度学习下的场景文本检测与识别
专知会员服务
77+阅读 · 2019年10月10日
Hierarchically Structured Meta-learning
CreateAMind
23+阅读 · 2019年5月22日
已删除
创业邦杂志
5+阅读 · 2019年3月27日
Call for Participation: Shared Tasks in NLPCC 2019
中国计算机学会
5+阅读 · 2019年3月22日
人工智能 | SCI期刊专刊信息3条
Call4Papers
5+阅读 · 2019年1月10日
Unsupervised Learning via Meta-Learning
CreateAMind
41+阅读 · 2019年1月3日
A Technical Overview of AI & ML in 2018 & Trends for 2019
待字闺中
16+阅读 · 2018年12月24日
disentangled-representation-papers
CreateAMind
26+阅读 · 2018年9月12日
Hierarchical Disentangled Representations
CreateAMind
4+阅读 · 2018年4月15日
【推荐】自然语言处理(NLP)指南
机器学习研究会
35+阅读 · 2017年11月17日
Arxiv
0+阅读 · 2021年10月12日
Arxiv
0+阅读 · 2021年10月11日
Arxiv
0+阅读 · 2021年10月9日
A Survey on Data Augmentation for Text Classification
Arxiv
6+阅读 · 2019年9月4日
VIP会员
相关VIP内容
专知会员服务
30+阅读 · 2021年9月5日
专知会员服务
38+阅读 · 2020年9月6日
【新书】Python数据科学食谱(Python Data Science Cookbook)
专知会员服务
113+阅读 · 2020年1月1日
强化学习最新教程,17页pdf
专知会员服务
167+阅读 · 2019年10月11日
【新书】Python编程基础,669页pdf
专知会员服务
186+阅读 · 2019年10月10日
[综述]深度学习下的场景文本检测与识别
专知会员服务
77+阅读 · 2019年10月10日
相关资讯
Hierarchically Structured Meta-learning
CreateAMind
23+阅读 · 2019年5月22日
已删除
创业邦杂志
5+阅读 · 2019年3月27日
Call for Participation: Shared Tasks in NLPCC 2019
中国计算机学会
5+阅读 · 2019年3月22日
人工智能 | SCI期刊专刊信息3条
Call4Papers
5+阅读 · 2019年1月10日
Unsupervised Learning via Meta-Learning
CreateAMind
41+阅读 · 2019年1月3日
A Technical Overview of AI & ML in 2018 & Trends for 2019
待字闺中
16+阅读 · 2018年12月24日
disentangled-representation-papers
CreateAMind
26+阅读 · 2018年9月12日
Hierarchical Disentangled Representations
CreateAMind
4+阅读 · 2018年4月15日
【推荐】自然语言处理(NLP)指南
机器学习研究会
35+阅读 · 2017年11月17日
Top
微信扫码咨询专知VIP会员