Similarly to production code, code smells also occur in test code, where they are called test smells. Test smells have a detrimental effect not only on test code but also on the production code that is being tested. To date, the majority of the research on test smells has been focusing on programming languages such as Java and Scala. However, there are no available automated tools to support the identification of test smells for Python, despite its rapid growth in popularity in recent years. In this paper, we strive to extend the research to Python, build a tool for detecting test smells in this language, and conduct an empirical analysis of test smells in Python projects. We started by gathering a list of test smells from existing research and selecting test smells that can be considered language-agnostic or have similar functionality in Python's standard Unittest framework. In total, we identified 17 diverse test smells. Additionally, we searched for Python-specific test smells by mining frequent code change patterns that can be considered as either fixing or introducing test smells. Based on these changes, we proposed our own test smell called Suboptimal assert. To detect all these test smells, we developed a tool called PyNose in the form of a plugin to PyCharm, a popular Python IDE. Finally, we conducted a large-scale empirical investigation aimed at analyzing the prevalence of test smells in Python code. Our results show that 98% of the projects and 84% of the test suites in the studied dataset contain at least one test smell. Our proposed Suboptimal assert smell was detected in as much as 70.6% of the projects, making it a valuable addition to the list.


翻译:与生产代码相似, 代码的气味也出现在测试代码中, 它被称为测试气味。 测试气味不仅对测试代码有害, 而且对正在测试的生产代码也有害。 到目前为止, 测试气味的大部分研究都集中在诸如 Java 和 Scala 等编程语言上。 然而, 还没有可用的自动工具支持识别 Python 的测试气味, 尽管近年来Python 的流行程度迅速增长。 在本文中, 我们努力将研究扩大到 Python 的测试气味, 建立一个工具来检测该语言的测试气味, 并且对Python 项目中的测试气味进行实证分析。 根据这些变化, 我们提议在现有的研究中收集现有测试气味清单清单清单, 并选择可被视为语言Agnorest或Python标准框架中类似功能的测试气味。 总的来说, 我们发现了17种不同的测试气味。 此外, 我们搜索了Python 特定测试气味的气味, 一种可以被视为固定或引入测试气味。 基于这些变化的气味, 我们提议在Pythimal的气味测试PyC 测试模型中, 我们建议在大规模的气质测试模型中进行一次测试性测试性测试, 我们在大规模的气态中提出了一种测试性测试性测试, 在大规模的气态中, 在大规模的气态中, 在大规模测试中, 在大规模的气态中, 最后的气态中测中测中测中, 。

0
下载
关闭预览

相关内容

Python是一种面向对象的解释型计算机程序设计语言,在设计中注重代码的可读性,同时也是一种功能强大的通用型语言。
专知会员服务
87+阅读 · 2021年4月12日
Linux导论,Introduction to Linux,96页ppt
专知会员服务
76+阅读 · 2020年7月26日
Python图像处理,366页pdf,Image Operators Image Processing in Python
Python计算导论,560页pdf,Introduction to Computing Using Python
专知会员服务
70+阅读 · 2020年5月5日
资源|Blockchain区块链中文资源阅读列表
专知会员服务
43+阅读 · 2019年11月20日
Keras François Chollet 《Deep Learning with Python 》, 386页pdf
专知会员服务
144+阅读 · 2019年10月12日
2019年机器学习框架回顾
专知会员服务
35+阅读 · 2019年10月11日
机器学习相关资源(框架、库、软件)大列表
专知会员服务
37+阅读 · 2019年10月9日
盘一盘 Python 系列 8 - Sklearn
平均机器
5+阅读 · 2019年5月30日
人脸检测库:libfacedetection
Python程序员
15+阅读 · 2019年3月22日
已删除
将门创投
3+阅读 · 2018年4月10日
Python机器学习教程资料/代码
机器学习研究会
8+阅读 · 2018年2月22日
Python | 50行代码实现人脸检测
计算机与网络安全
3+阅读 · 2018年1月23日
【推荐】免费书(草稿):数据科学的数学基础
机器学习研究会
19+阅读 · 2017年10月1日
【推荐】用Tensorflow理解LSTM
机器学习研究会
36+阅读 · 2017年9月11日
【推荐】Python机器学习生态圈(Scikit-Learn相关项目)
机器学习研究会
6+阅读 · 2017年8月23日
【推荐】(Keras)LSTM多元时序预测教程
机器学习研究会
24+阅读 · 2017年8月14日
Arxiv
8+阅读 · 2021年4月21日
Arxiv
24+阅读 · 2020年3月11日
Factor Graph Attention
Arxiv
6+阅读 · 2019年4月11日
Arxiv
12+阅读 · 2019年4月9日
Arxiv
4+阅读 · 2018年12月20日
Arxiv
4+阅读 · 2018年10月5日
VIP会员
相关VIP内容
专知会员服务
87+阅读 · 2021年4月12日
Linux导论,Introduction to Linux,96页ppt
专知会员服务
76+阅读 · 2020年7月26日
Python图像处理,366页pdf,Image Operators Image Processing in Python
Python计算导论,560页pdf,Introduction to Computing Using Python
专知会员服务
70+阅读 · 2020年5月5日
资源|Blockchain区块链中文资源阅读列表
专知会员服务
43+阅读 · 2019年11月20日
Keras François Chollet 《Deep Learning with Python 》, 386页pdf
专知会员服务
144+阅读 · 2019年10月12日
2019年机器学习框架回顾
专知会员服务
35+阅读 · 2019年10月11日
机器学习相关资源(框架、库、软件)大列表
专知会员服务
37+阅读 · 2019年10月9日
相关资讯
盘一盘 Python 系列 8 - Sklearn
平均机器
5+阅读 · 2019年5月30日
人脸检测库:libfacedetection
Python程序员
15+阅读 · 2019年3月22日
已删除
将门创投
3+阅读 · 2018年4月10日
Python机器学习教程资料/代码
机器学习研究会
8+阅读 · 2018年2月22日
Python | 50行代码实现人脸检测
计算机与网络安全
3+阅读 · 2018年1月23日
【推荐】免费书(草稿):数据科学的数学基础
机器学习研究会
19+阅读 · 2017年10月1日
【推荐】用Tensorflow理解LSTM
机器学习研究会
36+阅读 · 2017年9月11日
【推荐】Python机器学习生态圈(Scikit-Learn相关项目)
机器学习研究会
6+阅读 · 2017年8月23日
【推荐】(Keras)LSTM多元时序预测教程
机器学习研究会
24+阅读 · 2017年8月14日
相关论文
Arxiv
8+阅读 · 2021年4月21日
Arxiv
24+阅读 · 2020年3月11日
Factor Graph Attention
Arxiv
6+阅读 · 2019年4月11日
Arxiv
12+阅读 · 2019年4月9日
Arxiv
4+阅读 · 2018年12月20日
Arxiv
4+阅读 · 2018年10月5日
Top
微信扫码咨询专知VIP会员