基于 Java 的回归测试

发布于 2024-12-05 12:10:54 字数 1436 浏览 4 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

芯好空 2024-12-12 12:10:54

回归测试与语言无关。这是一种用于确保未来的代码更改不会破坏现有功能的技术。在 Java 中,您可以使用 junit 或 testng 或其他任何东西。通常,回归测试是功能测试,而不是纯粹的单元测试。

Regression testing has nothing to do with a language. It is a technique that is used to ensure future code changes do not break existing features. In Java you can use junit or testng or anything else. Typically a regression test is a functional test and is not a pure unit test.

小草泠泠 2024-12-12 12:10:54

JUnit 通常针对单元测试而不是全面的功能测试(如果将系统作为一个整体来看待,回归测试就是一个例子)。

然而,使用单独的测试套件来执行连接到实际后端等的“繁重”功能和集成测试并根据预期验证结果的情况并不罕见。

这里使用 JUnit 的原因之一是能够使用依赖注入从“模拟测试”转向实际的功能测试。例如,您可以在较轻的测试中提供一个模拟协作者,并在完整的功能测试中提供一个实际的协作者实例。

JUnit is generally aimed for unit tests rather than full-scale functional testing (of which regression testing is an example if one is looking at the system as a whole).

However, it is not uncommon to use a separate test suit to perform "heavy" functional and integration tests that connect to actual backends, etc., and verify results against expectations.

One reason for the use of JUnit here is the ability to go from 'mocked tests' to actual functional tests using dependency injection. You could provide, for example, a mock collaborator in the lighter test, and an actual collaborator instance in the full functional test.

风铃鹿 2024-12-12 12:10:54

回归测试是任何捕获回归的测试。

如果您想要接受测试,我听说过关于 FitNesse 的好消息。

A regression test is any test that catches regressions.

If you want acceptance tests I've heard good things about FitNesse.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文