gpt4 book ai didi

testing - 如何设计测试用例

转载 作者:行者123 更新时间:2023-11-28 21:03:08 24 4
gpt4 key购买 nike

对于你们大多数人来说,这可能是一个非常幼稚的问题,但我对此感到有点困惑。

when we have to design a test case for some program, how do we know what is the expected value/outcome. The program might do some complex calculations and use complex algorithms to compute its final output which may not be possible to compute by other means. Even if we were to compute on that same input using other means and then use the output value by that mean as an expected value to test our original program, then how can we be sure that the expected value that was computed from a different program/mean was correct, to be sure that program also has to be tested, and so we are back to square one.

最佳答案

如果一个计算太复杂而无法用计算器在纸上计算出来,那么您甚至如何编写程序呢?即使计算必须小步完成,您也可以在纸上编写几个不同的测试用例,然后在程序中测试计算的那一步,然后逐步完成。计算机只能执行人类告诉它执行的操作。

关于testing - 如何设计测试用例,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7922945/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com