I have an application which having at least 50-55 models with on an average 15 methods each.
Is it possible & is it make sense to cover all the methods (including very complex methods) using rspec & rcov ?
I also have following queries
Is Rspec also useful for the Controllers, helpers & views? Or cucumber, shoulda are more useful?
Will rspec help me to reduce redundancy?If yes, how?
will rspec is useful for continuous requirement changing applications?
It certainly is possible to cover all methods with tests, even more if you start by writing the tests before, which usually lead to a leaner application on the long run. On the other hand having a 100% test coverage does not ensure that your application code quality is better or that your team is more productive. The only thing it might ensure is that your application has less flaws and that you won’t break anything in case of refactoring, and then comes the argument against covering all methods with tests:
More often than not you’ll be refactoring and maintaining code, which usually involves adding new methods and getting rid of other methods.
I’d say that it’s good to have tests for all public methods called by other objects or views, controllers, helpers, etc. And test for all the relevant API methods, but it’s far from necessary to have every single method tested.
On the other hand it will depend on your application itself more than on an abstract conversation about it.
You’d have to ask yourself if it’s worth it, what value does it add, etc, and if it makes sense, go for it. Whether you choose to do it in pure rspec, or use cucumber, shoulda, capybara, etc