A test suite that will make us feel good about things. For now, I just want you to be aware that you're always doing this balancing act.
测试集呢?一个测试集会让我们的工作,变的舒服多了,现在,我只是想让,大家意识到你们经常需要做这种协调工作。
A test suite is small enough so that we can test it in a reasonable amount of time.
测试集必须小到我们可以在一个,合理的时间内完成他,但是必须大到。
And check the answers, and say yeah that's what we expected. But it also involves reasoning. About why that's an appropriate set of inputs to test it on it.
然后说对,这就是我想要的结果,但是它跟推理也有关系,表现在关于为什么这是一个,测试我们程序的适合的输入集。
So as we look at testing, what we have to find is what's called a test suite.
当我们谈到测试的时候,我们必须明白什么叫做一个测试集。
And when I'm done with the whole thing, before I end the increment of the variable, you know, when I'm done, I'm just not returning anything out.
在循环外面初始化它,然后做一个终结测试,然后在循环内部有一个指令集,在这个例子中,就是对余数做检查,然后显示信息,当我完成了整个循环。
So let's assume we've run our test suite.
让我们假设已经运行了测试集。
I spotted an error here, I could have spotted it by running it on different test sets, and using prints things, another way of doing it, but this idea of at least simulating it on simple examples lets you check a couple of important questions.
操作么?我在这里发现了一个错误,我也可以通过运行不同的测试集,或者运用print声明来发现这个错误,但是至少应该用简单的例子来手工模拟下,代码的思想可以让你,对一些很重要的问题进行检验。
应用推荐