Edit
Attach
Printable
topic end
<!-- * Set TOPICTITLE = #define private public - Claus Brod on stuff (05 Nov 2015) --> <style type="text/css"> pre {background-color:#ffeecc;} </style> %STARTINCLUDE% <a name="05"></a> ---+++ [[DefinePrivatePublic20151105CodeCoverage][Code coverage: I'm hooked]] (05 Nov 2015) <summary> 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 <a href="https://en.wikipedia.org/wiki/SonarQube">Sonar</a> 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. </summary> 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 * https://search.maven.org/#search|ga|1|a%3A%22jacoco-maven-plugin%22 * https://github.com/cobertura/cobertura * https://stackoverflow.com/questions/10869127/maven-build-causes-verifyerror-with-java-1-7 * http://mail.openjdk.java.net/pipermail/jdk7-dev/2011-September/002261.html * https://stackoverflow.com/questions/8151470/cobertura-java-7-support * https://wiki.jenkins-ci.org/display/JENKINS/JaCoCo+Plugin * https://dzone.com/articles/jacoco-jenkins-plugin TBD: * Headline * ALLOWTOPICVIEW = Main.ClausBrod * ALLOWTOPICCHANGE = Main.ClausBrod --- %STOPINCLUDE% %COMMENT{type="below" nonotify="on"}% ---
to top
End of topic
Skip to action links
|
Back to top
Edit
|
Attach image or document
|
Printable version
|
Raw text
|
Refresh
|
More topic actions
Revisions: | r1.4 |
>
|
r1.3
|
>
|
r1.2
|
Total page history
|
Backlinks
You are here:
Blog
>
DefinePrivatePublic20151105CodeCoverage
r1.4 - 06 Nov 2015 - 08:48 -
ClausBrod
to top
Blog
This site
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
Webs
Atari
Blog
Claus
CoCreateModeling
Klassentreffen
Main
Sandbox
Sommelier
TWiki
Xplm
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