That was the kind of thing you saw. Asserts said here are some conditions to test. If they're true, I'm going to let the rest of the code run.
这就是你看到的,断言是一些测试条件,如果他们为真。
Important lesson, so that there would be some predictability in the results and I would have some, if you will, smoke test for knowing whether or not I was getting, my code seemed to be working.
这很重要,因为这样我就可以预测,结果会是多少了,如果你愿意,我们可以做烟气试验,来看我的代码是否工作正常。
First one, when I write a piece of code, especially code that has branches in it, when I design test cases for that piece of code, I should try and have a specific test case for each possible path through the code.
第一点,当我们写代码的时候,尤其是一些含有分支语句的代码的时候,当我为这些代码,设计测试用例的时候,我应该为每一个可能的程序路径,都设计一个特别的用例。
OK.Let's look at the code-- actually, let's test this out first before we do it.
因此我已经添加了,就像Guttag教授做的那样-啊,应该这么说。
应用推荐