若要测试代码,则必须进行部署。
在单独的应用程序中测试代码。
现在我们已经准备好测试代码。
开发人员可以避开缺陷和测试代码。
It allows developers to hide from defects and from testing code.
使用mock对象的测试代码。
在脚本语言中编写应用程序测试代码。
更新后的测试代码如清单6 所示。
假定已经编写了上一节中的测试代码。
Assume that you've already written the test code from the previous section.
底部的测试代码设置值并打印出新值。
The test code at the bottom then sets the value and prints out the new value.
测试代码的输出如图9所示。
清单7:天气Web服务的测试代码。
使用以下测试代码添加新的批处理条目。
测试代码如清单2 所示
简单地说,单元测试是用代码测试代码。
Simply put, unit testing means writing code to test other code.
测试代码如清单10所示。
你还可以直接从设计模型中产生测试代码。
You may also be able to generate test code directly from the design models.
为模型编写测试代码。
清单10.viewport测试代码。
您现在可以测试代码以确保它能够实际起作用。
底部的测试代码只演示了这个语法干净了多少。
The test code at the bottom illustrates just how much cleaner this syntax is.
现在,测试代码清楚地表示出了该测试的意图。
Now the test code clearly represents the intent of the test.
测试代码也需要进行更新,如清单4 所示。
The test code also needs to be upgraded, as shown in Listing 4.
下面到了showaction的测试代码。
彻底地测试代码。
清单6显示用于检查性能的测试代码的主要部分。
Listing 6 shows the main parts of the test code I'll use to check out the performance.
不要使您的测试代码比被测代码更复杂。
Don't make your tests more complicated than the code under test.
测试代码可能比其要测试的代码更复杂。
The test is probably more complicated than the code it's testing.
重构会是一个比从头生成新测试代码更乏味的过程。
Refactoring is a more tedious procedure than generating new test code from scratch.
万一这段测试代码里面有几十上百个定位器怎么办?
What if there are tens or hundreds of locators in the test code?
现在重新测试代码,您发现上述方法仍然不能工作。
应用推荐