Assessing Mock Classes: An Empirical Study

Assessing Mock Classes: An Empirical Study
复制标题

评估模拟课程:实证研究

DOI:
10.1109/icsme46990.2020.00050
复制
发表时间:
2020
期刊:
2020 IEEE International Conference on Software Maintenance and Evolution (ICSME)
影响因子:
--
通讯作者:
André C. Hora
André C. Hora
中科院分区:
--
文献类型:
--
作者:
Gustavo Pereira;André C. Hora

文献摘要

参考文献

被引文献

相似文献

在测试活动期间,开发人员经常依赖于依赖关系(例如,Web服务等),这使得测试更难实现。在这种情况下,他们可以使用模拟对象来模拟依赖项的行为,这有助于使测试快速和隔离。在实践中,模拟依赖项可以在mocking框架的支持下动态创建,也可以在mock类中手动编写。虽然研究文献对前者进行了很好的探讨,但尚未对后者进行研究。评估mock类将为更好地理解开发人员如何创建和使用这些mock以及检测新的实践和挑战提供基础。在本文中,我们提供了第一个实证研究,以评估模拟类。我们分析了12个流行的软件项目,检测604模拟类,并评估其内容,设计和使用。我们发现mock类:通常模拟域对象、外部依赖项和Web服务;通常是层次结构的一部分;大多数是公共的,但1/3是私有的;并且主要由客户端项目使用,特别是用于支持Web测试。最后,根据我们的研究结果,我们提供的影响和见解的研究人员和从业人员与模拟类。
During testing activities, developers frequently rely on dependencies (e.g., web services, etc) that make the test harder to be implemented. In this scenario, they can use mock objects to emulate the dependencies’ behavior, which contributes to make the test fast and isolated. In practice, the emulated dependency can be dynamically created with the support of mocking frameworks or manually hand-coded in mock classes. While the former is well-explored by the research literature, the latter has not yet been studied. Assessing mock classes would provide the basis to better understand how those mocks are created and consumed by developers and to detect novel practices and challenges. In this paper, we provide the first empirical study to assess mock classes. We analyze 12 popular software projects, detect 604 mock classes, and assess their content, design, and usage. We find that mock classes: often emulate domain objects, external dependencies, and web services; are typically part of a hierarchy; are mostly public, but 1/3 are private; and are largely consumed by client projects, particularly to support web testing. Finally, based on our results, we provide implications and insights to researchers and practitioners working with mock classes.
DOI: 10.1109/icst.2017.19
发表时间: 2017-03
期刊: 2017 IEEE International Conference on Software Testing, Verification and Validation (ICST)
影响因子: --
作者:
Andrea Arcuri;G. Fraser;René Just
通讯作者: Andrea Arcuri;G. Fraser;René Just