Testng, Emma, Cobertura, coverage and JDK 7 result in ClassFormatError and VerifyError

I had same problem using maven cobertura plugin. All tests failed when run from cobertura:report. But all tests succeeded when run directly from surefire plugin. As some of you already said the problem is that coberture byte code instrumentation of is not compatible with JDK7. You can see here http://vikashazrati.wordpress.com/2011/10/09/quicktip-verifyerror-with-jdk-7/ that the exception is related … Read more

Should one test internal implementation, or only test public behaviour?

The answer is very simple: you are describing functional testing, which is an important part of software QA. Testing internal implementation is unit-testing, which is another part of software QA with a different goal. That’s why you are feeling that people disagree with your approach. Functional testing is important to validate that the system or … Read more

Filter JaCoCo coverage reports with Gradle

Thanks to, Yannick Welsch: After searching Google, reading the Gradle docs and going through older StackOverflow posts, I found this answer on the Official gradle forums! jacocoTestReport { afterEvaluate { classDirectories.setFrom(files(classDirectories.files.collect { fileTree(dir: it, exclude: ‘com/blah/**’) })) } } Source: https://issues.gradle.org/browse/GRADLE-2955 For older gradle versions < 5.x may need to use classDirectories = files(classDirectories.files.collect { … Read more

What is a reasonable code coverage % for unit tests (and why)? [closed]

This prose by Alberto Savoia answers precisely that question (in a nicely entertaining manner at that!): http://www.artima.com/forums/flat.jsp?forum=106&thread=204677 Testivus On Test Coverage Early one morning, a programmer asked the great master: “I am ready to write some unit tests. What code coverage should I aim for?” The great master replied: “Don’t worry about coverage, just write … Read more