W9_nose - Testing 1 Design, Code, Verify! This is what we...

Info iconThis preview shows pages 1–6. Sign up to view the full content.

View Full Document Right Arrow Icon
Testing 1
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Design, Code, Verify! This is what we have been doing all along. As soon as we code something, we should see if it is correct In fact, we design tests before we write code. Why? By stating what we expect to see we state our understanding of what we're supposed to do. Saves a lot of time: we can Fnd out if we're wrong before we write even one line of code. And writing the tests is necessary, whether we do it before or after coding. Why? 2 2
Background image of page 2
Professionalism Here, many just want a good grade -> so you test (your own or our self-tests). When you're a professional: Others depend on your work (sometimes a lot ) Your boss needs to be convinced that what you built actually works You (or the company) may be legally liable for the correctness of your software 3 3
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Choosing test cases def insert_after (L, n1, n2): '''L is a list of ints; n1 and n2 are ints. After each occurrence of n1 in L, insert the integer n2.''' A function to test 4
Background image of page 4
Properties of the inputs Inputs Property of the inputs Values to try L length 0, 1, longer L, n1 number of occurrences of n1 in L 0, 1, more L, n1 position of n1 in L front, back, somewhere else 5
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 6
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 04/26/2011 for the course CS a48 taught by Professor Michael during the Fall '10 term at University of Toronto- Toronto.

Page1 / 18

W9_nose - Testing 1 Design, Code, Verify! This is what we...

This preview shows document pages 1 - 6. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online