Removing redundant JUnit testsuite tests
In our JUnit testsuite, I have spotted a few tests that do not drive up coverage, and thus should be removed (they take time but does not really add value to the test suite).
I was wondering what 开发者_开发问答tools exist that can spot redundant tests for me?
I'd consider this a misuse of the code coverage metric. Just because a test doesn't increase the metric, it is not necessarily redundant - it could test a specific execution path that consists of LOC that are covered by several other tests together, but represents behaviour that none of the other tests cover. And remember: code behaviour is influenced very much by state, but no test coverage tool I know measures the coverage of state space.
Unless the runtime of your test suite is a serious problem, there are much better things you can do with your time than eliminate possibly redundant tests.
Some months ago I used Eclipse plugin Clover. It could show how many times each line of code be executed and highlight after unit tests. I think Clover could help you at this point.
精彩评论