Section 5.4. Exercises


5.4. Exercises

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.

  1. The tax paid depends on income and total (allowed) expenses.

  2. Does a nasty letter need to be sent to a slow payer to ask for immediate payment (or else)?

  3. Is this a valid URL?

  4. Test a sequence of moves in a chess-playing program, along with an indication of check and checkmate.

  5. Is a number negative or not?

  6. Test that a Google search has listed your special home page.

  7. Are the pieces in the right position on the chessboard at the start of a game?

  8. Are all the customers in the list, along with correct addresses and phone numbers?

  9. Calculate the logarithm of a number.

  10. Is the history of debit and credit transactions correct?

  11. Is a date value formatted correctly?



    Fit for Developing Software. Framework for Integrated Tests
    Fit for Developing Software: Framework for Integrated Tests
    ISBN: 0321269349
    EAN: 2147483647
    Year: 2005
    Pages: 331

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net