尽量为它所做的每件事编写测试。
为现有代码编写测试可能是个挑战。
如何为尚不存在的代码编写测试呢?
How can you write a test for something that doesn't exist yet?
先编写测试用例会降低重构中的风险。
先编写测试还使您知道该类何时完成。
Writing tests first additionally lets you know when the class is complete.
整个理论很棒,但如何先编写测试呢?
All this theory is great, but how do you write a test first?
编写测试要比编写模型代码简单得多。
我告诉他们如何使用现代工具编写测试。
只管打开您的IDE并且开始编写测试。
您应该首先编写测试,然后再编写代码。
也许您不认为先编写测试是一个好主意。
Maybe you don't think writing tests first is such a great idea.
您应该优先编写测试用例。
或许某些人不希望编写测试打断工作流。
Perhaps some people don’t like the fact that writing tests first interrupts the flow.
仅仅编写测试,使它通过。
在我先编写测试时,我有许多奇异的逻辑。
在编写测试的时候,接口就随之浮现出来。
Come up with the interface for that as you're writing the test.
在先编写测试时,必须习惯故意只看眼前。
When writing tests first, you have to get used to being intentionally shortsighted.
在编写测试前编写代码。
为模型编写测试代码。
在编写测试时,请务必考虑这一附加的依赖性。
Account for this added dependency when you write your tests.
您能够找到很多可以为您自动编写测试的工具。
You can find a few tools that automatically write tests for you.
编写测试时,一定要注意所编写测试的质量。
When you're writing tests, be mindful of the quality of the tests you write.
既然已经编写了代码,是时候编写测试用例了。
Now that the code is written, it is time to write the test cases.
为servlet和JSP编写测试。
AM团队是编写测试的专家,他们应该进行均衡。
Am teams are experts at writing tests, they should be leveraged.
总之,测试函数可以极大地增强编写测试的简便性。
Above all, test functions vastly enhance what might be called the writability of tests.
在编写测试的同时您也就熟悉了未知代码的内部构造。
You explore the internals of the unknown code while writing the tests.
是的,当你首先编写测试时,你不能编写一个完整的算法。
It's true, when you write tests first, you cannot write a whole algorithm.
我的意思是,您只需假定您正在为其编写测试的类已经存在。
What I mean is that you simply pretend that the class you are writing the test for exists.
首先编写测试用例,并且只编写足以让测试用例通过的代码。
Write your test cases first, and write only enough code to make your test case pass.
应用推荐