arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2305.03431cs.SE
收藏

聆听专家之声:揭示Stack Exchange社区的测试坏味道知识

Hearing the voice of experts: Unveiling Stack Exchange communities' knowledge of test smells

Luana Martins, Denivan Campos, Railana Santana, Joselito Mota Junior, Heitor Costa, Ivan Machado

AI总结:

本研究通过分析Stack Exchange社区的讨论数据,探究开发者对测试坏味道的认知、对应的修正措施及重构挑战,发现开发者更关注他人实操经验,且更常询问测试坏味道的实践优劣而非重构建议。

摘要:

重构是在不改变整体功能和可观测行为的前提下,改善代码设计的转换操作。在存在坏味道的测试代码的重构过程中,从业者可能难以识别重构候选对象,也难以定义并应用修正策略。本文报告了一项实证研究,旨在了解Stack Exchange网络中对测试坏味道和测试重构的讨论情况。开发者通常依赖Stack Exchange来汲取行家经验,也就是“查阅”其他人如何完成类似任务。因此,借助Stack Exchange讨论主题的数据,我们可以研究开发者如何理解和看待测试坏味道、他们为处理这些问题采取的修正措施,以及他们在为修复测试坏味道而重构测试代码时面临的挑战。我们观察到,开发者对他人处理测试代码问题的看法和实操经验很感兴趣。此外,有明确迹象表明,相比基于代码的重构建议,开发者更常询问测试坏味道或反模式是好的还是坏的测试实践。

英文摘要:

Refactorings are transformations to improve the code design without changing overall functionality and observable behavior. During the refactoring process of smelly test code, practitioners may struggle to identify refactoring candidates and define and apply corrective strategies. This paper reports on an empirical study aimed at understanding how test smells and test refactorings are discussed on the Stack Exchange network. Developers commonly count on Stack Exchange to pick the brains of the wise, i.e., to `look up' how others are completing similar tasks. Therefore, in light of data from the Stack Exchange discussion topics, we could examine how developers understand and perceive test smells, the corrective actions they take to handle them, and the challenges they face when refactoring test code aiming to fix test smells. We observed that developers are interested in others' perceptions and hands-on experience handling test code issues. Besides, there is a clear indication that developers often ask whether test smells or anti-patterns are either good or bad testing practices than code-based refactoring recommendations.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑