Unit testing is a stage of testing where the smallest segment of code that can be tested in isolation from the rest of the system - often a class - is tested. Unit tests are typically written as executable code, often in a format provided by a unit testing framework such as pytest for Python. Creating unit tests is a time and effort-intensive process with many repetitive, manual elements. To illustrate how AI can support unit testing, this chapter introduces the concept of search-based unit test generation. This technique frames the selection of test input as an optimization problem - we seek a set of test cases that meet some measurable goal of a tester - and unleashes powerful metaheuristic search algorithms to identify the best possible test cases within a restricted timeframe. This chapter introduces two algorithms that can generate pytest-formatted unit tests, tuned towards coverage of source code statements. The chapter concludes by discussing more advanced concepts and gives pointers to further reading for how artificial intelligence can support developers and testers when unit testing software.


翻译:单位测试是一个测试阶段,在这个阶段中,可以在与系统其他部分分离的情况下进行最小部分的代码(通常是一个等级)测试。单位测试通常以可执行代码的形式写成,通常采用Python测试等单位测试框架提供的格式。创建单位测试是一个时间和精力密集的过程,有许多重复的手工元素。为了说明AI如何支持单位测试,本章引入了基于搜索的单位测试生成概念。这一技术将选择测试输入作为一个优化问题来设置。我们寻求一系列符合测试者某些可测量目标的测试案例,并启用了强大的计量经济学搜索算法,以确定在限制的时间框架内可能的最佳测试案例。本章引入了两种算法,可以生成以测试格式格式显示单位测试的单位测试测试,并调整到源代码说明的覆盖范围。本章最后讨论了更先进的概念,并让指针进一步阅读人工智能如何在单位测试软件时支持开发者和测试者。

0
下载
关闭预览

相关内容

Automator是苹果公司为他们的Mac OS X系统开发的一款软件。 只要通过点击拖拽鼠标等操作就可以将一系列动作组合成一个工作流,从而帮助你自动的(可重复的)完成一些复杂的工作。Automator还能横跨很多不同种类的程序,包括:查找器、Safari网络浏览器、iCal、地址簿或者其他的一些程序。它还能和一些第三方的程序一起工作,如微软的Office、Adobe公司的Photoshop或者Pixelmator等。
【PAISS 2021 教程】概率散度与生成式模型,92页ppt
专知会员服务
32+阅读 · 2021年11月30日
专知会员服务
50+阅读 · 2021年8月8日
专知会员服务
82+阅读 · 2020年12月5日
最新《联邦学习Federated Learning》报告,Federated Learning
专知会员服务
86+阅读 · 2020年12月2日
【经典书】C语言傻瓜式入门(第二版),411页pdf
专知会员服务
51+阅读 · 2020年8月16日
Keras François Chollet 《Deep Learning with Python 》, 386页pdf
专知会员服务
143+阅读 · 2019年10月12日
强化学习最新教程,17页pdf
专知会员服务
167+阅读 · 2019年10月11日
【新书】Python编程基础,669页pdf
专知会员服务
186+阅读 · 2019年10月10日
机器学习入门的经验与建议
专知会员服务
89+阅读 · 2019年10月10日
Call for Participation: Shared Tasks in NLPCC 2019
中国计算机学会
5+阅读 · 2019年3月22日
Unsupervised Learning via Meta-Learning
CreateAMind
41+阅读 · 2019年1月3日
A Technical Overview of AI & ML in 2018 & Trends for 2019
待字闺中
15+阅读 · 2018年12月24日
机器学习线性代数速查
机器学习研究会
18+阅读 · 2018年2月25日
Python机器学习教程资料/代码
机器学习研究会
8+阅读 · 2018年2月22日
计算机类 | 期刊专刊截稿信息9条
Call4Papers
4+阅读 · 2018年1月26日
推荐|Andrew Ng计算机视觉教程总结
全球人工智能
3+阅读 · 2017年11月23日
【推荐】视频目标分割基础
机器学习研究会
9+阅读 · 2017年9月19日
【推荐】SVM实例教程
机器学习研究会
17+阅读 · 2017年8月26日
Arxiv
15+阅读 · 2021年12月22日
Arxiv
9+阅读 · 2021年10月26日
Arxiv
18+阅读 · 2020年10月9日
Generative Adversarial Networks: A Survey and Taxonomy
VIP会员
相关VIP内容
【PAISS 2021 教程】概率散度与生成式模型,92页ppt
专知会员服务
32+阅读 · 2021年11月30日
专知会员服务
50+阅读 · 2021年8月8日
专知会员服务
82+阅读 · 2020年12月5日
最新《联邦学习Federated Learning》报告,Federated Learning
专知会员服务
86+阅读 · 2020年12月2日
【经典书】C语言傻瓜式入门(第二版),411页pdf
专知会员服务
51+阅读 · 2020年8月16日
Keras François Chollet 《Deep Learning with Python 》, 386页pdf
专知会员服务
143+阅读 · 2019年10月12日
强化学习最新教程,17页pdf
专知会员服务
167+阅读 · 2019年10月11日
【新书】Python编程基础,669页pdf
专知会员服务
186+阅读 · 2019年10月10日
机器学习入门的经验与建议
专知会员服务
89+阅读 · 2019年10月10日
相关资讯
Call for Participation: Shared Tasks in NLPCC 2019
中国计算机学会
5+阅读 · 2019年3月22日
Unsupervised Learning via Meta-Learning
CreateAMind
41+阅读 · 2019年1月3日
A Technical Overview of AI & ML in 2018 & Trends for 2019
待字闺中
15+阅读 · 2018年12月24日
机器学习线性代数速查
机器学习研究会
18+阅读 · 2018年2月25日
Python机器学习教程资料/代码
机器学习研究会
8+阅读 · 2018年2月22日
计算机类 | 期刊专刊截稿信息9条
Call4Papers
4+阅读 · 2018年1月26日
推荐|Andrew Ng计算机视觉教程总结
全球人工智能
3+阅读 · 2017年11月23日
【推荐】视频目标分割基础
机器学习研究会
9+阅读 · 2017年9月19日
【推荐】SVM实例教程
机器学习研究会
17+阅读 · 2017年8月26日
Top
微信扫码咨询专知VIP会员