Code coverage: I'm hooked (05 Nov 2015)

Over the years, I've been using code coverage tools here and there, but somehow never got addicted. In one case I remember, the tool in question simply could not cope with the codebase, making it impractical to use. In another case, code coverage results were generated as part of a Sonar build but this build ran only every few days, which meant that it never created an immediate feedback loop for me. But today, I think I finally saw the light.

In a small Java project which I inherited, I learned about the code base by bringing the code under test, i.e. by writing unit tests starting with the lower-level parts of the code and continuing on up to the its external API layers. This already was quite a fruitful exercise, as it allowed me to make changes in the code very quickly, relying on the unit tests to alert me of any breakage I caused along the way.

  • TBD: Cobertura versus Java 7
  • TBD: JaCoCo 0.75 versus Jenkins plugin

Code coverage report not working with Jenkins plugin for JaCoCo?. https://issues.jenkins-ci.org/browse/JENKINS-28652 hints that this may be due to a version mismatch between the Jenkins plugin and JaCoCo?, so I am downgrading to JaCoCo? 0.7.4 to test this hypothesis.

Using code coverage, I identified small areas in the code which had not been executed yet by unit tests. Almost each of the tests I added uncovered another corner case I had not considered yet, or which taught me something about the codebase. Examples: TBD

TBD:



When asked for a TWiki account, use your own or the default TWikiGuest account.



to top

You are here: Blog > DefinePrivatePublic20151105CodeCoverage

r1.2 - 06 Nov 2015 - 06:03 - ClausBrod to top

Blog
This site
RSS

  2017: 12 - 11 - 10
  2016: 10 - 7 - 3
  2015: 11 - 10 - 9 - 4 - 1
  2014: 5
  2013: 9 - 8 - 7 - 6 - 5
  2012: 2 - 10
  2011: 1 - 8 - 9 - 10 - 12
  2010: 11 - 10 - 9 - 4
  2009: 11 - 9 - 8 - 7 -
     6 - 5 - 4 - 3
  2008: 5 - 4 - 3 - 1
  2007: 12 - 8 - 7 - 6 -
     5 - 4 - 3 - 1
  2006: 4 - 3 - 2 - 1
  2005: 12 - 6 - 5 - 4
  2004: 12 - 11 - 10
  C++
  CoCreate Modeling
  COM & .NET
  Java
  Mac
  Lisp
  OpenSource
  Scripting
  Windows
  Stuff
Changes
Index
Search
Maintenance
Impressum
Datenschutzerklärung
Home



Jump:

Copyright © 1999-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback