What I am talking about today, I will not be testing you, but maybe you might pay attention because about a month from now we will ask you a few skill testing questions about it.
我说的是今天,我等会不会测试你,但是你可能会重视了,因为一个月之前,我们问了你关于一些测试的技能。
For instance in the past, we had that silly little program for computing the average of some quizzes and it was actually a pretty bad implementation because I had essentially hard coded in the number of quizzes.
比如在以前,我们做了一个,计算平均数的程序,这是一个相当挫的实现,因为我硬编码了测试的数字。
So when I was out of school, mom sent me to take an exam, IQ exam.
这之后,我妈妈送我去做一个测试,是一个智商的测试。
So one of the things I want you to notice here is that testing and debugging are not the same thing. When we test, we compare an input output pair to a specification.
这里我想大家注意的一件事,就是测试和调试是不同的两件事情,我们测试的时候,我们把输入输出,跟程序的规格说明书对比下。
You're going to get these personality tests all the time and the personality tests-- You're applying for a business and " one of the tests says "I like to steal from my bosses " Well, I don't think so No That's a little IQ test right there ? So, the question is how do you avoid that problem?
你们以后会做很多这样的性格测试,例如:你求职时做性格测试,其中一题是“我想偷老板的东西“,不,我不会,这相当于一个智商测试,问题在于,你怎么避免那个问题?
In this case, I probably want to make sure I use absolute value of x before I carry it on. Yes ma'am.
在这个例子中,我可能想确定,在进行测试前我用的是x的绝对值,什么问题?
I'm expecting the value that test to be a Boolean. Followed by a colon.
我希望测试的结果值的类型,是Boolean的,后面是个冒号。
Well, one answer is because what I-- how I score on that test isn't going to tell you anything about me It's not going to relate to my grades It's not going to relate to how well I'm liked ? How do we know the SAT is useful?
一个原因是,我在那个测试中的得分,不会透露出任何我的信息,与我的学习成绩无关,也不会说明我有多受欢迎,我们怎么知道SAT有没有用?
应用推荐