O'Reilly logo

Rails 4 Test Prescriptions by Noel Rappin

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required