[x3d-public] JaCoCo - please install in java/build.xml for X3DJSAIL
John Carlson
yottzumm at gmail.com
Mon Feb 11 04:07:35 PST 2019
I think JaCoCo pretty much out of the box produces 0 times called constructors and methods (isn’t that what it’s made for?)
We can discuss the ant script at a meeting. I think it’s just 2 targets, one with CommandLine, and one with a Java code calling 4000 classes (or CommandLine). (Java, not XML).
Sent from Mail for Windows 10
From: Brutzman, Donald (Don) (CIV)
Sent: Sunday, February 10, 2019 12:45 PM
To: John Carlson
Cc: X3D Graphics public mailing list
Subject: Re: JaCoCo - please install in java/build.xml for X3DJSAIL
Thanks for the good idea, and for explaining your goals.
Found some interesting references:
[1] An Introduction to Code Coverage. In this article, you'll learn how to get started with code coverage, how to find the right tool, how to calculate it, and what percentage you should aim for.
by Sten Pittet · May. 24, 17 · DZone Java Zone · Tutorial
https://dzone.com/articles/an-introduction-to-code-coverage
[2] Wikipedia: Java code coverage tools
https://en.wikipedia.org/wiki/Java_code_coverage_tools
[3] JCov. The JCov open source project is used to gather quality metrics associated with the production of test suites. JCov is being opened in order to facilitate the practice of verifying test execution of regression tests in OpenJDK development.
https://wiki.openjdk.java.net/display/CodeTools/jcov
[4] JaCoCo versus JCov
https://java.libhunt.com/compare-jacoco-vs-jcov
[4] JaCoCo API Usage Examples
https://www.jacoco.org/jacoco/trunk/doc/api.html
Two questions please.
=====================
a. Can JaCoCo be run independent of the current build, or is it inserting code in source? In other words, can you run it without modifying X3DJSAIL source? Not clear from initial read of JaCoCo docs.
I think it might work by modifying already-compiled bytecode in X3DJSAIL .jar file, since it uses the ASM library. https://asm.ow2.io
... in which case it probably doesn't require changing X3DJSAIL source?
... in which case you can build and run JaCoCo together with X3DJSAIL yourself, not requiring modifications to source code?
=====================
b. Usually code coverage is performed against a test suite. We only have a few unit tests, associated with types.
https://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/x3d/stylesheets/java/src/org/web3d/x3d/tests/
FieldObjectTests.java
I just made sure that package tree (and specific source file) is included in both X3DJSAIL .jar files, and will be included in tonight's release. (Still having trouble getting it to show up in Javadoc however.)
As you know, most unit testing occurs through processing of ~4000 scenes in X3D Examples Archives
http://www.web3d.org/x3d/content/examples/X3dResources.html#Examples
And so, should we talk about what kind of unit tests you want to develop?
=====================
Thanks, Don
On 2/9/2019 8:31 PM, John Carlson wrote:
> I need to get data from jacoco, and put it into a program to create test cases using the uncovered cases. We will repeat finding test cases until all uncovered cases are covered using my secret algorithm to build test cases. I will later attempt to create the main data structure in my secret algorithm which I can use to traverse the X3DUOM or (a future) X3DJSAIL. If you want to see my algorithm, maybe wait for the next Web3D conference and I’ll give a presentation on generating Java test cases for X3D testing and repeating. Yay! How else do you do it? The results should be X3D XML files for testing I hope. Just a few to cover most of the use cases.
>
> I hope I don’t crash and burn. This has been a few good days. Prayers please.
>
> Thanks,
>
> John
>
> Sent from Mail <https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10
>
> *From: *John Carlson <mailto:yottzumm at gmail.com>
> *Sent: *Saturday, February 9, 2019 9:51 PM
> *To: *Don Brutzman <mailto:brutzman at nps.edu>; X3D Graphics public mailing list <mailto:x3d-public at web3d.org>
> *Subject: *JaCoCo - please install in java/build.xml for X3DJSAIL
>
> Please install JaCoCo in www.web3d.org/x3d/stylesheets/Java/build.xml <http://www.web3d.org/x3d/stylesheets/Java/build.xml> and create a Local Java application that JaCoCo finds test coverage off that include all Java X3DJSAIL client files. I can do this once JaCoCo is installed in the source tree (tools?).
>
> Ant file examples here: https://www.jacoco.org/jacoco/trunk/doc/ (not sure if these work or not).
>
> JaCoCo is a code coverage tool. I need it to find untested constructor and methods (but don’t record for interfaces).
>
> Here’s the Eclipse public license and various licenses for JaCoCo libraries: https://www.jacoco.org/license.html (can be used in Eclipse. We are using it in ant).
>
> Thanks,
>
> John
>
all the best, Don
--
Don Brutzman Naval Postgraduate School, Code USW/Br brutzman at nps.edu
Watkins 270, MOVES Institute, Monterey CA 93943-5000 USA +1.831.656.2149
X3D graphics, virtual worlds, navy robotics http://faculty.nps.edu/brutzman
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20190211/eb8ea4a0/attachment.html>
More information about the x3d-public
mailing list