尽量为它所做的每件事编写测试。
如何为尚不存在的代码编写测试呢?
How can you write a test for something that doesn't exist yet?
整个理论很棒,但如何先编写测试呢?
All this theory is great, but how do you write a test first?
编写测试要比编写模型代码简单得多。
您应该首先编写测试,然后再编写代码。
也许您不认为先编写测试是一个好主意。
Maybe you don't think writing tests first is such a great idea.
您应该优先编写测试用例。
仅仅编写测试,使它通过。
在我先编写测试时,我有许多奇异的逻辑。
在编写测试的时候,接口就随之浮现出来。
Come up with the interface for that as you're writing the test.
在编写测试前编写代码。
为模型编写测试代码。
您能够找到很多可以为您自动编写测试的工具。
You can find a few tools that automatically write tests for you.
既然已经编写了代码,是时候编写测试用例了。
Now that the code is written, it is time to write the test cases.
采用这一点做法,任何程序员都可以先编写测试。
With a little practice, any programmer can write tests first.
接下来的任务就是编写测试。
编写测试,失败了就实现功能使其通过。
Write tests that fail, then implement the functionality to make them pass.
然后编写测试,编写文档。
在编写测试时,我发现了另一个重要的子任务。
As I wrote tests, I discovered another important decomposed task. Here is the entire list.
是的,当你首先编写测试时,你不能编写一个完整的算法。
It's true, when you write tests first, you cannot write a whole algorithm.
在开始编写测试之前,请选择一个小组公认的框架。
Before you begin, choose a framework that your team agrees upon.
相反,您只需编写测试,然后编写足够的代码使其能通过测试。
Instead, write a test, then write just enough code to get that test to pass.
当然,没有人会编写测试套件对每个语句的结果都进行验证。
Of course, no one writes test suites that independently verify the result of each statement.
根据产品规范编写测试计划,设计测试数据和测试用例;
Writes test plan and designs test date and case base on product specification.
编写测试计划,包含测试方法、实验室和测试资源需求,以及日程安排。
Write a test plan, including test methodology, lab and test resource requirements, and schedule.
下一步,您将为Address_To_AddressCSV数据映射编写测试用例。
Next, you will write a test case for the Address_To_AddressCSV data map.
您必须在编写每个测试时尽量地覆盖尽可能多的方法和分支。
You have to write each test to cover as much as it possibly can.
至此,您已经看到了如何编写单个测试文件。
完成准备工作后,现在我们可以开始编写单元测试了。
With our preparations completed, we can now begin to write unit tests.
完成准备工作后,现在我们可以开始编写单元测试了。
With our preparations completed, we can now begin to write unit tests.
应用推荐