unit-testing - 由外向内 TDD : Should I check in failing acceptance tests?

标签 unit-testing testing tdd acceptance-testing

因此,您从失败的验收测试开始,然后通过单元测试构建功能,直到验收测试通过。但是当您通过单元测试时,您是否应该 checkin 源代码管理?如果这样做,是否将验收测试标记为忽略(如果是,在何处?在代码中或在构建服务器上)?这如何适应持续集成?

最佳答案

不,您不应该 checkin 失败的测试,在持续集成环境中,您应该始终保持代码可发布,根据定义,失败的验收测试表明代码当前不是可发布。

While it’s failing, an acceptance test demonstrates that the system does not yet implement that feature; when it passes, we’re done.
Growing Object-Oriented Software Guided by Tests by Steve Freeman and Nat Pryce

如果您担心失去进度,或者想保留您的更改,请将它们暂时存储为搁置集,这样您的更改就在服务器上,并且在您无法继续工作时可供其他开发人员使用功能,但同样地,团队有一个工作构建,另一个开发人员可以从中分支以进行其他更改,或者可以将他们完成的功能与之集成。

我不会说得这么强烈,但这几乎可以概括 -

43. Share code only when ready. Never check in code that’s not ready for others. Deliberately checking in code that doesn’t compile or pass its unit tests should be considered an act of criminal project negligence.
Practices of an Agile Developer by by Venkat Subramaniam and Andy Hunt.

关于unit-testing - 由外向内 TDD : Should I check in failing acceptance tests?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35138745/

相关文章:

testing - 我为什么要实践测试驱动开发,我应该如何开始?

unit-testing - 您如何对具有复杂输入输出的方法进行单元测试

javascript - 学习测试 Vue.js 项目 : product display list

unit-testing - Flutter 测试通过子文本查找

java - Java 中基于时间的逻辑单元测试

java - 如何在 "tell, don' 中进行单元测试并询问“追随者类?”

python - 如何在 Python 单元测试中从命令行启动服务器

amazon-web-services - 清理测试装置

ruby-on-rails - 使用 Cucumber 进行测试的 "strange"(可能是 "extreme"或 "crazy")方法

android - 如何在 Android 中检查与配对设备的蓝牙连接状态