修复它之前,首先编写一个测试。
所以下一步就是为这个方法编写一个测试。
我们应该编写一个测试应用程序来处理这些中断。
A test application should be written to handle these interrupts.
首先用一条未监护的日志语句编写一个测试案例。
编写一个测试。
编写一个测试。
作为响应,我可以编写一个测试,它将达到100%的行覆盖率。
In response, I can write one test, which achieves 100 percent line coverage.
当每个类都有了至少一个测试,再为每一个方法编写一个测试。
Once every class has at least one test, write one test for every method.
当每个程序包都有了至少一个测试,再为每一个类编写一个测试。
Once every package has at least one test, write one test for every class.
每次编写新代码时,添加一个测试,每次修复一个bug时,编写一个测试。
Every time you write new code, add a test, and every time you fix a bug, write a test.
同样,一般情况下要为每个控制器编写一个功能测试。
Again, generally you write one functional test for each controller you have.
现在您有一个即将失败的测试程序,它将告诉您真正需要编写那些代码。
Now you have a failing test that tells you exactly what code to write.
自动化测试意味着编写一个软件来测试其它软件。
Automated testing means that you write software to test other software.
也许您不认为先编写测试是一个好主意。
Maybe you don't think writing tests first is such a great idea.
一般情况下,要为每个模型编写一个单元测试。
编写一个失败的测试。
将一个大块的程序分解成几个小部分进行编写和测试。
修改任何代码前先编写一个会失败的简短测试。
例如,一个测试用例要么没有被编写,要么已经编写但是没有运行。
For example, a test case can be either not written or written but not run yet.
为了澄清这一点,我编写了一个程序进行一些测试。
是的,当你首先编写测试时,你不能编写一个完整的算法。
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.
通常您编写的第一个串行化测试就是用于验证串行化是否可行的测试。
The first serialization test you usually write is one that verifies serialization is possible.
标准的TDD只编写能够使一个测试失败的足够多的代码。
现在,让我们来编写一个执行测试查询的简单应用程序(请参见清单2)。
So, let's write a simple app to perform a test query (see Listing 2).
编写另外一个测试。
这个测试使用了一个手动编写的 mock对象来替换FrogMobile。
This test uses a hand-written mock object to replace the FrogMobile.
在编写测试时,我发现了另一个重要的子任务。
As I wrote tests, I discovered another important decomposed task. Here is the entire list.
这种方法为对测试日志编写一条信息提供了一种快捷的方式,或者以refactoring的方式提供了一个值。
This method provides a shortcut for writing a message to the test log.
并配有一个简易的Delphi编写的服务端用与测试。
And is equipped with a simple server written in Delphi use and testing.
应用推荐