看到了吗?这么多代码只是为了支持两行测试代码!
Look at all of the scaffolding that was necessary to support two actual lines of test code!
后一栏显示了执行测试时这一行被执行的次数。
The next column shows the number of times that line is executed during the test run.
第一行执行测试。
可能仍然涉及到成千上万行代码,不过可以单独进行测试。
This may still run into thousand lines of code, but it can be debugged and tested independently.
最后的两行负责在这个测试类内部运行测试,方法是直接运行该模块即可。
Finally, the two lines at the bottom allow you to run the tests within this test class by simply running this module.
Cobertura通过用额外的语句记录在执行测试包时,哪些行被测试到、哪些行没有被测试到,通过这种方式来度量字节码,以便对测试进行监视。
Cobertura monitors tests by instrumenting the bytecode with extra statements to log which lines are and are not being reached as the test suite executes.
带有 EE 的第三行显示了测试的结果。
对于规范中定义的各个UI动作,在单元测试中创建一行说明。
For each UI gesture defined in the specification, create a line in your unit test.
我们的回归测试套件的代码已经超过了10,000行。
We have a regression test suite with over 10,000 Lines Of Code.
要完成这项操作,可以将记录器生成的三行代码封装到测试脚本的某个单独方法中。
To accomplish this, you can wrap the three lines of code produced by the recorder into a separate method in your test script.
用红色突出显示的那些行则根本没有测试到。
这表明行覆盖的确不能很好地指示测试的有效性。
It turns out that line coverage isn't such a great indicator of test effectiveness.
为只有一行代码的标记编写测试看起来似乎有些过分,但是很多时候问题的源头正是这一行代码。
Writing a test for a simple one-line tag might seem excessive, but you'd be surprised how many times the one-liners end up being the source of trouble.
在表中,每个测试用例占一行。
在关闭中间循环之前(该循环表示行),测试row元素是否为空。
Before closing the middle loop, which represents rows, test whether the row element is empty.
作为响应,我可以编写一个测试,它将达到100%的行覆盖率。
In response, I can write one test, which achieves 100 percent line coverage.
列表3.更新新的行指针,并返回测试数据。
快速导航到使测试失败的代码行。
RationalPurifyPlus向他通告任何内存泄漏,确保每一行代码都被测试。
Rational PurifyPlus informs him of any memory leaks, and ensures that every line of code is tested.
切勿替换或除去这三行,否则WebSphere测试环境可能无法正确启动。
Do not replace or remove these three lines, or the WebSphere Test Environment may fail to start up properly.
Blogito仍然不足200行代码—并且这还包含了单元和集成测试。
Blogito is still fewer than 200 lines of code - and that includes the unit and integration tests.
表中的第一行显示要测试的fixture名称。
The first row in the table shows the name of the fixture to be tested.
这种“一网打尽”的做法能确保用每个模型使用一行代码即可调用所有模型测试中存在的关系。
This catch-all ensures that with a single line of code per model, I can invoke all relationships on all of our model tests.
如果你已经测试了每一行代码你会怎么做?
How could you if you have tested virtually every line of code?
完全的覆盖是非常昂贵的并且很难达到,因为我们必须要手工的检查我们的代码以确定哪一行代码没有被测试覆盖到。
Full coverage was very expensive and difficult to achieve, because we had to hand-inspect our code to determine which lines were and were not hit by the test.
一方面,存在测试妄想狂,他们希望能测试自己写的每一行代码。
On one side we have the testing fanatics, who want to test every single line of code they write.
对于只涉及少量到中等数量的行的查询,两个测试数据库之间的性能差异可以忽略不计。
For queries that touch only a small to medium number of rows, the performance difference between the two test databases was negligible.
然后它生成一个HTML或者xml格式的报告,指出代码中的哪些包、哪些类、哪些方法和哪些行没有测试到。
It then produces a report in HTML or XML that shows exactly which packages, classes, methods, and individual lines of code are not being tested.
假设您想添加代码来跟踪在运行某些测试时构造函数中哪些代码行真正得到执行。
Suppose you want to add code to track which lines of the constructor actually get executed while running some tests.
为了让事情更为有趣,我们需要一个更好的包含了几千行代码的测试。
To make this more interesting, we need a better test that will include a few thousand rows.
应用推荐