Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Using JUnit for automated testing. How to enforce new method tests

forumKid2May 17 2010 — edited May 18 2010
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.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 14 2010
Added on May 17 2010
14 comments
577 views