Using TodoMVC

We'll build a todo list manager based on the TodoMVC application (http://todomvc.com). This simple, open source application with a rich JavaScript user interface will provide plenty of behavior to specify with BDD. Our implementation will be simpler than the full TodoMVC app, but we'll make sure that our BDD features will work on the full app as well. This will demonstrate how acceptance tests can target both local and deployed instances of an app; in this case, different implementations.

We will first define our feature in a BDD-style RSpec example. Then we'll execute our feature file, which will fail since we won't have any code at that point. We'll then iterate through the development process, building the user interface first, with no Ruby backend. Then we'll move in steps to developing our controller, or API layer, using TDD. Finally, we'll build the model layer that powers our API.

It's important to note that the BDD process is very free flowing, with a natural bouncing back and forth between features, app code, and specs. This flow is not easy to capture in the format of a book chapter. In the sections to come, we will try to follow a clear, logical course through the development of our app. This does not mean that real-world experience with BDD is meant to be linear and logical. The whole point of BDD is to enable experimentation with different ideas throughout the development process to maximize benefit while minimizing cost. As we work through the example app and its features, we should use our imagination to consider alternative directions along the way.

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

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