All learning paths Learn See Try Make Find the input that breaks it What this lesson is about Try the empty case, the huge case, and the case in another script. Most code fails on one of them.
Your friend's attendance app works, and she shows it to a teacher in ten minutes. What do you type into it?
A Type three more names of the kind that already work, to be sure nothing has changed. B Ask her which inputs she has covered, and test only the ones she missed. C Try five inputs first: nothing, one, very many, a negative, and Devanagari text.
Check my recall Why this matters Most code is tested on the input its author already had in mind. The failures live just outside that: an empty box, a very long name, a name in another script. Finding one in ten minutes is worth more than an hour of reading.
Find the input that breaks a working program, and write it up so nobody finds it twice.
Most code is tested on the input its author already had in mind. The failures live just outside that: an empty box, a very long name, a name in another script. Finding one in ten minutes is worth more than an hour of reading.
Try five inputs first: nothing, one, very many, a negative, and Devanagari text. Devanagari, a name with a space and a very long string are normal here, not rare. Write the breaking input down as a test case, so nobody has to find it twice. Task You get ten minutes with a friend's attendance app before she shows it to a teacher.
Weak approach Types three more English names of the same shape and watches all three save correctly. The app is called ready for the teacher, and nothing new was tried.
Stronger approach Sends nothing at all, then a Devanagari name, then three hundred letters. The first two save wrongly: the blank row is accepted and the Devanagari turns into question marks.
Why the stronger approach works The weak run repeats an input that already worked. The strong run found the failure the classroom will find.
Try a changed situation A team's test list for a delivery app holds only English names and short addresses. Their users are in Gorakhpur. What is missing?
Make something yourself Take one small program. Try five inputs on it: empty, one, very many, a negative, and Devanagari text. Write what each did, then write the breaking one up as a test case.
Lesson 6 of 10 on Coding for evaluation work next Compare two code answers fairly Part 2 ends in a work sample you can send The rules this work sample is read against
Read the primary or official source: Python documentation · unittest