Section 13.4. Starting Simple


13.4. Starting Simple

"Is this starting to sound too complicated for a first step," wondered Emily, "with the configurations and all?" We said that it was worth pressing on, by tackling the tests in small steps.

We decided to simplify things so that we could make some progress. As things got clearer, we could add more aspects of the business rule. To start, we assumed a fixed grace period, assumed that all the extra time was to be charged, and ignored the high-demand part.

"How about this?" asked Don, who quickly drew the ColumnFixture[2] table shown in Figure 13.1 on the whiteboard.

[2] See Chapter 3 for an introduction to ColumnFixture tables.

Figure 13.1. Don's First Table


After we had discussed making the labels in Figure 13.1 clearer, Don altered it, as shown in Figure 13.2. "Is this the right way to go?" he questioned. "Does the table have more information than necessary?"

Figure 13.2. Don's Second Table


"We don't need to calculate the late fee in this table," Sarah suggested. "We can simply calculate the extra time period to be charged." We all agreed.

"Although," mentioned Emily, "this is moving away from how my code is organized." Figure 13.3 resulted.

Figure 13.3. Emily's Trimmed Table


"At this stage," Don pointed out, "we don't need the first column, either. Let's plug in a few quick tests." (See Figure 13.4.)

Figure 13.4. Don's Added Tests




    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