Sunday, January 10, 2010

Testing the UI and Business Logic

Michael Feathers has a post up about UI Test Automation tools and the gap between the dream and the reality. The post got me to focus on some thoughts/concerns I have about testing and the UI.

I've never understood the (un)intentional coupling of the UI and business logic. I agree with Feathers:
...testing your full application end-to-end through a UI Testing tool...couples some of the most important tests in your system to one of the most volatile parts of it. It’s easy for us to see business logic as volatile, but really, the UI is the thing which twists and ripples in the winds of change.

I've seen this coupling also create the situation where, in order to test comprehensively, every single possible data/behavior combination must be initiated from the UI. Seems to me that the testing needed at the UI level is does the UI meet the API of the layer below it? Of course, that's only possible if the UI and the lower layer are decoupled.

No comments: