The Requirements

The most complex business logic we need to build concerns forecasting a project’s progress. We want to be able to predict the end date of a project and determine whether that project is on schedule or not.

In other words, given a project and a set of tasks, some of which are done and some of which are not, use the rate at which tasks are being completed to estimate the project’s end date. Also, compare that projected date to a deadline to determine if the project is on time.

This is a good example problem for TDD because, while I have a sense of what the answer is, I don’t have a very strong sense of the best way to structure the algorithm. TDD will help, guiding me toward reasonable code design.

Get Rails 4 Test Prescriptions now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.