测试驱动开发适合初学者吗? [英] Is Test Driven Development good for a starter?
问题描述
扩展这个关于我如何学会从问题描述到代码传递的问题 两个人提到了 TDD.
Expanding this question on how I learnt to pass from problem description to code Two people mentioned TDD.
对于初学者来说进入 TDD 是否有好处(并避免将来的坏习惯?)或者对于了解编程语言是什么的阶段来说太复杂了?
Would it be good for a starter to get into TDD ( and avoid bad habits in the future ? ) Or would it be too complex for a stage when understand what a programming language is?
推荐答案
TDD 旨在比传统"方法(直到最后才对其进行测试)更简单 - 因为测试阐明了您对问题的理解.如果您实际上不清楚问题出在哪里,那么编写测试是相当困难的.
TDD is meant to be simpler than the "traditional" method (of not testing it till the end) - because the tests clarify what you understand of the problem. If you actually didn't have a clear idea of what the problem was, writing tests is quite hard.
因此,对于初学者来说,编写测试可以让思考朝着正确的方向发展,即契约行为,而不是实现行为.
So for a beginner, writing tests gets the thinking juice going in the right direction, which is contractual behaviour, not implementation behaviour.
这篇关于测试驱动开发适合初学者吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!