Rails Integration Testing Idea
Posted by Jason Tue, 21 Mar 2006 05:19:00 GMT
If you haven’t heard about it yet, read up the new (unfortunately named) integration testing framework being developed for Rails 1.1.
An example jamis mentions is a situation where bugs are caused by cruft building up in the session when visiting a number of pages. The integration testing framework definitely allows you to build the test once you can reproduce the bug, but reproducing is still a problem. Something I’ve faced in (non-Rails) webapps is that developers aren’t able to reproduce a bug while users can do it every time. It happens because users may use your application in different ways than developers do. (It happens, unfortunately.)
The idea is simple: let users record integration tests. My immediate vision for this feature goes like this:- Developer starts WEBrick (or lighty) with recording enabled
- User goes in and reproduces their bug… All their steps are recorded.
- Once the user is done, the developers now have a failing Rails integration test that reproduces the bug.
Of course, I have bigger visions for this too. Like a complete user acceptance testing framework. But that all depends on the recording/generation of acceptance tests to work. The main issue I see with the generation of integration tests is whether or not the generated test will be maintainable. I don’t mind if the developer will have to clean up some of the test before checking it in – I think that’s a must for any passive code generator. I’m more concerned about tests requiring more maintenance as the application changes. But I think it’s best just to try and see how it works out.
Now I just have to turn this idea into a plugin/patch. I’m not always successful in this respect, but I must try my best. After I’ve cleaned up all my stuff from the Japan trip.

Beek