130 likes | 134 Views
Sept 16 th , 2019. Testing Your Procedures. Agenda. Preliminaries (8:30-8:35) Quiz Debrief (8:35-8:55) Testing (8:55-9:05) Lab Time (9:05-9:45) Wrap-up (9:45-9:50). Preliminaries (8:30-8:35). Peer Support Events? Women's soccer game Wednesday at 4pm CS Table Tuesday at noon
E N D
Sept 16th, 2019 Testing Your Procedures
Agenda • Preliminaries (8:30-8:35) • Quiz Debrief (8:35-8:55) • Testing (8:55-9:05) • Lab Time (9:05-9:45) • Wrap-up (9:45-9:50)
Preliminaries (8:30-8:35) • Peer Support Events? • Women's soccer game Wednesday at 4pm • CS Table Tuesday at noon • Upcoming Work: • Lab writeup due 10:30pm on Wednesday • Exam 1 goes live on Wednesday • Reading for Wednesday • Quiz on Friday
Quiz Debrief (8:35-8:55) • This was a hard one • Reminder about individual tutors • Dropped last question, too hard
Quiz Debrief (8:35-8:55) • (mouse 5) • ((o dog increment) 5) • ((o (section * <> 2) increment) 5) • Composition is applied right to left • First we increment to get 6 • Then 6 is passed to the section procedure • Section procedure is 6 * 2 to get 12
Quiz Debrief (8:35-8:55) • (moose squirrel) • ((o sqrt (section + <> 5)) 11) • First we apply the section procedure: 11 + 5 = 16 • Then we apply the square root: 4
Quiz Debrief (8:35-8:55) • ((section - <> 2) 5) • The section procedure is an anonymous procedure, but still a valid procedure • 5 is passed to the section procedure: 5 - 2 = 3
Quiz Debrief (8:35-8:55) • (map dog (iota 6)) • (map (section * <> 2) (iota 6)) • (map (section * <> 2) (list 0 1 2 3 4 5)) • Map means that we pass each of the numbers into the anonymous procedure defined by section: ‘(0 2 4 6 8 10)
Quiz Debrief (8:35-8:55) • How to make ‘(1 2 3 4 5 6)? • a is ’(1 2 3) and b is ‘(4 5 6), so (append a b) • How to make ‘(1 2 5 6)? • First two numbers of a: (take a 2) • Last two numbers of b: (drop b 1) • (append (take a 2) (drop b 1) • Last question was dropped, too hard
Quiz Debrief (8:35-8:55) • Input and output types: • map takes a procedure and a list to apply that procedure to (the procedure might be anonymous and that’s okay!) • section takes one input per <> and creates a procedure • o takes one or more procedures and creates a procedure
Testing (8:55-9:05) • Think-pair-share: • What is a test case? • A single test, check if a procedure is doing what you think it should, single post condition • What is a test suite? • Series of test cases, grouped somehow • When should we write tests? • Anytime you write a procedure, after?, when you know what the post conditions should be, in conjunction with documentation, could write before (test-driven development)
Wrap-up (9:45-9:50) • Upcoming Work: • Lab writeup: Exercise 3b, c, and d due 10:30pm on Wednesday • Assignment 3 due Tuesday at 10:30pm • Exam 1 goes live on Wednesday • Reading for Wednesday