Moving to Multiples

The commits through [4bdedba] proceed to the handling of multiple URLs to be retrieved. At this point, I only handle direct retrieval with no modifiers, so the easiest approach was to create a new entry point that accepted multiple URLs and looped, invoking the existing retrieve() method for each. This required some elaboration of the spec for how multiple bodies of content should be displayed successively.

The driving test for this functionality was written in [5334caa]. This test creates a stub that uses a counter to return different content for each invocation. Different returns help to insulate the test from the accidental appearance of correctness.

Some would object to the use of StringUtils.join() both in the test and in the production code. I do not hold this concern. First, I used a different form of the method in each location. Second, as StringUtils.join() is a third-party utility that only represents a minor part of the functionality, I do not feel that the correspondence between the test and code implementations is critical.

Before moving on to the next feature, I decided to flesh out the main for some manual testing. As much of a fan as I am of unit testing as the foundation for a testing strategy, you need the rest of the strategy. If I were not trying to focus purely on the application of the testing techniques, I might use a BDD tool like Cucumber to create higher-level acceptance tests. For this project, I will just rely on manual testing. Commit [ead7038] fills in an initial implementation of main(). The implementation is a little heavier than it should be—something that will need to be addressed as we proceed—but it is adequate for now.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.226.88.110