If you write code, write tests.
写代码,就一定要写测试。
Do you write tests for your application?
你为你的应用程序写测试吗?
Try to write tests for each thing it does.
尽量为它所做的每件事编写测试。
You should write tests before you write code.
您应该首先编写测试,然后再编写代码。
I show them how to write tests using modern tools.
我告诉他们如何使用现代工具编写测试。
With a little practice, any programmer can write tests first.
采用这一点做法,任何程序员都可以先编写测试。
You can find a few tools that automatically write tests for you.
您能够找到很多可以为您自动编写测试的工具。
The choice of when to write tests is independent of project size.
项目规模并不影响什么时候书写测试的选择。
It's true, when you write tests first, you cannot write a whole algorithm.
是的,当你首先编写测试时,你不能编写一个完整的算法。
Many programmers who don't write tests first don't even know it's an option.
许多没有先编写测试的程序员甚至不知道还可以使用这种方法。
You need to take small steps and write tests that force you to take more steps.
您需要采取一些较小的步骤,然后编写迫使您要采取更多步骤的测试。
It's not hard to write tests that cover simple methods like setters and getters.
编写覆盖像setter和getter这样简单方法的测试代码并不难。
The true power of Rails is that you can write tests as fast as you can write code.
Rails真正强大的地方在于,您可以像编写代码一样快速编写测试。
By the same token, it's more effective to write tests that you know you'll run often.
出于同样的原因,编写那些您知道将要经常运行的测试程序会更有效些。
You have to get used to the idea that you can and should write tests before you write code.
您必须习惯这种思想,在编写代码之前,可以并应该编写测试。
Even if they know how and think it's a good idea, many people still don't write tests first.
即使他们知道如何去做,并认为它是一种好的想法,但许多人仍然没有先编写测试。
Using Cobertura's reports, you can identify the untested parts of the code and write tests for them.
利用Cobertura报告,可以找出代码中未测试的部分并针对它们编写测试。
You write tests before you write the code, solidifying your understanding of what the code needs to do.
先写测试,再编写代码,这样可以巩固您对代码所需执行的操作的理解。
If I frequently don't write tests, then pretty soon I've got a pile of code that isn't covered by tests.
如果我经常不写测试,那么不久会有一堆代码没有经过测试。
In fact, if I tried to write tests for this code, they would technically run but wouldn't ever logically work.
事实上,如果我试着为这段代码编写测试,从技术方面来说它可以运行,但是无法按照逻辑工作。
As you write tests first and get them to pass, you're letting the code tell you what it wants to do and become.
在您先编写测试并通过测试这个过程中,您正在让代码告诉您它想要做什么,以及会成为什么。
You might say that they each allow you to write tests using their own particular dialect of convenience functions.
可以认为它们分别提供一种方便的测试 “方言”,可以用这些 “方言”编写测试。
As a programmer, you should write tests before you write code, then write just enough code to get the tests to pass.
作为一名程序员,应该在编写代码之前编写测试,然后只编写足以让测试通过的代码即可。
More often than not, if they do write tests, they're typically very simple, covering the method's main functional aim.
而且如果需要编写测试,通常都是十分简单、覆盖方法的主要功能目标的测试。
It not only motivates programmers to write tests, it also promotes teamwork and bonding through "You broke the build!" games.
它不但激发程序员去编写测试用例,而且还通过“Youbrokethebuild !”游戏促进了团队之间的合作和融合。
It not only motivates programmers to write tests, it also promotes teamwork and bonding through "You broke the build!" games.
它不但激发程序员去编写测试用例,而且还通过“Youbrokethebuild !”游戏促进了团队之间的合作和融合。
应用推荐