Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
824 views
in Technique[技术] by (71.8m points)

unit-testing - 什么是单元测试,集成测试,冒烟测试和回归测试?(What are unit tests, integration tests, smoke tests, and regression tests?)

What are unit tests, integration tests, smoke tests, and regression tests?

(什么是单元测试,集成测试,冒烟测试和回归测试?)

What are the differences between them and which tools can I use for each of them?

(它们之间有什么区别,我可以为每个工具使用哪些工具?)

For example, I use JUnit and NUnit for unit testing and integration testing.

(例如,我将JUnit和NUnit用于单元测试和集成测试。)

Are there any smoke testing or regression testing tools?

(有烟雾测试或回归测试工具吗?)

  ask by mcaaltuntas translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
  • Unit test : Specify and test one point of the contract of single method of a class.

    (单元测试 :指定并测试一个类的单一方法合约的一点。)

    This should have a very narrow and well defined scope.

    (这应该具有非常狭窄且定义明确的范围。)

    Complex dependencies and interactions to the outside world are stubbed or mocked .

    (对外部世界的复杂依赖关系和交互行为是存根或嘲笑的 。)

  • Integration test : Test the correct inter-operation of multiple subsystems.

    (集成测试 :测试多个子系统之间的正确互操作。)

    There is whole spectrum there, from testing integration between two classes, to testing integration with the production environment.

    (从两类之间的测试集成,到与生产环境的测试集成,整个过程都有。)

  • Smoke test (aka Sanity check) : A simple integration test where we just check that when the system under test is invoked it returns normally and does not blow up.

    (冒烟测试(也称为健全性检查) :一种简单的集成测试,我们只检查被测系统被调用时,它会正常返回并且不会崩溃。)

    • Smoke testing is both an analogy with electronics, where the first test occurs when powering up a circuit (if it smokes, it's bad!)...

      (冒烟测试与电子设备都类似,在第一次通电时会为电路加电(如果冒烟,那就很糟糕!)。)

    • ... and, apparently , with plumbing , where a system of pipes is literally filled by smoke and then checked visually.

      (...,而且显然水暖管道 ,管道系统实际上是由烟雾填充的,然后进行目视检查。)

      If anything smokes, the system is leaky.

      (如果有任何冒烟,则表明系统泄漏。)

  • Regression test : A test that was written when a bug was fixed.

    (回归测试 :修复错误后编写的测试。)

    It ensures that this specific bug will not occur again.

    (它确保不会再次发生此特定的错误。)

    The full name is "non-regression test".

    (全名是“非回归测试”。)

    It can also be a test made prior to changing an application to make sure the application provides the same outcome.

    (也可以是在更改应用程序之前进行的测试,以确保应用程序提供相同的结果。)

To this, I will add:

(为此,我将添加:)

  • Acceptance test : Test that a feature or use case is correctly implemented.

    (验收测试 :测试功能或用例是否正确实现。)

    It is similar to an integration test, but with a focus on the use case to provide rather than on the components involved.

    (它类似于集成测试,但侧重于提供的用例,而不是所涉及的组件。)

  • System test : Tests a system as a black box.

    (系统测试 :将系统测试为黑匣子。)

    Dependencies on other systems are often mocked or stubbed during the test (otherwise it would be more of an integration test).

    (在测试过程中,通常会嘲笑或打断对其他系统的依赖关系(否则,它更像是一个集成测试)。)

  • Pre-flight check : Tests that are repeated in a production-like environment, to alleviate the 'builds on my machine' syndrome.

    (飞行前检查 :在类似于生产的环境中重复进行的测试,以减轻“在我的机器上构建”综合症。)

    Often this is realized by doing an acceptance or smoke test in a production like environment.

    (通常,这是通过在类似生产的环境中进行验收或冒烟测试来实现的。)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...