既然已经编写了代码,是时候编写测试用例了。
Now that the code is written, it is time to write the test cases.
您应该优先编写测试用例。
但是,我的兴奋不是来自编写测试用例,而是看着它们生效。
My high, however, isn't from writing the test cases; it's in seeing their results.
首先编写测试用例,并且只编写足以让测试用例通过的代码。
Write your test cases first, and write only enough code to make your test case pass.
然后,编写测试用例以验证方面正确地与目标交互,如清单4 所示
Then, you would write your test case to verify that the aspect correctly interacts with the target, as shown in Listing 4
我需要向测试员解释所有的功能应当如何运转,并且协助他们编写测试用例。
I met with the testers explaining how things were supposed to work and helping them plan how to test everything.
相应地,我可以编写测试用例来验证XMLUnit的行为,如清单6所示。
Accordingly, I can write a test case to verify XMLUnit's behavior, as shown in Listing 6.
也许你正在为这些类库编写测试用例,但是发现这是一个让人烦躁的工作。
Perhaps you're writing a test suite for such a library and find writing the testing code a tedious task.
将首先编写测试用例,然后将通过编写满足各个测试用例的代码来进行实现。
The test cases are written first, and implementation proceeds by writing code to satisfy each test case.
下一章,我们要谈论编写测试用例,以及接下来的经常让人沮丧的调试任务。
In the next chapter, we will talk about writing test cases and the often frustrating task of debugging that follows.
如果查看整个迭代,将看到更多内容:您捕获了一个重要需求并编写测试用例实现需求。
If you look at the whole iteration, you should see more: you captured an important requirement and wrote a test case to enforce that requirement.
下一步,您将为Address_To_AddressCSV数据映射编写测试用例。
Next, you will write a test case for the Address_To_AddressCSV data map.
基于特定基础编写测试用例:测试团队通常在他们的闲暇时间尝试创建自动化测试用例。
Programming test cases on an AD hoc basis: test groups often try to create automated test cases in their spare time.
有一个名为“Testing”的bucket,其中没有包括用于编写测试用例的时间。
Having a bucket called "Testing" that doesn't include the time for writing the test cases.
它不但激发程序员去编写测试用例,而且还通过“Youbrokethebuild !”游戏促进了团队之间的合作和融合。
It not only motivates programmers to write tests, it also promotes teamwork and bonding through "You broke the build!" games.
这使您能够在实现使用SDO数据类型和数据映射的业务流程(SCA模块)之前,首先为SDO数据类型和数据映射编写测试用例。
This enables you to write test cases for the SDO data types and data maps first before implementing the business processes (SCA modules) that use them.
请求路径和参数映射好之后,编写测试用例就成了利用MockStrutsTestCaseAPI设置相关口令值的问题,如清单6所示。
With the request path and parameters mapped, writing a test case becomes a matter of utilizing the MockStrutsTestCase API to set associated values, as shown in Listing 6.
本文演示了如何为数据映射编写测试用例,以及如何使用JUnit和Cactus在WebSphereProcessserver容器中运行它们。
This article demonstrated how to write test cases for data maps and to run them inside the WebSphere Process Server container using JUnit and Cactus.
与通常一样,我在清单12中编写了几个测试用例以验证它按预想的那样工作。
As usual, I write a few test cases in Listing 12 to verify things work as expected.
敏捷软件开发和极限编程二者均提倡在开发源代码之前编写单元测试用例。
Agile software development and extreme programming both promote writing unit test cases before developing the source code.
您首先想到的可能是:到重构的时间了,但这样做将打破第一个重构规则,即将编写一个测试用例。
Your first thought could be that it's time to refactor, but doing so would break the first rule of refactoring, which is to write a test case.
清单5看起来很简单,但是我为它编写了几个测试用例,看看会是什么情况。
Listing 5 looks pretty simple, but let's see what happens when I write a few test cases for it.
与预期一样,测试用例失败—我并没有编写处理多个转换的触发器方法。
As expected, the test case fails-i have not written a trigger method that will handle more than one transition.
以为通过在白板上编写一个个测试用例就可以产生清晰架构的想法简直就是胡闹。
The notion that you can generate a viable architecture by starting with a blank screen and then writing one test case after the other is sheer folderol.
当然,这种灵活意味着我必须为删除单词编写至少两个测试用例,如清单10所示。
Of course, being so flexible means that I must write at least two test cases for removing a word, as shown in Listing 10.
相反,我编写根据类中的方法运行所有单元测试用例的类。
Instead, I would write the class that runs all the unit test cases against the methods in the class.
第一个选择是编写普通的JUnit测试用例,就像以前一直做的那样,扩展JUnit令人称赞的TestCase。
The first option is to write normal JUnit test cases just as you've been doing all along by extending JUnit's commendable TestCase.
您可以编写一些用后即扔的样例代码,但是如果FixedList 将投入到生产中,您最好立即为其编写一些测试用例。
You could write some throwaway sample code, but if FixedList is going into production, you'd be better served by immediately writing some test cases for it.
在这个案例研究的环境中,Draft状态表示这个测试用例已经编写但是还没有被执行。
In the context of this case study, the Draft state indicated that the test case was written but had not been executed yet.
为了演示,我不得不修复一个bug,我过去为它编写了测试用例,但是没有跟踪修复它。
For the demonstration I had to fix one bug I'd written a test case for but hadn't yet tracked down and stomped.
应用推荐