Assessing Mock Classes: An Empirical Study
Assessing Mock Classes: An Empirical Study
复制标题
评估模拟课程:实证研究
DOI:
10.1109/icsme46990.2020.00050
复制
发表时间:
2020
期刊:
影响因子:
--
通讯作者:
André C. Hora
中科院分区:
文献类型:
--
作者:
Gustavo Pereira;André C. Hora
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