Ruby on Rails Test Coverage
Test coverage determines whether a piece of code has been executed. Test coverage doesn’t measure impact or quality. It just measures executed lines of code. It doesn’t expose the importance of the code.
Code-to-test ratios above 1:2 is a smell, and above 1:3 is a stink.[¹]
Focus on risky code rather than test coverage. Do not test implementation details about any framework.
Redundant coverage can kill a team’s morale. It’s the sort of thing that doesn’t bite you on day one because everything’s fast, and it’s easy to run.
Reducing redundant coverage is more a social problem than a technical one. The team needs to Identify a testing strategy covering the application's essential components.
Don’t test standard Active Record associations, validations, or scopes.[¹]
In a Ruby on Rails application, there’s little value in testing things like associations, validations, or scopes. The framework already has a vast test suite asserting that all these features work as they are supposed, so developers don’t have to redundatly test the same thing.
[¹]: David Heinemeier Hansson (2012): Testing like the TSA(https://signalvnoise.com/posts/3159-testing-like-the-tsa)