什么是健全性测试/检查

发布于 2024-09-29 19:18:14 字数 22 浏览 9 评论 0原文

它是什么以及为什么使用/有用?

What is it and why is it used/useful?

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

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

发布评论

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

评论(9

站稳脚跟 2024-10-06 19:18:14

健全性测试不以任何方式限制于编程或软件工程的环境。健全性测试只是一个随意的术语,意味着您正在测试/确认/验证应该遵循非常清晰和简单的逻辑的东西。它要求别人确认你没有精神错乱,并且对你来说似乎有意义的事情对他们来说也有意义……或者你是否在过去 4 小时内喝了太多能量饮料来保持理智?

如果你完全不知道为什么一些非常简单的东西不起作用......你会要求某人为你做一个快速的理智测试。让他们确保您在最后 15 次查看时没有忽略 for 循环末尾的分号。极其简单的例子,确实不应该发生,但有时你离某件事太近而无法退后一步看整体。不同的观点有时有助于确保你没有完全疯了。

A sanity test isn't limited in any way to the context of programming or software engineering. A sanity test is just a casual term to mean that you're testing/confirming/validating something that should follow very clear and simple logic. It's asking someone else to confirm that you are not insane and that what seems to make sense to you also makes sense to them... or did you down way too many energy drinks in the last 4 hours to maintain sanity?

If you're bashing your head on the wall completely at a loss as to why something very simple isn't working... you would ask someone to do a quick sanity test for you. Have them make sure you didn't overlook that semicolon at the end of your for loop the last 15 times you looked it over. Extremely simple example, really shouldn't happen, but sometimes you're too close to something to step back and see the whole. A different perspective sometimes helps to make sure you're not completely insane.

痴情 2024-10-06 19:18:14

至少据我了解,冒烟和理智之间的区别在于,冒烟测试是一种快速测试,用于查看构建后应用程序是否足以进行测试。然后,您进行健全性测试,该测试将告诉您某个特定功能区域是否足够好,以至于在该区域进行测试实际上有意义

示例:

冒烟测试:我可以启动应用程序并浏览所有屏幕,并且应用程序不会崩溃。

-如果应用程序崩溃或我无法访问所有屏幕,则此版本确实存在问题,存在需要尽快扑灭的“火灾”,并且该版本不适合测试。

健全性测试(对于用户管理屏幕):我可以进入用户管理屏幕,创建用户并将其删除。

  • 因此,该应用程序通过了冒烟测试,现在我继续对不同区域进行健全性测试。如果我不能依赖应用程序来创建用户并删除它,那么测试更高级的功能(例如用户过期、登录等)是毫无价值的......但是,如果健全性测试已经通过,我可以继续测试这个区域。

The difference between smoke and sanity, at least as I understand it, is that smoke test is a quick test to see that after a build the application is good enough for testing. Then, you do a sanity test which would tell you if a particular functional area is good enough that it actually makes sense to proceed with tests on this area.

Example:

Smoke Test: I can launch the application and navigate through all the screens and application does not crash.

-If application crashes or I cannot access all screens, this build has something really wrong, there is "a fire" that needs to be extinguished ASAP and the vesion is not good for testing.

Sanity Test (For Users Management screen): I can get to Users Management screen, create a user and delete it.

  • So, the application passed the Smoke Test, and now I proceed to Sanity Tests for different areas. If I cannot rely on the application to create a user and to delete it, it is worthless to test more advanced functionalities like user expiration, logins, etc... However, if sanity test has passed, I can go on with the test of this area.
去了角落 2024-10-06 19:18:14

一个很好的例子是数据库连接的健全性检查。

SELECT 1 FROM DUAL

这是一个测试连接的简单查询,请参阅:

SELECT 1 from DUAL: MySQL

不测试深层功能,仅测试连接可以继续。

Good example is a sanity check for a database connection.

SELECT 1 FROM DUAL

It's a simple query to test the connection, see:

SELECT 1 from DUAL: MySQL

It doesn't test deep functionality, only that the connection is ok to proceed with.

陌路终见情 2024-10-06 19:18:14

健全性测试或健全性检查是一种基本测试,用于快速评估声明或计算结果是否可能为真@ http://en.wikipedia.org/wiki/Sanity_testing

A sanity test or sanity check is a basic test to quickly evaluate whether a claim or the result of a calculation can possibly be true @ http://en.wikipedia.org/wiki/Sanity_testing

扮仙女 2024-10-06 19:18:14

冒烟测试用于快速测试新版本的稳定性。
健全性测试是对新部署环境的测试。

Smoke test is for quick test of a new build for its stability.
Sanity test is a test of newly deployed environment.

野鹿林 2024-10-06 19:18:14

健全性检查背后的基本概念是确保运行代码的结果与预期结果一致。除了使用频率远远低于应有的程度之外,适当的健全性检查还有助于确保您正在做的事情不会完全超出范围并因此做一些不应该做的事情。健全性检查最常见的用途是调试行为不当的代码,但即使是最终产品也可以从适当的地方受益,以防止由于 GIGO(垃圾输入,垃圾输出)而出现不需要的错误。

与此相关的是,永远不要低估用户做一些你没想到任何人实际上会做的事情的能力。这是许多程序员永远不会学到的一课,无论教了多少次,而健全性检查是帮助您接受这一点的绝佳工具。 “我永远不会那样做”并不是你的代码无法处理问题的有效借口,良好的健全性检查可以帮助你避免使用这种借口。

The basic concept behind a sanity check is making sure that the results of running your code line up with the expected results. Other than being something that gets used far less often than it should, a proper sanity check helps ensure that what you're doing doesn't go completely out of bounds and do something it shouldn't as a result. The most common use for a sanity check is to debug code that's misbehaving, but even a final product can benefit from having a few in place to prevent unwanted bugs from emerging as a result of GIGO (garbage in, garbage out).

Relatedly, never underestimate the ability of your users to do something you didn't expect anyone would actually do. This is a lesson that many programmers never learn, no matter how many times it's taught, and sanity checks are an excellent tool to help you come to terms with it. "I'd never do that" is not a valid excuse for why your code didn't handle a problem, and good sanity checks can help prevent you from ever having to make that excuse.

终难遇 2024-10-06 19:18:14

对于软件应用程序来说,健全性测试是一组许多测试,这些测试使软件版本在集成新功能和错误修复后可以向公众发布。健全性测试意味着,虽然许多问题可能仍然存在,但非常关键的问题(例如可能导致某人损失金钱或数据或使程序崩溃)已经得到解决。因此,如果没有留下任何关键问题,该版本就通过了健全性测试。这通常是发布前完成的最后一次测试。

For a software application, a sanity test is a set of many tests that make a software version releasable to the public after the integration of new features and bug fixes. A sanity test means that while many issues could remain, the very critical issues which could for example make someone lose money or data or crash the program, have been fixed. Therefore if no critical issues remain, the version passes sanity test. This is usually the last test done before release.

晨敛清荷 2024-10-06 19:18:14

这是一项基本测试,旨在确保某些功能正常工作。

例如:连接到数据库。或者 ping 网站/服务器以查看其是否正常运行。

It is a basic test to make sure that something is simply working.

For example: connecting to a database. Or pinging a website/server to see if it is up or down.

冬天的雪花 2024-10-06 19:18:14

检查一段代码(或其他任何内容,例如 Usenet 帖子)是否存在完全愚蠢的错误的行为。

暗示检查是为了确保作者在写作时神志清醒;

例如,如果一个科学软件依赖于特定的公式并给出了意想不到的结果,那么在查看更复杂的 I/O 或公式之前,人们可能会首先查看括号的嵌套或公式的编码,作为健全性检查。数据结构操作例程,更不用说算法本身了。

The act of checking a piece of code (or anything else, e.g., a Usenet posting) for completely stupid mistakes.

Implies that the check is to make sure the author was sane when it was written;

e.g., if a piece of scientific software relied on a particular formula and was giving unexpected results, one might first look at the nesting of parentheses or the coding of the formula, as a sanity check, before looking at the more complex I/O or data structure manipulation routines, much less the algorithm itself.

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