“没有单元测试,”我们齐声道。
没有单元测试重构照样能够工作。
我想,一些简单的重构可以在没有单元测试的情形下进行。
I imagine some simple refactorings can be performed even without unit testing in place.
如果你没有单元测试,你的代码里也不会有公共的Mock对象或其它测试技术。
If you have no unit testing, you also don't have mock objects or other testing techniques common in code.
从测试的角度来看,有单元测试总是好于没有单元测试,但有些单元测试又好于其他一些单元测试。
From the testing standpoint, any unit tests are always better than no unit tests, but some unit tests are better than others.
如果您没有单元测试,那么在这个阶段引入它可能是个好主意(例如,如果您在“使它运行”阶段没有找到使用它的机会)。
If you don't have unit tests, it might be a good idea to start introducing them in this stage (if you didn't get around to it in the "get it running" stage, for example).
如果没有明显的问题,并且能够运行单元测试,那么即可放心地继续下去了。
If there are no obvious problems and you can run the unit tests, you're good to go.
关于开发的文章没有完全不讨论自动单元测试的。
No paper on development is complete without a discussion of automated unit testing.
没有包括开发团队编写自动化单元测试的任务。
Not including a task for the development team to write automated unit tests.
随着系统的复杂程度的增加,并且有这么多工具可供使用,没有什么理由不依靠单元测试。
As systems' complexities increase, and with so many tools at our disposal, there's little reason to not rely on unit tests.
当我们编写单元测试时,我们应该尽量编写没有副作用的代码,IO当然也属于这一类。
When we write unit tests we should strive for code that is free of side effects, and IO certainly falls under this category.
这很有挑战性,因为单元测试中没有网络,AJAX调用会失败。
This is challenging because there is no network in a unit test and the AJAX call will fail.
服务用例的服务测试没有什么不同,不过更多地将其看作功能测试,而不是单元测试。
Service tests for service use cases are no different, although they may be thought of more as functional tests than unit tests.
AndresAguiar也曾经在他的blog上谈论说,如果我们在完善抽象这一方面投入足够的精力,那么就没有必要进行TDD,甚至是单元测试了。
Andres Aguiar has also been arguing on his blog that if enough efforts are put in refining the abstraction, there would be no need for TDD and even for Unit Testing.
目前,没有工具可用于对Portlet进行单元测试。
Currently, there are no tools available to unit test the portlets.
团队分支是红色的,表示它不太稳定;例如:这个分支通过了单元测试,但是它可能还没有完成集成测试,所以还没有稳定到可以发布的状态。
The team branch is red to highlight that it is less stable, i.e. the stuff on that branch passes the unit tests but it might not be integration tested and might not be stable enough for release.
如果我相当长一段时间都在进行开发,而没有编写相应的单元测试,我就会觉得紧张。
If I'm developing for long stretches of time without having written corresponding unit tests, I get the jitters.
如果没有测试框架,编写一套可维护的自动化单元测试几乎是不可能的。
Writing a suite of maintainable, automated unit tests without a testing framework is virtually impossible.
对我来说,单元测试是快速运行的 测试,通常测试没有大的外部依赖项(如数据库)的单独的类。
To me, unit tests are fast running tests that typically test individual classes that don't have heavy external dependencies like databases.
关键是有大量合适的单元测试工具提供给每一个开发人员,因此缺少工具不再被认为是没有创建单元测试的理由。
The point is that there are many adequate unit testing tools available to every developer, so the lack of tools can no longer be used as an excuse for not producing unit tests.
就像单元测试一样,如果没有测试框架,编写一套可维护的自动化功能测试实际上是不可能的。
Like unit tests, writing a suite of maintainable, automated functional tests without a testing framework is virtually impossible.
由于没有很好地将示例代码库划分成mvc代码,这导致它自身很容易地进行编程序测试,因此没有使用自动化单元测试或持续集成系统。
Because the example codebase was not well divided into MVC code that lends itself to easy programmatic testing, automated unit test or continuous integration system was not used.
尽管我没有展示以前版本的单元测试,但实际上所有的示例都已经进行了测试。
Even though I haven't shown the unit tests for previous versions, all the examples have tests.
在早期的项目中我们没有计划这种额外的单元测试的工作,开发人员感到了十分可怕的压力并匆忙的使他们的代码进入集成计划。
On earlier projects where we hadn't scheduled this additional unit-testing effort, developers felt terribly pressured and rushed to get their code into the integration plan.
未维护的或不正确的单元测试比根本没有进行单元测试更有害。
Unmaintained or incorrect unit tests are worse than no testing at all.
如果没有可测试的单元,那么就很难编写出单元测试。
It's difficult to write a unit test if there's no unit to test.
通常单元测试与功能测试之间并没有明确的界限。
Often it isn't clear where to draw the line between unit and functional testing.
一是他们会花上可怕的时间写单元测试,他们就没有时间来提高产品质量。
One, they would have spent an awful lot of time writing unit tests, and they wouldn't necessarily be able to pay for that time in improved quality.
没有了这层保护膜,正如单元测试集合(test suite)所说,什么事情都有可能发生。
Without that protection, anything may happen-as is demonstrated by the unit test suite.
您仍然希望利用JUnit为那些没有利用Web而调用的逻辑创建单元测试。
You will still want to use JUnit to create unit tests for logic that are called without a Web harness.
应用推荐