O'Reilly logo

Lean-Agile Acceptance Test-Driven Development: Better Software Through Collaboration by Ken Pugh

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

Chapter 14. Separate View from Model

“To each his own. (Suum Cuique)”

Cicero

Tests can be made more maintainable by separating what appears to the user from the logic in the underlying business model.

Decouple the User Interface

For the CD Reservation story in the previous chapter, the business rule (the model) for determining whether a customer is allowed to reserve CDs was documented, and tests were written for it. This reservation tests go to some module inside the system, as shown in Figure 14.1. The triad did not talk about how the reservation-allowed condition is displayed (the view), and they did not make up tests for the user interface.

Figure 14.1. User Interface and Logic Tests

There are at least three ways that the application ...

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