我是否应该在尚未使用 TDD 的项目上开始使用它 [英] Should I start using TDD on a project that doesn't use it already

查看:17
本文介绍了我是否应该在尚未使用 TDD 的项目上开始使用它的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个项目,我已经工作了一段时间,只是我希望有朝一日发布到开源的那些小项目之一.

I have a project that I have been working on for a while, just one of those little pet projects that I would like to one day release to open source.

现在我大约在 12 个月前开始了这个项目,但我只是轻轻地做它,我刚刚开始把更多的时间集中在它上面(几乎每天晚上).

Now I started the project about 12 months ago but I was only working on it lightly, I have just started to concentrate a lot more of my time on it(almost every night).

因为它是一个类似应用程序的框架,我有时会在方向感上挣扎,因为我没有任何东西来驱动我的设计决策,有时我最终会制作出难以使用甚至难以找到的功能.我一直在阅读有关如何进行 TDD 的文章,并认为这可能会帮助我解决我遇到的一些问题.

Because it is a framework like application I sometimes struggle with a sense of direction due to the fact I don't have anything driving my design decisions and I sometimes end up making features that are hard to use or even find. I have been reading about how to do TDD and thought maybe this will help me with some of the problems that I am having.

那么问题是,您认为在尚未使用 TDD 的项目上开始使用 TDD 是个好主意吗.

So the question is do you think it's a good idea to start using TDD on a project that doesn't already use it.

我刚刚添加了一点来澄清我所说的与方向感"斗争的意思,如果没有澄清,这不是最好的说法.

I have just added a bit to clarify what I mean by struggle with a "sense of direction", it properly wasn't the best thing to say without clarification.

推荐答案

在我看来,采用更好的实践或放弃更糟糕的实践永远不会太晚,所以我会说是的,你应该开始".

In my opinion, it's never too late to adopt a better practice - or to drop a worse one - so I'd say "Yes, you should start".

然而......(总有一个但是")......

However ... (there's always a "but") ...

... TDD 最大的好处之一是它会影响您的设计,鼓励您将责任分开,交互干净等等.

... one of the biggest gains of TDD is that it impacts on your design, encouraging you to keep reponsibilties separate, interactions clean and so on.

在项目的这个阶段,您可能会发现很难为框架的某些方面编写测试.但是不要放弃,即使你不能测试某些领域,你的质量会随着你可以测试的领域变得更好,你的技能也会随着体验而提高.

At this point in your project, you may find it difficult to get tests written for some aspects of your framework. Don't give up though, even if you can't test some areas, your quality will be the better for the areas you can test, and your skills will improve for the experience.

这篇关于我是否应该在尚未使用 TDD 的项目上开始使用它的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆