I have been tasked to increase code coverage of an existing java project.
I noticed that the code coverage tool (eclemma) has highlighted some methods that are never called from anywhere.
My initial reaction is not to write unit tests for these methods, but to highlight them to my line manager/team and ask why are these functions there to begin with.
What would the best approach be? Write unit tests for them, or question why they're there?
Thanks in advance
As Java is statically compiled, it should be pretty safe to remove the methods. Removing dead code is always good. There is some probability that there is some crazy reflection system which runs them in runtime, so check first with other developers, but otherwise remove them.