I’m working on a non-trivial Java project having a few hundred tests. When I make a change to the code, I re-run tests to see if everything is alright. I usually look at the number of failed tests and if there are less failed tests than before the change, I consider that a success.
However, sometimes after making a change, I fix some tests, but simultaneously fail other ones. This is especially confusing when the number of newly fixed and broken tests is the same, because then I have to manually find the difference.
How can this process be made faster?
For example, I’d like to be able to pass an imaginary --one-per-line
flag:
./gradlew test --one-per-line
and it’d output a list of FQCN+test method names that failed:
com.example.company.Account.checkoutAlpha
com.example.company.Account.checkoutCharlie
com.example.company.Auth.twoFactor
Then I could save this output to a file, make my changes, run tests again and save to a file again, and diff
them to easily see the difference.