<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style></head><body lang=EN-US link=blue vlink="#954F72"><div class=WordSection1><p class=MsoNormal>Don, I’d love to add jacoco myself, if you can suggest a place that doesn’t interfere with you on the sourceforge file system.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>I would like to generate top down and bottom up (at the same time) XML.  Thus we will take all the Java generated from the X3dToJava.xslt generated POJOs and run it through a coverage tool on all our source code to figure out what constructors and methods aren’t called.   Then we will pick methods that haven’t been called and generate an XML snippet out of it, then we step up the schema (I’m assuming we’ve got the right data structure for this) and choose more methods that haven’t been called.  Ultimately, we will get to a place where the methods are called by the coverage tool  (let’s call this dangling nodes).   We will zoom up the schema at that point to reach the root.   We will need some way to patch together the various branches.  Hmm.  I found this:</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><a href="https://ieeexplore.ieee.org/document/8285209">https://ieeexplore.ieee.org/document/8285209</a>  It looks like these guys have done it.  Hmm.  Maybe someone can get these guys to help.  Would it be smart to talk to a German about talking to an Austrian?  Research is fairly recent.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>I think that JaCoCo is more like a typical performance tool, rather than AspectJ, which weaves byte code<a href="https://www.google.com/search?q=does+jacoco+modify+source+code&oq=does+jacoco+modify+source+code&aqs=chrome..69i57.13839j0j8&sourceid=chrome&ie=UTF-8">https://www.google.com/search?q=does+jacoco+modify+source+code&oq=does+jacoco+modify+source+code&aqs=chrome..69i57.13839j0j8&sourceid=chrome&ie=UTF-8</a>  says it works on byte code.  JaCoCo has problems with interfaces, but we can likely block out those packages.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>I would create a single test case in Java which includes all ~4000 Java test cases, and trust the garbage collector (or test for memory leaks).   So I would likely create something that calls CommandLine:: from Java 4000 times one for each source file in the same JVM instance.  The method might get a bit big, so I would break the code into pieces by hand.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>I think it can be run from the command line too, but I thought you would prefer</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>If you would like to use the Ontology instead of a Java reflection, Schema or Object Model, that would be cool.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>So I think the next step is to figure out where to add covered Java.   Ajv reports problem tests and XPath, so once we get to the top of the fragmented document, we can run the document through the Ajv validator to get reports of “missing object” “missing property” or “missing value” we add missing items to our leaf data structure.  And repeat finding a branch.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>There’s a problem here, but I haven’t quite identified it.  I think we want to find all siblings in the schema. And if we pick USE, we need to find the DEF.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>I’m still a couple of years behind the research.   Hmm.  Maybe I need to apply myself to the books a bit more.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>“Reverse Pruning”</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>John</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Sent from <a href="https://go.microsoft.com/fwlink/?LinkId=550986">Mail</a> for Windows 10</p><p class=MsoNormal><o:p> </o:p></p><div style='mso-element:para-border-div;border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal style='border:none;padding:0in'><b>From: </b><a href="mailto:brutzman@nps.edu">Brutzman, Donald (Don) (CIV)</a><br><b>Sent: </b>Sunday, February 10, 2019 12:45 PM<br><b>To: </b><a href="mailto:yottzumm@gmail.com">John Carlson</a><br><b>Cc: </b><a href="mailto:x3d-public@web3d.org">X3D Graphics public mailing list</a><br><b>Subject: </b>Re: JaCoCo - please install in java/build.xml for X3DJSAIL</p></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Thanks for the good idea, and for explaining your goals.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Found some interesting references:</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>[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.</p><p class=MsoNormal>     by Sten Pittet · May. 24, 17 · DZone Java Zone · Tutorial</p><p class=MsoNormal>     https://dzone.com/articles/an-introduction-to-code-coverage</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>[2] Wikipedia: Java code coverage tools</p><p class=MsoNormal>     https://en.wikipedia.org/wiki/Java_code_coverage_tools</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>[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.</p><p class=MsoNormal>     https://wiki.openjdk.java.net/display/CodeTools/jcov</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>[4] JaCoCo versus JCov</p><p class=MsoNormal>     https://java.libhunt.com/compare-jacoco-vs-jcov</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>[4] JaCoCo API Usage Examples</p><p class=MsoNormal>     https://www.jacoco.org/jacoco/trunk/doc/api.html</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Two questions please.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>=====================</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>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.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>I think it might work by modifying already-compiled bytecode in X3DJSAIL .jar file, since it uses the ASM library. https://asm.ow2.io</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>... in which case it probably doesn't require changing X3DJSAIL source?</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>... in which case you can build and run JaCoCo together with X3DJSAIL yourself, not requiring modifications to source code?</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>=====================</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>b. Usually code coverage is performed against a test suite.  We only have a few unit tests, associated with types.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>https://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/x3d/stylesheets/java/src/org/web3d/x3d/tests/</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>                FieldObjectTests.java</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>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.)</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>As you know, most unit testing occurs through processing of ~4000 scenes in X3D Examples Archives</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>                http://www.web3d.org/x3d/content/examples/X3dResources.html#Examples</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>And so, should we talk about what kind of unit tests you want to develop?</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>=====================</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Thanks, Don</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>On 2/9/2019 8:31 PM, John Carlson wrote:</p><p class=MsoNormal>> 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.</p><p class=MsoNormal>> </p><p class=MsoNormal>> I hope I don’t crash and burn.   This has been a few good days.   Prayers please.</p><p class=MsoNormal>> </p><p class=MsoNormal>> Thanks,</p><p class=MsoNormal>> </p><p class=MsoNormal>> John</p><p class=MsoNormal>> </p><p class=MsoNormal>> Sent from Mail <https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10</p><p class=MsoNormal>> </p><p class=MsoNormal>> *From: *John Carlson <mailto:yottzumm@gmail.com></p><p class=MsoNormal>> *Sent: *Saturday, February 9, 2019 9:51 PM</p><p class=MsoNormal>> *To: *Don Brutzman <mailto:brutzman@nps.edu>; X3D Graphics public mailing list <mailto:x3d-public@web3d.org></p><p class=MsoNormal>> *Subject: *JaCoCo - please install in java/build.xml for X3DJSAIL</p><p class=MsoNormal>> </p><p class=MsoNormal>> 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?).</p><p class=MsoNormal>> </p><p class=MsoNormal>> Ant file examples here: https://www.jacoco.org/jacoco/trunk/doc/ (not sure if these work or not).</p><p class=MsoNormal>> </p><p class=MsoNormal>> JaCoCo is a code coverage tool. I need it to find untested constructor and methods (but don’t record for interfaces).</p><p class=MsoNormal>> </p><p class=MsoNormal>> 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).</p><p class=MsoNormal>> </p><p class=MsoNormal>> Thanks,</p><p class=MsoNormal>> </p><p class=MsoNormal>> John</p><p class=MsoNormal>> </p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>all the best, Don</p><p class=MsoNormal>-- </p><p class=MsoNormal>Don Brutzman  Naval Postgraduate School, Code USW/Br       brutzman@nps.edu</p><p class=MsoNormal>Watkins 270,  MOVES Institute, Monterey CA 93943-5000 USA   +1.831.656.2149</p><p class=MsoNormal>X3D graphics, virtual worlds, navy robotics http://faculty.nps.edu/brutzman</p><p class=MsoNormal><o:p> </o:p></p></div></body></html>