CSC108H1 Lecture : november 09 notes
16 views1 pages
yifanyang and 39659 others unlocked
21
CSC108H1 Full Course Notes
Verified Note
21 documents
Document Summary
Carrying on w/ testing: write your header and doctstring, plan your test cases most important, implement your code, implement your tests. Example function: 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: int n2. """, # rest of function, good test casese/examples: Lists that has/doesn"t have n1; empty list; 1 itemed list, small # of items, large # of items. Occurrence of n1: 0, once, small # of times, large # of times, first item of list, last item of list, middle item of list, if n1 = n2. L = [7, 5, 2, 9, 14] L = [7, 5, 5, 9, 14] L = [17, 9, 8, 9, 4, 12] Implementing test cases: use a program to help be organed and efficient about testing, nose is a module written for this. Testing w/ nose suppose you are testing module called mod.
Get access
Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers