My team is working on training some of our developers to test. They understand why they should write tests on board, that they should write tests, but they are a little behind in writing good tests.
I just saw a commit like this
public void SomeTest{ @Test public void testSomething{ System.out.println(new mySomething.getData()); }
Thus, they at least made sure that their code gave them the expected result by looking.
There will be a bit before we can really sell the idea of ββcode reviews. At the same time, I was considering the possibility of JUnit abandoning any tests that do not have actual assertXXX or fail statements. I would like this error message to say something like "Your tests should use statements and actually check the output!".
I fully expect this to result in calls like assertTrue(1 == 1); . We are working on the purchase of a team for proper testing and code reviews, are there any technical mechanisms that we can use to make life easier for developers who have already received this? What about the technical mechanisms that will help new guys understand?
source share