Answers to selected exercises are available on the book Web site; see Appendix B for details.
1.
Using the business rule from Section 5.1 on p. 31 and the known occupants from Figure 5.1, color in Figure 5.10. Do so as it would be reported by Fit, according to whether the tests pass. You don't need to bother to insert actual values where a test value is wrong. You can add any rows inserted in the report if you wish.
Figure 5.10. Color in the Table
OccupantList
user
room
anna
lotr
luke
Lotr
warren
shrek
2.
Color in Figure 5.11, using the business rule from Section 5.2 on p. 34, as in the previous exercise.
Figure 5.11. Color in the Table
DiscountGroupList
future value
max owing
min purchase
discount percent
low
0.00
0.00
0
medium
500.00
600.00
3
medium
0.00
500.00
5
low
0.00
500.00
5
3.
Create a RowFixture table for a list of things that is relevant to you.
4.
What is the type of the table shown in Figure 5.12, assuming that it is one of the three standard table types: ColumnFixture (C), RowFixture (R), or ActionFixture (A)?
Figure 5.12. Identify the Type of the Table
CardHandList
suit
card
heart
ace
heart
queen
diamond
king
diamond
7
club
king
club
jack
club
10
club
9
club
4
spade
ace
5.
What type of table is shown in Figure 5.13?
Figure 5.13. Identify the Type of the Table
CalculateMoney
money
multiplier
result()
0.00
5
0.00
12.00
5
60.00
24.00
1
24.00
100
15
1500.00
6.
Select the type of tableColumnFixture (C), RowFixture (R), or ActionFixture (A)that you would expect to use for testing any of the following that interest you; make any appropriate assumptions.
The tax paid depends on income and total (allowed) expenses.
Does a nasty letter need to be sent to a slow payer to ask for immediate payment (or else)?
Is this a valid URL?
Test a sequence of moves in a chess-playing program, along with an indication of check and checkmate.
Is a number negative or not?
Test that a Google search has listed your special home page.
Are the pieces in the right position on the chessboard at the start of a game?
Are all the customers in the list, along with correct addresses and phone numbers?
Calculate the logarithm of a number.
Is the history of debit and credit transactions correct?