Here's the scenario.
- There's a large, organically grown application written in some language and manner that makes it difficult to test. It works but is hard to maintain.
- Specifications are woolly, so even if the code was amenable, it's hard to know what things should be doing without doing them.
- You want to get it into a test harness so you can start to refactor and create proper unit tests.
In these cases it makes sense to build an external or superficial 'test everything' harness so you can start more aggressive refactoring to enable you to write proper unit tests. This seems a pretty established practice of incrementally introducing tests.
"The main thing that distinguishes legacy code from non-legacy code is a lack of comprehensive tests." - Michael C. Feathers (Working Effectively with Legacy Code)
My question is this:
Does it make sense to build a suite of Behaviour Driven tests at this point and execute them via some kind of automated button clicker? I'm thinking something like (but not limited to) cucumber or similar where the human readable tests match executable code/scripts that prove the defined behaviour is being met.
A clear advantage of this is that a human readable specification of sorts could be developed alongside the tests and that these specifications are much easier to confirm as sane and correct with users/developers of the system. They are essentially integration tests but perform the function that Feathers recommends.
eta: I'm not asking for a specific tool recommendation, the actual tool is irrelevant (although it would be helpful to know if they actually exist) I'm after a sanity check and recommendations around external BDD integration testing.