In september I had the great pleasure of speaking at the http://agileprague.com/ conference. It was the second time I attended and I was equally pleased with the event this year. Last time I just attended while my wife gave a talk, but this year I decided to share my thoughts on Test Driven Development. The talk was mainly aimed as a broad technical introduction to the topic, but I also brushed on the concept of Test Strategy. Many developers nowadays are familiar with the concepts of Unit testing, Integration testing and Acceptance testing, but it is not always clear how these techniques should be applied in combination for the best effect. The answer to this question is of course different for each environment and therefore I find it time well spent to develop a Test Strategy. Here is an example of how such a strategy might look like in a typical layered web-application:
- Strive for 100% test coverage of backend-code helped by unit tests and a mocking framework
- Test each layer on it’s own through Unit and Integration testing
- Database layer tested with Integration tests
- Critical User Stories tested using Acceptance tests expressed in text and tables using Concordion
- User interface mainly tested by manual exploratory testing
Here you can find the slides: Test-Driven Development – Why, How and Strategies for Success
4 responses on “Test Strategy”
Is point 5 a good idea?
Surely the manually effort of testing (regression and new functionality) the front end behaves correctly (customer point of view) will grow as the product grows.
Automated testing under the hood is very important but surely automated testing of the UI is important too.
I know that that UI tests can be fragile, costly and very dependent on everything else working but is there an alternative?
Very well said. It is important to do testing manually.
All this being said I think there is almost always good value in having a few system tests that go through the UI all the way, but your main effort should probably not be there. When it comes to mitigating the maintenance concerns I find the approach of the Geb framework interesting: . I haven’t used this framework myself, but I have used test code which had a UI-abstraction layer similar to the PageObject-pattern and that was very useful.
Oops, the links went berzerk in my comment and we have no preview button.
The llnk about Geb is here: http://www.gebish.org/testing. My colleague Olle Hallin should have the credit for letting me know of this frameworks existence.