Back Summary

Session #7

Multiple choice: 15/15 correct ยท Short answer: 0/0 answered · completed Sep 6, 2026

Answers

What is the first major step of the HtDF recipe?

✓ Signature, purpose, and stub

What should a good purpose statement do?

✓ Describe the relationship between the consumed data and produced result

Why is a stub useful before the real function body is written?

✓ It lets tests call the function and run

With a correct stub and meaningful tests for an unfinished function, what is the usual desirable result?

✓ Tests run and fail rather than error

What should guide the choice of test expectations?

✓ The specification and purpose

What is the purpose of a function template in early HtDF?

✓ To show the structural outline and available inputs

Which is the better signature when a function always produces a non-negative whole number?

✓ Image -> Natural

What does it mean that the HtDF recipe is not a waterfall process?

✓ The steps can be revisited when later work reveals a better design

A function tall? has a test only for a tall image. What important problem remains?

✓ The false branch may be untested

If a test fails after the body is implemented, what should you check before changing correct-looking code?

✓ Whether the expected value in the test matches the specification

The specification says a rating is poor when it is less than 4.0. What should happen at exactly 4.0?

✓ It belongs to the next category, not the < 4.0 category

Why are verbose expectations such as (* 2 4.2) sometimes useful?

✓ They document the intended computation, not just the final literal result

What does the Racket naming convention tall? communicate?

✓ The function is expected to produce a Boolean

Which test set best examines a boundary at 25 where values below 25 and values at/above 25 behave differently?

✓ 24.9, 25, and a value just above 25

Why is changing a correct implementation just to satisfy an incorrect test dangerous?

✓ It makes the function conform to a mistaken expectation instead of the specification