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

测试驱动开发过程的剖析:首先测试还是最后测试真的重要吗?

A Dissection of the Test-Driven Development Process: Does It Really Matter to Test-First or to Test-Last?

Davide Fucci, Hakan Erdogmus, Burak Turhan, Markku Oivo, Natalia Juristo

摘要:

背景:测试驱动开发(TDD)是一种重复与测试交错的短编码周期的技术。开发人员首先编写所需功能的单元测试,然后编写必要的产品代码,并重构代码。许多实证研究忽略了与TDD迭代性质相关的独特过程特征。目的:我们制定了四个过程特征:顺序,粒度,一致性和重构工作。我们研究这些特性如何影响TDD和相关变体的质量和生产力。方法:我们分析了从39名专业人士收集的82个数据点,每个数据点都捕获了执行特定开发任务时使用的过程。我们建立了回归模型来评估过程特性对质量和生产率的影响。质量通过功能正确性来衡量。结果:质量和生产率的提高主要与粒度和均匀度呈正相关。测试和生产代码编写的顺序,没有重要的影响。重构努力与这两个结果呈负相关。我们解释了意外的负相关性与质量的可能流行的混合重构。结论:TDD声称的好处可能不是由于其独特的测试优先动态,而是由于类似TDD的过程鼓励细粒度的,稳定的步骤,以改善焦点和流程。

英文摘要:

Background: Test-driven development (TDD) is a technique that repeats short coding cycles interleaved with testing. The developer first writes a unit test for the desired functionality, followed by the necessary production code, and refactors the code. Many empirical studies neglect unique process characteristics related to TDD iterative nature. Aim: We formulate four process characteristic: sequencing, granularity, uniformity, and refactoring effort. We investigate how these characteristics impact quality and productivity in TDD and related variations. Method: We analyzed 82 data points collected from 39 professionals, each capturing the process used while performing a specific development task. We built regression models to assess the impact of process characteristics on quality and productivity. Quality was measured by functional correctness. Result: Quality and productivity improvements were primarily positively associated with the granularity and uniformity. Sequencing, the order in which test and production code are written, had no important influence. Refactoring effort was negatively associated with both outcomes. We explain the unexpected negative correlation with quality by possible prevalence of mixed refactoring. Conclusion: The claimed benefits of TDD may not be due to its distinctive test-first dynamic, but rather due to the fact that TDD-like processes encourage fine-grained, steady steps that improve focus and flow.

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

↑