如何使用自动化来测试涉及高度复杂计算的应用程序?

发布于 2024-07-13 05:41:05 字数 145 浏览 12 评论 0原文

我想测试涉及复杂计算的应用程序时遵循以下内容:

  1. 如何使用测试自动化工具来测试计算?(使用QTP或开源工具等自动化工具)
  2. 在测试计算时如何确定覆盖范围,如何设计测试用例?

提前致谢, 泰斯特曼

I want to following things for testing a application involving complex calculations:

  1. How to use test automation tools for testing calculations?(using automation tools like QTP or open source tools)
  2. How to decide coverage while testing calculations, how to design test cases?

Thanks in advance,
Testmann

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

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

发布评论

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

评论(3

流年已逝 2024-07-20 05:41:05

我们必须在我们构建的应用程序中测试一些非常复杂的计算。 为此,我们使用了一个名为 FitNesse 的工具,它是一个 wiki 测试工具(也是开源的)。 当您以表格样式格式提供数据时,它的效果非常好。

我们有一些 C# 代码可以执行一些非常复杂的计算。 所以我们所做的就是在 FitNesse 中编写一个测试工具,然后我们为其提供大量测试数据。 我们非常努力地涵盖所有情况,因此我们利用了一种内部真值表来确保我们获得数据输入的每种可能的组合。

FitNesse 测试工具对我们来说非常宝贵,因为随着时间的推移,由于需求的变化,计算的复杂性也发生了变化。 我们能够确保计算的正确性,因为我们的 FitNesse 测试充当了非常好的回归套件。

We had to test some really complex calculations in an application we built. To do this we used a tool call FitNesse, which is a wiki test harness (and open source too). It works really well when you provide it data in a table style format.

We had some code in C# that perform some VERY complex calculations. So what we did is wrote a test harness in FitNesse, and then we supplied it with a lot of test data. We worked very hard to cover all cases, so we utilized a sort of internal truth-table to ensure we were getting every possible combination of data input.

The FitNesse test harness has been invaluable to us as the complexity of the calculations has changed over time due to changing requirements. We've been able to ensure the correctness of the calculations because our FitNesse tests act as a very nice regression suite.

你不是我要的菜∠ 2024-07-20 05:41:05

有时,您必须估计预期的结论,然后从程序运行中填充测试用例。

只要你确信它是正确的,这并不是什么大罪。 如果代码更改破坏了代码,这些测试将立即让您知道。 另外,如果您正在测试一个子集,那么信任的范围就不那么大了。

为了覆盖? 至少覆盖每个分支一次(即任何 if 或循环语句)。 覆盖每个阈值及其两侧(对于整数除法,分母为 -1、0 和 1)。 然后再添加一些以达到良好的效果。

Sometimes, you have to estimate the expected conclusion, and then populate the test case from a run of the program.

It's not so much of a mortal sin, as long as you're convinced it's correct. Those tests will then let you know immediately if a code change breaks the code. Also, if you're testing a subset, it's not that big of a stretch of trust.

And for coverage? Cover every branch at least once (that is, any if or loop statements). Cover every threshold, both sides of it (for integer division that would be -1, 0, and 1 as denominators). Then add a few more in for good measure.

缱绻入梦 2024-07-20 05:41:05

要测试现有代码,您应该假设代码(大部分)是正确的。 所以你只需给它一些数据,运行它并记录结果。 然后在测试用例中使用记录的结果。

当您进行下一次更改时,您的输出也应该发生变化,并且测试将失败。 将新结果与您的预期进行比较。 如果存在差异,那么您就遗漏了一些东西 -> 编写另一个测试来弄清楚发生了什么。

通过这种方式,您可以积累有关未知系统的专业知识。

当您要求覆盖范围时,我假设您无法为实际计算创建覆盖范围数据。 在这种情况下,只需确保执行所有计算并为其提供多个输入即可。 这应该会让您知道如何继续。

To test existing code, you should assume that the code is (mostly) correct. So you just give it some data, run it and record the result. Then use that recorded result in a test case.

When you do the next change, your output should change too and the test will fail. Compare the new result with what you'd have expected. If there is a discrepancy, then you're missing something -> write another test to figure out what is going on.

This way, you can build expertise about an unknown system.

When you ask for coverage, I assume that you can't create coverage data for the actual calculations. In this case, just make sure that all calculations are executed and feed them with several inputs. That should give you an idea how to proceed.

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