6.2 Top-Down Design 161 down design and saying, “If the levels below this are correct, does this level do what needs to be done?” Let’s apply this strategy to test the address list solution. Here is the problem statement: Create an address list that includes each person’s name, address, telephone number, and e-mail address. This list should then be printed in alphabetical order. The names to be included in the list are on scraps of paper and business cards. The main module consists of four steps: entering the names, filling in the missing data, putting the list into alphabetical order, and printing the list. We make the assumption that each of the four tasks is correctly carried out, and ask the question: Does the correct completion of these four tasks solve the problem? The names are entered in the first task, so all of the names are present. The second module fills in all the missing data, so the list is complete. The third module sorts the names into alphabetical order. The fourth module prints the names. Because the third sorts the names, the fourth
This is the end of the preview. Sign up
access the rest of the document.