Part 16. HtDF with Interval Data Definition
We have defined the data definition for an interval, now we will make the function using HtDF recipeThe example asks us to make a function that produces true if the given seat number is an aisle
For reference, look at the interpretation of data definition, it seems that seats 1 and 32 are aisle seats.
Here we make the Signature, Purpose and Stub.
Now we make the tests, When making tests for Intervals, include the first and last value and also the midpoints. Include also test for other points of variance across the interval.
Thanks to the Data definition provided, this helped us to create our test. HtDD and HtDF are related which can help us to design our functions.
And finally, we just copy the template from the Data Definition, make sure you point that out. Comment out the stub and create the code.
The function fulfills the requirements in the problem domain. Data definitions can help us define the templates and the tests.
Mga Komento
Mag-post ng isang Komento