16.1. IntroductionAs we mentioned in Chapter 13, Seth wanted to revisit the business rules for late returns. But on Friday morning, Mitra, Emily, Sarah, and Seth had agreed with Don: "There are problems with both late and early returns. Let's focus on early returns next, as it's simpler." Sarah and Mitra had spent the morning writing lots of workflow tests for early returns, after some initial help. We all got together that afternoon. Mitra and Sarah understood the issues better from having developed these examples. Mitra explained, "We realized that calculating refunds on early and late returns is not a matter of charging or refunding the difference." Consider her two scenarios.
Figure 16.1. Refund When 1 Hour Early (Part of Test)
Figure 16.2. No Refund When 1 Hour Early (Part of Test)
Mitra and Sarah were unsure whether that was the best way to write the tests: "Perhaps there are ways to reduce the effort of writing all these tests, which are very similar." "There's lots of cases," agreed Don. "We don't want to have develop lots more tests like this." "So how can we avoid that?" asked Sarah. "I suppose that there is a lot of noise that is irrelevant to the main point in these tests." "Yes," replied Don, "although we need some tests that show that the refunds and so on are made correctly within the workflow." Emily summarized: "The specific client and the specific rental items are irrelevant. The deposit is irrelevant to the issue of refunds for early returns. We can ignore the staff member and maybe the count of items, too." "So that leaves the paid-for period and the actual period," said Don. "And the rental rates," added Emily. "How about something like this?" |