Using JUnit for automated testing. How to enforce new method tests
We are using junit for all of our tests and we have it automated for every build to insure things are correct programmatically...as correct as possible.
My question is, how to ensure developers update the test scripts with new methods they create. There are a lot of developers here and very little structure and enforcement. I'm trying to force developers to not skip unit tests like they have been doing for years.
Just looking for some guidance if anyone out there has run into this and what they did to help the situation.
I originally thought of adding something like count # of methods in program vs # of methods in test program to ensure they match. Hence if a new method is added and not in the test script, it would fail. But that wont work because one method in one program can utilize one or more methods in the same program, so testing just one single method in that case, really tests more (all that are called).
I'm not looking for a solution because I don't think there is one other than project enforcement (meaning the peer code reviewer should fail the module if no unit test exists). But, just wondering if anyone else has had a similar situation.