Testing Guidelines For Functions

Sunday, Mar 27, 2022
Design

Writing tests before writing the function body is an important step in the design process. It helps us to think of concrete examples which are simpler to devise than a general solution. Using concrete examples wrapped in well-formed tests help break writing the general body into manageable steps. Next question to ponder is how many tests to write? While there is no fixed answer, the structure of data helps us here form some good guidelines: