Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 526
Jesper Rønn-Jensen Avatar asked Nov 16 '10 08:11

Jesper Rønn-Jensen


1 Answers

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.

like image 172
Michael Borgwardt Avatar answered Oct 07 '22 17:10

Michael Borgwardt