先写测试,再编写代码,这样可以巩固您对代码所需执行的操作的理解。
You write tests before you write the code, solidifying your understanding of what the code needs to do.
BillVenners:既然先写测试与考虑如何设计接口是相关的,那么它们是否是一回事?
Bill Venners: If writing the test first kind of correlates to thinking about designing the interface, then it is kind of the same thing.
在编码之前先写测试强迫你申明函数运行的环境,以及与客户代码交流的方法, 以及渴望的结局。
By writing the tests first—before the code—you are compelled to state the context in which your functionality will run, the way it will interact with the client code, and the expected results.
MartinFowler:我之所以采用逐步设计以及先写测试的方法,是因为这样做使我有了一个简明扼要的任务列表。
Martin Fowler: the thing I like about taking small steps and writing tests first is that it gives me a simple to do list of the things I've got to do.
XP要求您在写代码之前先写测试,所以简单设计是以一种测试当先(test - first)的方式逐渐增长的。
XP demands that you write tests before you write code, so a simple design is one that grows over time in a test-first manner.
不管是使用一个CDN或者是您自己下载DojoToolkit文件,您都可以利用预先写入的且已测试的函数的优势。
Using either one of the CDNs or downloading the Dojo Toolkit files yourself, you can take advantage of prewritten and tested functions.
在修复bug之前,要先写自动化测试以重现这些bug。
Before fixing bugs write automated tests that reproduce them.
我们用的是测试驱动的方法,首先写一个我们希望通过的测试,一旦这个测试通过,我们再回头看我们可以怎么来优化代码。
We did it test-driven, starting with a test that we wanted to succeed and once it passed we looked into how we could improve the code.
原型和补丁模式:一种开发模式,先写一个程序的草稿,然后测试,再改正发现的错误,这样逐步演化的开发模式。
A development plan that involves writing a rough draft of a program, testing, and correcting errors as they are found.
测试驱动开发是在写实际的代码前先写单元测试代码。
Test Driven Development is the practice of writing unit tests for your code before you actually write that code.
测试驱动开发的基本概念是你在写代码之前,你先写一小块代码,用于测试你假想的项目代码是否实现了预期的行为。
The basic concept of test-driven development is that before writing project code, you write a simple piece of code that tests your hypothetical project code for desired behavior.
测试驱动开发的基本概念是你在写代码之前,你先写一小块代码,用于测试你假想的项目代码是否实现了预期的行为。
The basic concept of test-driven development is that before writing project code, you write a simple piece of code that tests your hypothetical project code for desired behavior.
应用推荐