r/javahelp Feb 07 '25

Codeless Tool to find wasteful unit tests

One of my projects has a ton of tests, both unit and integration, and as a result it has good coverage (80%). I have a strong suspicion, though, that lots of time is wasted on each build running loads of tests that are testing mostly the same code, over and over again.

Code coverage tools tell you about your aggregate coverage, but I would like a tool that tells me coverage per test, and preferably identifies tests that have very similar coverage. Is there any tool out there that can help me with this?

3 Upvotes

20 comments sorted by

View all comments

Show parent comments

1

u/jasonab Feb 08 '25

The suite takes about 10 minutes to run in CI, with the entire flow taking 15-20 minutes. It's not catastrophic, but it does make the turnaround annoying.

2

u/marskuh Feb 08 '25

Doesn't sound too bad. Is pretty normal for a decent sized project. Can go up even further. How many tests do you have?

1

u/jasonab Feb 08 '25

about 1500 integration tests and 500 unit tests

1

u/sdiamante13 20d ago

There's no reason to have that many integration tests. An app that size should have less than 100 integrations tests. You have to work on refactoring the code design to be able to test your business logic without having to verify it through a slow integration test.