Why? Because that block identifies a set of things that I'm going to do if the test is true.
为什么呢?这是因为这一块指令,指定了一系列的要进行的操作,如果测试为真的话。
A remember about the Periodic Table test which will be added next week on the 23rd.
我要提醒你们,下周23号将会有个周期表测试。
And that's basically trying to make sure our program has not regressed, as to say, gone backwards in how well it works. And so we always test it on everything.
这只是从根本上确保,我们的程序并没往后退,也就是说在可用性方面倒退了,因此我们在任何东西上,都要进行这样的测试。
Imagine you have a math test and this is the front of the math test.
假设要做一个数学测试,这是数学测试卷的正面。
But before telling you about this let me sort of Go through some of the hypothesis that we have and That we are now testing about why the subject is Difficult and why these materials assembled what We have assembled them might be useful.
但是谈那之前我要说说,我们之前的一些假设,我们现在正在测试为什么这个学科很难,以及为什么我们整合这些资料是有用的,我们认为把它们整合起来或许有用。
What I'd like to do--and this will be the first time I've the clicker thing in the class so let's try out this little quiz and see how it works.
我想要--这是我第一次,在课上使用表决器,所以我们先做个小测试看看效果如何
So how do you test that?
要如何测试呢?
And I end up going back and doing unit testing anyway, to try and figure out why it doesn't work. So over the years, I've just convinced myself I might as well start where I'm going to end up.
第一次从来不会正常运行,因此无论如何我还要回头去做单元测试,找找哪儿出错了,因此经过这么多年,我已经说服自己既然一定要做单元测试,那么还是一开始就做最好了。
Well, let's do the smoke test number one: is the mean more or less what we expected?
好了,让我们先做1号发烟测试:,这个平均值是和我们想要的答案差不多吗?
In binary search-- ah, there's that wonderful phrase, this is called a version of binary search just like you saw bin-- or bi-section methods, - when we were doing numerical things- in binary search, I need to keep track of the starting point and the ending point of the list I'm looking at.
就是当我们处理数字的时候,所称的二分检索,在二分法搜索中,我需要记录区间的开始点和尾点,初始化的时候就是-,问题输入的开始点和尾点,当我开始做测试的时候,我想要做的就是去取中值点。
The tests will be written in the normal class period.
测试是要在常规的课堂时间写出来。
We're checking the end test and incrementing, actually I was going to, I commented that out for a reason you'll see in a second, but I, normally I would keep this on, which would let me, at each step, see what it's doing. If I ran this, it would print out each step. Which is helping me make sure that it's incrementing the right way.
对不对?进行终结测试然后递增,实际上我要,因为某些你们,马上要明白的原因我把这里注释了,但是我通常会一直这么做,这样能让我看到每一步都做了什么,如果我运行这个程序,它会在每一步都,进行显示,这能帮助我让我确信程序是,在以正确的方式递增。
And, you must take the test.
所以,你们一定要参加测试。
Why do I give you a test?
我为什么要给你一个测试?
I want to talk a little bit about an individual difference in our social natures and then I want people to do a test that will explore where you stand on a continuum.
今天我要讲的个体差异,是属于社会性的,我会让你们做一个测试,来弄清楚你们在这个测试中处于什么位置。
And that's because it's easier to test small things than big things. And it's easier to debug small things than big things.
这是因为对小一点的对象,进行测试比对大一点的对象进行测,试要简单多了,调试也是如此。
We'll test our hypothesis, or at least examine it again see if it's, in some sense, repeatable.
我们要测试我们的假设或者至少再检查一下,让我们看看它的结果是不是可以接受的。
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.
然后说对,这就是我想要的结果,但是它跟推理也有关系,表现在关于为什么这是一个,测试我们程序的适合的输入集。
The third thing I'm going to do, is I need to set up the right end test.
我要做的第三件事情,就是需要设置正确的完结测试。
All right, so we've tested it, and we haven't tested it yet we have tested it but, we haven't seen it, well, you know what I'm going to do?
好,我保存下,这有点儿烦,不过能让字体更大点儿,好,我们已经得到了要比较的对象了,但是还没对它们进行比较测试?
Yeah, I've still got a binding for z and I'm giving it the same test, but notice now I've got the two same commands but they have different indentation.
对,我还是对z进行了绑定,我还是要对它进行同样的测试,但是请注意现在我有了两个同样的命令,但是它们有不同的缩进。
应用推荐