<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="4.3.4">Jekyll</generator><link href="https://chem-bla-ics.linkedchemistry.info/feed/by_tag/junit.xml" rel="self" type="application/atom+xml" /><link href="https://chem-bla-ics.linkedchemistry.info/" rel="alternate" type="text/html" /><updated>2026-11-01T15:22:34+00:00</updated><id>https://chem-bla-ics.linkedchemistry.info/feed/by_tag/junit.xml</id><title type="html">chem-bla-ics</title><subtitle>Chemblaics (pronounced chem-bla-ics) is the science that uses open science and computers to solve problems in chemistry, biochemistry and related fields.</subtitle><author><name>Egon Willighagen</name></author><entry><title type="html">cdk2024 #6: wrapping up already</title><link href="https://chem-bla-ics.linkedchemistry.info/2025/03/30/cdk2024-4.html" rel="alternate" type="text/html" title="cdk2024 #6: wrapping up already" /><published>2025-03-30T00:00:00+00:00</published><updated>2025-03-30T00:00:00+00:00</updated><id>https://chem-bla-ics.linkedchemistry.info/2025/03/30/cdk2024-4</id><content type="html" xml:base="https://chem-bla-ics.linkedchemistry.info/2025/03/30/cdk2024-4.html"><![CDATA[<p>Tomorrow is already the last day of the <a href="https://www.nwo.nl/en/researchprogrammes/open-science/open-science-fund">NWO Open Science</a> grant
for the <a href="https://cdk.github.io/">Chemistry Development Kit</a>. We are wrapping up, but I am happy we have a few weeks more
to finish up the reporting. We held a user group meeting earlier this month (btw, check out the <a href="https://doi.org/10.5281/zenodo.15058009">slides by Jonas</a>),
and I did a <a href="https://github.com/cdk/cdk/pull/1175">few</a> <a href="https://github.com/cdk/cdk/pull/1178">more</a>
<a href="https://github.com/cdk/cdk/pull/1179">JUnit</a> <a href="https://github.com/cdk/cdk/pull/1180">testing</a> updates last week:</p>

<p><img src="/assets/images/cdk2024_junit.png" alt="" /></p>

<p>Actually, you see <a href="https://github.com/cdk/cdk/pull/1177">one pull request</a> here that I closed. I accidentally included a
circular dependency. Some core CDK functionality is hard to test with an implementation of the data model, but if that
implementation depends on the module you are testing, that won’t work (not in Maven anyway). But the good bits got included
in the next pull request. One of the goals was to improve the code covered by the tests.</p>

<p>This <em>coverage testing</em> has an imporant code maintenance purpose: it visualizes whih code is not checked. Sometimes
code is not tested that under normal conditions should have been (a bug) and sometimes it is handling a rare situation
which you want tested too, to make sure that rare case does not get covered by the common code. Thus, the percentage
code covered by tests should be as high as is reasonable. The pull requests therefore aim to raise that percentage,
such as for this pull request:</p>

<p><img src="/assets/images/cdk2024_coverage.png" alt="" /></p>

<p>Indeed, over the past 12 months, the coverage did improve, perhaps not as much as we liked, with 2.32 percent point
to 64.96 percent:</p>

<p><img src="/assets/images/cdk2024_coverage2.png" alt="" /></p>

<p>The CDK started routinely using unit testing somewhere in the zeroes, with home made continous integration
<a href="https://chem-bla-ics.linkedchemistry.info/2006/05/01/nightly-cdk-builds-now-available.html">as early as 2006</a>,
shared with the development community every night, thanks to Rajarshi Guha’s effort. We had our
<a href="https://chem-bla-ics.linkedchemistry.info/2006/11/28/code-coverage-making-sure-your-code-is.html">first code coverage results in the same year</a>.
And at some point we had sufficient coverage that it gave us the opportunity to routinely check
<a href="https://chem-bla-ics.linkedchemistry.info/2007/11/07/comparing-junit-test-results-between.html">the impact of a patch</a>.
Of course, this is exactly what many open source projects do with GitHub Actions nowadays.</p>

<p>Unfortunately, we also found that many of the CDK-using tools we worked on in this grant to get updated to
use a (more) recent CDK version do not have such solutions in place. That left us in several cases quite
in the dark. More about that soon!</p>]]></content><author><name>Egon Willighagen</name></author><category term="cdk2024" /><category term="cdk" /><category term="junit" /><category term="cito:citesAsRecommendedReading:10.5281/zenodo.15058009" /><summary type="html"><![CDATA[Tomorrow is already the last day of the NWO Open Science grant for the Chemistry Development Kit. We are wrapping up, but I am happy we have a few weeks more to finish up the reporting. We held a user group meeting earlier this month (btw, check out the slides by Jonas), and I did a few more JUnit testing updates last week:]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://chem-bla-ics.linkedchemistry.info/assets/images/cdk2024_junit.png" /><media:content medium="image" url="https://chem-bla-ics.linkedchemistry.info/assets/images/cdk2024_junit.png" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">Multiple unit test inheritance with JExample</title><link href="https://chem-bla-ics.linkedchemistry.info/2010/10/26/multiple-unit-test-inheritance-with.html" rel="alternate" type="text/html" title="Multiple unit test inheritance with JExample" /><published>2010-10-26T00:10:00+00:00</published><updated>2010-10-26T00:10:00+00:00</updated><id>https://chem-bla-ics.linkedchemistry.info/2010/10/26/multiple-unit-test-inheritance-with</id><content type="html" xml:base="https://chem-bla-ics.linkedchemistry.info/2010/10/26/multiple-unit-test-inheritance-with.html"><![CDATA[<p>Two months ago I wrote about <a href="http://scg.unibe.ch/research/jexample">JExample</a> (see
<a href="https://chem-bla-ics.linkedchemistry.info/2010/08/14/specifying-unit-test-dependencies-with.html">Specifying unit test dependencies with JExample <i class="fa-solid fa-recycle fa-xs"></i></a>).
At the time, my examples did not include multiple unit test inheritance, but was informed later by @jexample
that is possible. I just got time to try it in the <a href="https://chem-bla-ics.linkedchemistry.info/2010/10/15/working-on-oscar-for-three-months.html">Oscar <i class="fa-solid fa-recycle fa-xs"></i></a>
project:</p>

<div class="language-java highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nd">@Test</span> <span class="kd">public</span> <span class="nc">Oscar</span> <span class="nf">testConstructor</span><span class="o">()</span>
<span class="kd">throws</span> <span class="nc">URISyntaxException</span>
<span class="o">{</span>
  <span class="nc">Oscar</span> <span class="n">oscar</span> <span class="o">=</span> <span class="k">new</span> <span class="nc">Oscar</span><span class="o">();</span>
  <span class="nc">Assert</span><span class="o">.</span><span class="na">assertNotNull</span><span class="o">(</span><span class="n">oscar</span><span class="o">);</span>
  <span class="k">return</span> <span class="n">oscar</span><span class="o">;</span>
<span class="o">}</span>

<span class="nd">@Given</span><span class="o">(</span><span class="s">"#testConstructor"</span><span class="o">)</span>
<span class="kd">public</span> <span class="nc">String</span> <span class="nf">testNormalize</span><span class="o">(</span><span class="nc">Oscar</span> <span class="n">oscar</span><span class="o">)</span>
<span class="kd">throws</span> <span class="nc">URISyntaxException</span>
<span class="o">{</span>
  <span class="nc">String</span> <span class="n">input</span> <span class="o">=</span> <span class="n">oscar</span><span class="o">.</span><span class="na">normalize</span><span class="o">(</span>
    <span class="s">"This is a simple input string with benzene."</span>
  <span class="o">);</span>
  <span class="nc">Assert</span><span class="o">.</span><span class="na">assertNotNull</span><span class="o">(</span><span class="n">input</span><span class="o">);</span>
  <span class="k">return</span> <span class="n">input</span><span class="o">;</span>
<span class="o">}</span>

<span class="nd">@Given</span><span class="o">(</span><span class="s">"#testConstructor,#testNormalize"</span><span class="o">)</span>
<span class="kd">public</span> <span class="nc">List</span> <span class="nf">testTokenize</span><span class="o">(</span>
  <span class="nc">Oscar</span> <span class="n">oscar</span><span class="o">,</span> <span class="nc">String</span> <span class="n">input</span><span class="o">)</span> <span class="kd">throws</span> <span class="nc">Exception</span>
<span class="o">{</span>
  <span class="nc">List</span> <span class="n">tokens</span> <span class="o">=</span> <span class="n">oscar</span><span class="o">.</span><span class="na">tokenize</span><span class="o">(</span><span class="n">input</span><span class="o">);</span>
  <span class="nc">Assert</span><span class="o">.</span><span class="na">assertNotNull</span><span class="o">(</span><span class="n">tokens</span><span class="o">);</span>
  <span class="nc">Assert</span><span class="o">.</span><span class="na">assertNotSame</span><span class="o">(</span><span class="mi">0</span><span class="o">,</span> <span class="n">tokens</span><span class="o">.</span><span class="na">size</span><span class="o">());</span>
  <span class="k">return</span> <span class="n">tokens</span><span class="o">;</span>
<span class="o">}</span>

<span class="nd">@Given</span><span class="o">(</span><span class="s">"#testConstructor,#testTokenize"</span><span class="o">)</span>
<span class="kd">public</span> <span class="nc">List</span> <span class="nf">testRecognizeNamedEntities</span><span class="o">(</span>
  <span class="nc">Oscar</span> <span class="n">oscar</span><span class="o">,</span> <span class="nc">List</span> <span class="n">tokens</span><span class="o">)</span>
<span class="kd">throws</span> <span class="nc">Exception</span>
<span class="o">{</span>
  <span class="nc">List</span> <span class="n">entities</span> <span class="o">=</span>
    <span class="n">oscar</span><span class="o">.</span><span class="na">recognizeNamedEntities</span><span class="o">(</span><span class="n">tokens</span><span class="o">);</span>
  <span class="nc">Assert</span><span class="o">.</span><span class="na">assertNotNull</span><span class="o">(</span><span class="n">entities</span><span class="o">);</span>
  <span class="nc">Assert</span><span class="o">.</span><span class="na">assertEquals</span><span class="o">(</span><span class="mi">1</span><span class="o">,</span> <span class="n">entities</span><span class="o">.</span><span class="na">size</span><span class="o">());</span>
  <span class="k">return</span> <span class="n">entities</span><span class="o">;</span>
<span class="o">}</span>
</code></pre></div></div>

<p>The pattern here is that each test method returns one variable, so that any method depending on two
other unit test will have two parameters. The order is defined by the order in which they are given
by the <em>@Given</em> clause.</p>]]></content><author><name>Egon Willighagen</name></author><category term="java" /><category term="junit" /><summary type="html"><![CDATA[Two months ago I wrote about JExample (see Specifying unit test dependencies with JExample ). At the time, my examples did not include multiple unit test inheritance, but was informed later by @jexample that is possible. I just got time to try it in the Oscar project:]]></summary></entry><entry><title type="html">Specifying unit test dependencies with JExample</title><link href="https://chem-bla-ics.linkedchemistry.info/2010/08/14/specifying-unit-test-dependencies-with.html" rel="alternate" type="text/html" title="Specifying unit test dependencies with JExample" /><published>2010-08-14T00:10:00+00:00</published><updated>2010-08-14T00:10:00+00:00</updated><id>https://chem-bla-ics.linkedchemistry.info/2010/08/14/specifying-unit-test-dependencies-with</id><content type="html" xml:base="https://chem-bla-ics.linkedchemistry.info/2010/08/14/specifying-unit-test-dependencies-with.html"><![CDATA[<p>A while ago <a href="http://stackoverflow.com/questions/2584629/how-can-i-specifiy-junit-test-dependencies">I asked on StackOverflow</a> about options
to specify unit test dependencies. An example from the <a href="http://cdk.sf.net/">CDK</a> would be that aromaticity detection in some molecule would
require that all atom types are correctly perceived. I could test both in separate unit tests, but with <a href="http://www.junit.org/">JUnit</a> I
cannot have the aromaticity test ignored of the atom typing already failed. Now, being to specify such dependencies is useful, as the failing
aromaticity test may be caused by the faulty atom typing, but the failing aromaticity test seems to imply something is wrong with the
aromaticity detection algorithm.</p>

<p>One of the answers was <a href="http://scg.unibe.ch/research/jexample">JExample</a>. Consider this code:</p>

<div class="language-java highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nd">@RunWith</span><span class="o">(</span><span class="nc">JExample</span><span class="o">.</span><span class="na">class</span><span class="o">)</span>
<span class="kd">public</span> <span class="kd">class</span> <span class="nc">MoleculeTest</span> <span class="o">{</span>

  <span class="nd">@Test</span>
  <span class="kd">public</span> <span class="nc">MoleculeFactory</span> <span class="nf">testNewMoleculeFactory</span><span class="o">()</span> <span class="o">{</span>
    <span class="nc">Assert</span><span class="o">.</span><span class="na">fail</span><span class="o">(</span><span class="s">"too bad"</span><span class="o">);</span>
    <span class="k">return</span> <span class="k">new</span> <span class="nf">MoleculeFactory</span><span class="o">();</span>
  <span class="o">}</span>

  <span class="nd">@Given</span><span class="o">(</span><span class="s">"#testNewMoleculeFactory()"</span><span class="o">)</span>
  <span class="kd">public</span> <span class="nc">IMolecule</span> <span class="nf">testNewMolecule</span><span class="o">(</span><span class="nc">MoleculeFactory</span> <span class="n">factory</span><span class="o">)</span> <span class="o">{</span>
    <span class="nc">Assert</span><span class="o">.</span><span class="na">fail</span><span class="o">(</span><span class="s">"too bad"</span><span class="o">);</span>
    <span class="k">return</span> <span class="n">factory</span><span class="o">.</span><span class="na">getImmutable</span><span class="o">();</span>
  <span class="o">}</span>

<span class="o">}</span>
</code></pre></div></div>

<p>Reading this Java code requires some experience with JUnit4, but those who already know JUnit4 will also see that the code is somewhat
unusual. For of all, we define a special class to run the tests with: <em>JExample.class</em>. A second thing to note is that the top test method
actually returns something. The bottom test method is also differnt: instead of being annotated with <em>@Test</em>, it is annotated with
<em>@Given</em>. This latter annotation is introduced by JExample to define the dependencies between the tests. The parameter of this annotation
defines which test method it depends on. Moreover, it is now also clear what happens with the return value of the top test method: it is
passed as argument to the second test method.</p>

<p>Just to show that the system actually works, you can find a screenshot of the <a href="http://www.eclipse.org/">Eclipse</a> JUnit View
(the JExample update site did not work with Eclipse 3.6, so I have the JExample jar defined as build dependency in the project instead):</p>

<p><img src="/assets/images/jexample.png" alt="" /></p>

<p>Clearly, only one test failed, while the <em>testNewMolecule()</em> method was ignored.</p>

<p>Now, I was wondering if the first method could be reused, and if so, if it would construct a new object. And it does, as is clear from the output of this code:</p>

<div class="language-java highlighter-rouge"><div class="highlight"><pre class="highlight"><code>  <span class="nd">@Test</span>
  <span class="kd">public</span> <span class="nc">MoleculeFactory</span> <span class="nf">testNewMoleculeFactory</span><span class="o">()</span> <span class="o">{</span>
    <span class="k">return</span> <span class="k">new</span> <span class="nf">MoleculeFactory</span><span class="o">();</span>
  <span class="o">}</span>

  <span class="nd">@Given</span><span class="o">(</span><span class="s">"#testNewMoleculeFactory()"</span><span class="o">)</span>
  <span class="kd">public</span> <span class="nc">IMolecule</span> <span class="nf">testNewMolecule</span><span class="o">(</span><span class="nc">MoleculeFactory</span> <span class="n">factory</span><span class="o">)</span> <span class="o">{</span>
    <span class="nc">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="s">"Factory1: "</span> <span class="o">+</span> <span class="n">factory</span><span class="o">);</span>
    <span class="k">return</span> <span class="n">factory</span><span class="o">.</span><span class="na">getImmutable</span><span class="o">();</span>
  <span class="o">}</span>

  <span class="nd">@Given</span><span class="o">(</span><span class="s">"#testNewMoleculeFactory()"</span><span class="o">)</span>
  <span class="kd">public</span> <span class="nc">IMolecule</span> <span class="nf">testNewMolecule2</span><span class="o">(</span><span class="nc">MoleculeFactory</span> <span class="n">factory</span><span class="o">)</span> <span class="o">{</span>
    <span class="nc">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="s">"Factory2: "</span> <span class="o">+</span> <span class="n">factory</span><span class="o">);</span>
    <span class="k">return</span> <span class="n">factory</span><span class="o">.</span><span class="na">getImmutable</span><span class="o">();</span>
  <span class="o">}</span>
</code></pre></div></div>

<p>which outputs:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>Factory2: com.github.egonw.odk.model.MoleculeFactory@7bd63e39
Factory1: com.github.egonw.odk.model.MoleculeFactory@42b988a6
</code></pre></div></div>

<p>This seems pretty useful. I am not sure yet if it solves all my dependency requirements, though. For example, what I really like to do, is link more complex tests to more than one more simpler tests, where it is clear that the complexer test will fail if one or more of the simpler tests fail. However, the JExample examples suggest that I can only define one dependency, whereas, for example, aromaticity detection depends on correct atom type perception, but also on ring detection. For now, this is a welcome extension of JUnit.</p>]]></content><author><name>Egon Willighagen</name></author><category term="java" /><category term="junit" /><category term="justdoi:10.1007/978-3-540-68255-4_8" /><summary type="html"><![CDATA[A while ago I asked on StackOverflow about options to specify unit test dependencies. An example from the CDK would be that aromaticity detection in some molecule would require that all atom types are correctly perceived. I could test both in separate unit tests, but with JUnit I cannot have the aromaticity test ignored of the atom typing already failed. Now, being to specify such dependencies is useful, as the failing aromaticity test may be caused by the faulty atom typing, but the failing aromaticity test seems to imply something is wrong with the aromaticity detection algorithm.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://chem-bla-ics.linkedchemistry.info/assets/images/jexample.png" /><media:content medium="image" url="https://chem-bla-ics.linkedchemistry.info/assets/images/jexample.png" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">Extension point for running JUnit tests in a RCP Application instance?</title><link href="https://chem-bla-ics.linkedchemistry.info/2009/09/23/extension-point-for-running-junit-tests.html" rel="alternate" type="text/html" title="Extension point for running JUnit tests in a RCP Application instance?" /><published>2009-09-23T00:00:00+00:00</published><updated>2009-09-23T00:00:00+00:00</updated><id>https://chem-bla-ics.linkedchemistry.info/2009/09/23/extension-point-for-running-junit-tests</id><content type="html" xml:base="https://chem-bla-ics.linkedchemistry.info/2009/09/23/extension-point-for-running-junit-tests.html"><![CDATA[<p>One thing that has been on my wishlist is to be able to run the unit tests we have for <a href="http://www.bioclipse.net/">Bioclipse</a> from inside a
running Bioclipse instance. That is, we have a Bioclipse Test Suite features on the update site, matching the functional features we have
there. Each such test suite would run all <a href="http://www.junit.org/">JUnit</a> tests we have for that feature.</p>

<p>The good thing about this is twofold:</p>

<ol>
  <li>users can verify that their installation is working as intended</li>
  <li>the development team can easily run the test suite on foreign systems, without the need to install a fully operational <a href="http://www.eclipse.org/">Eclipse</a> with Bioclipse development workspace</li>
</ol>

<p>Now, the tricky thing is likely the following. How do we get to run all test suites? That is, I don’t want to need to have to run the suites
for each feature separately. Of course, this is exactly what <a href="http://www.vogella.de/articles/EclipseExtensionPoint/article.html">extension points</a>
are for.</p>

<p>So, my question is, did anyone set up an system like this? And, is there an extension point that allows features to plugin additional
JUnit test suites into a larger test suite dynamically?</p>]]></content><author><name>Egon Willighagen</name></author><category term="eclipse" /><category term="bioclipse" /><category term="junit" /><summary type="html"><![CDATA[One thing that has been on my wishlist is to be able to run the unit tests we have for Bioclipse from inside a running Bioclipse instance. That is, we have a Bioclipse Test Suite features on the update site, matching the functional features we have there. Each such test suite would run all JUnit tests we have for that feature.]]></summary></entry><entry><title type="html">State of CDK 1.2.0…</title><link href="https://chem-bla-ics.linkedchemistry.info/2008/12/26/state-of-cdk-120.html" rel="alternate" type="text/html" title="State of CDK 1.2.0…" /><published>2008-12-26T00:00:00+00:00</published><updated>2008-12-26T00:00:00+00:00</updated><id>https://chem-bla-ics.linkedchemistry.info/2008/12/26/state-of-cdk-120</id><content type="html" xml:base="https://chem-bla-ics.linkedchemistry.info/2008/12/26/state-of-cdk-120.html"><![CDATA[<p>The reason why I have not blogged in more than two weeks, was that I was hoping to blog about the CDK 1.2.0 release. This was originally aimed at
September, slipped into October, November and then December. There were only three show stoppers (see <a href="https://apps.sourceforge.net/mediawiki/cdk/index.php?title=CDK_1.2_TODO">this wiki page</a>),
one of which the <a href="http://cheminfo.informatics.indiana.edu/~rguha/code/java/nightly/api/org/openscience/cdk/interfaces/IChemObject.html">IChemObject</a>
interfaces were not properly tested.</p>

<p>The problem was that the unit tests for the methods in superinterfaces were not applied to implementations of subinterfaces.
For example, the unit test for <code class="language-plaintext highlighter-rouge">IElement.getSymbol()</code> was not applied to the class <code class="language-plaintext highlighter-rouge">Atom</code>, which implements <code class="language-plaintext highlighter-rouge">IAtom</code> which
is a subinterfaces of <code class="language-plaintext highlighter-rouge">IElement</code>.</p>

<p>In fixing this, I had to take some hurdles. For example: the unit test classes used a set up following the implementations; CDK 1.2.x has three
implementations of the interfaces: data, datadebug and nonotify. The last does not send around update notifications, and rough tests indicate it
is about 10% faster. The second implementation sends messages to the debugger for every modification of the data classes, which is, clearly,
useful for debugging purposes.</p>

<p>However, the JUnit4 test classes were basically doing the same. The unit test <code class="language-plaintext highlighter-rouge">DebugAtomTest</code> inherited form <code class="language-plaintext highlighter-rouge">AtomTest</code>, and only overwrote
customizations. <code class="language-plaintext highlighter-rouge">AtomTest</code>, itself, inherited from <code class="language-plaintext highlighter-rouge">ElementTest</code>. That’s where things got broken. In the single implementation set up, this
would have been fine, but to allow testing of all three implementations, <code class="language-plaintext highlighter-rouge">getBuilder()</code> had to be used.</p>

<p>And when I implemented that, I did not realize that <code class="language-plaintext highlighter-rouge">ElementTest</code> would do a test like:</p>

<div class="language-java highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nc">IElement</span> <span class="n">element</span> <span class="o">=</span> <span class="n">builder</span><span class="o">.</span><span class="na">newElement</span><span class="o">();</span>
<span class="c1">// test IElement functionality</span>
</code></pre></div></div>

<p>However, while the use of builder ensure testing of all three implementations, it does <strong>not</strong> run these tests on <code class="language-plaintext highlighter-rouge">IAtom</code> implementations.</p>

<p>The followed a long series of patches to get this fixed. One major first patch, was to define unit test frameworks like <code class="language-plaintext highlighter-rouge">AbstractElementTest</code>
which formalized running unit tests on any implementation, as I noticed that quite a few tests were still testing one particular implementation.
This allowed <code class="language-plaintext highlighter-rouge">DebugElementTest</code> to extend <code class="language-plaintext highlighter-rouge">AbstractElementTest</code>, instead of <code class="language-plaintext highlighter-rouge">ElementTest</code>, which would now extend <code class="language-plaintext highlighter-rouge">AbstractElementTest</code> too.</p>

<p>OK, with that out of the way, it was time to fix running the unit test for <code class="language-plaintext highlighter-rouge">IElement.getSymbol()</code> on <code class="language-plaintext highlighter-rouge">IAtom.getSymbol()</code>, which required the
removal of the use of <code class="language-plaintext highlighter-rouge">IChemObjectBuilder</code> implementations. So, I introduced <code class="language-plaintext highlighter-rouge">newChemObject()</code> which would return a fresh instance of the
actually tested implementation. That is, <code class="language-plaintext highlighter-rouge">DebugAtomTest</code> would return a new <code class="language-plaintext highlighter-rouge">DebugAtom</code>, and the <code class="language-plaintext highlighter-rouge">getSymbol()</code> test would now run on
<code class="language-plaintext highlighter-rouge">DebugAtom</code> and not <code class="language-plaintext highlighter-rouge">DebugElement</code>. Good.</p>

<p>No, not good. The actual implementation I was using, looks like:</p>

<div class="language-java highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="kd">public</span> <span class="kd">class</span> <span class="nc">DebugElementTest</span> <span class="n">extend</span> <span class="nc">AbstractElementTest</span> <span class="o">{</span>
  <span class="nd">@BeforeClass</span> <span class="kd">public</span> <span class="kd">static</span> <span class="kt">void</span> <span class="nf">setup</span><span class="o">()</span> <span class="o">{</span>
    <span class="n">setChemObject</span><span class="o">(</span><span class="k">new</span> <span class="nc">DebugElement</span><span class="o">());</span>
  <span class="o">}</span>
<span class="o">}</span>

<span class="kd">public</span> <span class="kd">abstract</span> <span class="kd">class</span> <span class="nc">AbstractElementTest</span> <span class="n">extend</span> <span class="nc">AbstractChemObjectTest</span> <span class="o">{</span>
  <span class="nd">@Test</span> <span class="kd">public</span> <span class="kt">void</span> <span class="nf">testGetSymbol</span><span class="o">()</span> <span class="o">{</span>
    <span class="nc">IElement</span> <span class="n">element</span> <span class="o">=</span> <span class="o">(</span><span class="nc">IElement</span><span class="o">)</span><span class="n">newChemObject</span><span class="o">();</span>
    <span class="c1">// do testing</span>
  <span class="o">}</span>
<span class="o">}</span>

<span class="kd">public</span> <span class="kd">abstract</span> <span class="kd">class</span> <span class="nc">AbstractChemObjectTest</span> <span class="o">{</span>
  <span class="kd">private</span> <span class="nc">IChemObject</span> <span class="n">testedObject</span><span class="o">;</span>
  <span class="kd">public</span> <span class="kd">static</span> <span class="nf">setChemObject</span><span class="o">(</span><span class="nc">IChemObject</span> <span class="n">object</span><span class="o">)</span> <span class="o">{</span>
    <span class="k">this</span><span class="o">.</span><span class="na">testedObject</span> <span class="o">=</span> <span class="n">object</span><span class="o">;</span>
  <span class="o">}</span>
  <span class="kd">public</span> <span class="nc">IChemObject</span> <span class="nf">setChemObject</span><span class="o">(</span><span class="nc">IChemObject</span> <span class="n">object</span><span class="o">)</span> <span class="o">{</span>
    <span class="k">return</span> <span class="o">(</span><span class="nc">IChemObject</span><span class="o">)</span><span class="n">testedObject</span><span class="o">.</span><span class="na">clone</span><span class="o">();</span>
  <span class="o">}</span> <span class="c1">// just imagine it has try/catch here too</span>

  <span class="c1">// and here the tests for the IChemObject API</span>
  <span class="nd">@Test</span> <span class="kd">public</span> <span class="kt">void</span> <span class="nf">testGetProperties</span><span class="o">()</span> <span class="o">{</span>
    <span class="nc">IChemObject</span> <span class="n">element</span> <span class="o">=</span> <span class="o">(</span><span class="nc">IChemObject</span><span class="o">)</span><span class="n">newChemObject</span><span class="o">();</span>
    <span class="c1">// do testing</span>
  <span class="o">}</span>
<span class="o">}</span>
</code></pre></div></div>

<p>Excellent! No.</p>

<p>Well, yes. The above system works, but made many unit tests fail, because of bugs in <code class="language-plaintext highlighter-rouge">clone()</code> methods. The full scope has to be explored,
but at least <code class="language-plaintext highlighter-rouge">IPolymer.clone()</code> is not doing what I would expect it to do. Either I am wrong, and need to overwrite the clone unit tests
of superinterfaces in <code class="language-plaintext highlighter-rouge">AbstractPolymerTest</code>, or the implementations needs fixing. I emailed the cdk-devel mailing list and filed a bug
report. But having about 1000 unit tests fail, because of clone broken, is something I did not like. For example, as it makes bug fixing
more difficult.</p>

<p>So, next step was to find an approach that did not require clone, but give some interesting insights in the Java language. JUnit4 requires
the <code class="language-plaintext highlighter-rouge">@BeforeClass</code> method to be static. This means I cannot have a non-static <code class="language-plaintext highlighter-rouge">DebugElementTest</code> method return an instance. And, you
cannot overwrite a static method! That had never occured to me in the past. <code class="language-plaintext highlighter-rouge">DebugElementTest.newChemObject()</code> does not overwrite
<code class="language-plaintext highlighter-rouge">AbstractChemObjectTest.newChemObject</code> which is somewhere upstream.</p>

<p>But, after discussing matters with Carl, I ended up with this approach:</p>

<div class="language-java highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="kd">public</span> <span class="kd">abstract</span> <span class="kd">class</span> <span class="nc">AbstractChemObjectTest</span> <span class="kd">extends</span> <span class="nc">CDKTestCase</span> <span class="o">{</span>
  <span class="kd">private</span> <span class="kd">static</span> <span class="nc">ITestObjectBuilder</span> <span class="n">builder</span><span class="o">;</span>
  <span class="kd">public</span> <span class="kd">static</span> <span class="kt">void</span> <span class="nf">setTestObjectBuilder</span><span class="o">(</span><span class="nc">ITestObjectBuilder</span> <span class="n">builder</span><span class="o">)</span> <span class="o">{</span>
    <span class="nc">AbstractChemObjectTest</span><span class="o">.</span><span class="na">builder</span> <span class="o">=</span> <span class="n">builder</span><span class="o">;</span>
  <span class="o">}</span>
  <span class="kd">public</span> <span class="kd">static</span> <span class="nc">IChemObject</span> <span class="nf">newChemObject</span><span class="o">()</span> <span class="o">{</span>
    <span class="k">return</span> <span class="nc">AbstractChemObjectTest</span><span class="o">.</span><span class="na">builder</span><span class="o">.</span><span class="na">newTestObject</span><span class="o">();</span>
  <span class="o">}</span>
<span class="o">}</span>

<span class="kd">public</span> <span class="kd">interface</span> <span class="nc">ITestObjectBuilder</span> <span class="o">{</span>
  <span class="kd">public</span> <span class="nc">IChemObject</span> <span class="nf">newTestObject</span><span class="o">();</span>
<span class="o">}</span>

<span class="kd">public</span> <span class="kd">class</span> <span class="nc">DebugAtomTest</span> <span class="kd">extends</span> <span class="nc">AbstractAtomTest</span> <span class="o">{</span>
  <span class="nd">@BeforeClass</span> <span class="kd">public</span> <span class="kd">static</span> <span class="kt">void</span> <span class="nf">setUp</span><span class="o">()</span> <span class="o">{</span>
    <span class="n">setTestObjectBuilder</span><span class="o">(</span><span class="k">new</span> <span class="nc">ITestObjectBuilder</span><span class="o">()</span> <span class="o">{</span>
      <span class="kd">public</span> <span class="nc">IChemObject</span> <span class="nf">newTestObject</span><span class="o">()</span> <span class="o">{</span>
        <span class="k">return</span> <span class="k">new</span> <span class="nf">DebugAtom</span><span class="o">();</span>
      <span class="o">}</span>
    <span class="o">});</span>
  <span class="o">}</span>
<span class="o">}</span>
</code></pre></div></div>]]></content><author><name>Egon Willighagen</name></author><category term="cdk" /><category term="junit" /><category term="java" /><summary type="html"><![CDATA[The reason why I have not blogged in more than two weeks, was that I was hoping to blog about the CDK 1.2.0 release. This was originally aimed at September, slipped into October, November and then December. There were only three show stoppers (see this wiki page), one of which the IChemObject interfaces were not properly tested.]]></summary></entry><entry><title type="html">Comparing JUnit test results between CDK trunk/ and a branch #2</title><link href="https://chem-bla-ics.linkedchemistry.info/2008/05/02/comparing-junit-test-results-between.html" rel="alternate" type="text/html" title="Comparing JUnit test results between CDK trunk/ and a branch #2" /><published>2008-05-02T00:00:00+00:00</published><updated>2008-05-02T00:00:00+00:00</updated><id>https://chem-bla-ics.linkedchemistry.info/2008/05/02/comparing-junit-test-results-between</id><content type="html" xml:base="https://chem-bla-ics.linkedchemistry.info/2008/05/02/comparing-junit-test-results-between.html"><![CDATA[<p>I reported earlier on how to compare unit test results <a href="https://chem-bla-ics.linkedchemistry.info/2007/11/07/comparing-junit-test-results-between.html">between CDK trunk and a branch <i class="fa-solid fa-recycle fa-xs"></i></a>.
Later, I noted that the diff typically overestimates the fail count, when unit tests had been moved to a different module. Therefore, a sort has
to be added. The code is also updated for the SVN directory restructuring:</p>

<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nv">$ </span>cdk cdk/
<span class="nv">$ </span>cdk trunk/
<span class="nv">$ </span>ant <span class="nt">-lib</span> develjar/junit-4.3.1.jar <span class="nt">-logfile</span> ant.log test-all
<span class="nv">$ </span><span class="nb">cd</span> ../branches/miguelrojasch-CMLReact
<span class="nv">$ </span>ant <span class="nt">-lib</span> develjar/junit-4.3.1.jar <span class="nt">-logfile</span> ant.log test-all
<span class="nv">$ </span><span class="nb">cd</span> ..
<span class="nv">$ </span><span class="nb">grep </span>Testcase trunk/reports/<span class="k">*</span>.txt | <span class="nb">cut</span> <span class="nt">-d</span><span class="s1">':'</span> <span class="nt">-f2</span>,3 | <span class="nb">sort</span> <span class="o">&gt;</span> trunk.results
<span class="nv">$ </span><span class="nb">grep </span>Testcase branches/miguelrojasch-CMLReact/reports/<span class="k">*</span>.txt | <span class="nb">cut</span> <span class="nt">-d</span><span class="s1">':'</span> <span class="nt">-f2</span>,3 | <span class="nb">sort</span> <span class="o">&gt;</span> branch.results
<span class="nv">$ </span>diff <span class="nt">-u</span> trunk.results branch.results
</code></pre></div></div>

<p>Obviously, you can still use wc for counting changes:</p>

<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nv">$ </span>diff <span class="nt">-u</span> trunk.results branch.results | <span class="nb">grep</span> <span class="s2">"^-Testcase"</span> | <span class="nb">wc</span> <span class="nt">-l</span>
<span class="nv">$ </span>diff <span class="nt">-u</span> trunk.results branch.results | <span class="nb">grep</span> <span class="s2">"^+Testcase"</span> | <span class="nb">wc</span> <span class="nt">-l</span>
</code></pre></div></div>

<p>A second improvement, would be taking advantage of the ant.log files that are created anyway. Using the
<a href="http://www.beanshell.org/">BeanShell</a> tool <a href="http://cdk.svn.sourceforge.net/viewvc/cdk/cdk/trunk/tools/extractTestStats.bsh?revision=10760&amp;view=markup">tools/extractTestStats.bsh <i class="fa-solid fa-recycle fa-xs"></i></a>
revision 10760 (see also <a href="https://chem-bla-ics.linkedchemistry.info/2008/02/27/cdk-is-now-available-from-your-nearest.html">this blog on bsh</a>):</p>

<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nv">$ </span>bsh trunk/tools/extractTestStats.bsh trunk/ant.log | <span class="nb">grep </span>run | <span class="nb">grep</span> <span class="nt">-v</span> total | <span class="nb">grep</span> <span class="nt">-v</span> antlogFile | <span class="nb">cut</span> <span class="nt">-d</span><span class="s1">' '</span> <span class="nt">-f1-4</span> | <span class="nb">sort</span> <span class="o">&gt;</span> trunk.overview
<span class="nv">$ </span>bsh trunk/tools/extractTestStats.bsh branches/miguelrojasch-CMLReact/ant.log | <span class="nb">grep </span>run | <span class="nb">grep</span> <span class="nt">-v</span> total | <span class="nb">grep</span> <span class="nt">-v</span> antlogFile | <span class="nb">cut</span> <span class="nt">-d</span><span class="s1">' '</span> <span class="nt">-f1-4</span> | <span class="nb">sort</span> <span class="o">&gt;</span> branch.overview
<span class="nv">$ </span>diff <span class="nt">-u</span> trunk.overview branch.overview
</code></pre></div></div>]]></content><author><name>Egon Willighagen</name></author><category term="cdk" /><category term="junit" /><summary type="html"><![CDATA[I reported earlier on how to compare unit test results between CDK trunk and a branch . Later, I noted that the diff typically overestimates the fail count, when unit tests had been moved to a different module. Therefore, a sort has to be added. The code is also updated for the SVN directory restructuring:]]></summary></entry><entry><title type="html">Comparing JUnit test results between CDK trunk/ and a branch</title><link href="https://chem-bla-ics.linkedchemistry.info/2007/11/07/comparing-junit-test-results-between.html" rel="alternate" type="text/html" title="Comparing JUnit test results between CDK trunk/ and a branch" /><published>2007-11-07T00:00:00+00:00</published><updated>2007-11-07T00:00:00+00:00</updated><id>https://chem-bla-ics.linkedchemistry.info/2007/11/07/comparing-junit-test-results-between</id><content type="html" xml:base="https://chem-bla-ics.linkedchemistry.info/2007/11/07/comparing-junit-test-results-between.html"><![CDATA[<p>I have started using branches for non-trivial patches, like removing the HückelAromaticityDetector, in favor of the
<a href="https://chem-bla-ics.linkedchemistry.info/2007/11/06/evidence-of-aromaticity.html">new CDKHückelAromaticityDetector <i class="fa-solid fa-recycle fa-xs"></i></a>. I am doing
this in my personal <a href="http://cdk.svn.sf.net/svnroot/cdk/branches/egonw/remove-non-cdkatomtype-code/">remove-non-cdkatomtype-code</a>
branch, where I can quietly work on the patch until I am happy about it. I make sure to keep it synchronized with
trunk with regular <code class="language-plaintext highlighter-rouge">svn merge</code> commands.</p>

<p>Now, the goal is that my branch only fixed failing JUnit tests, not that it creates new regressions. To compare the
results between two versions of the <a href="">CDK</a>, I use these commands:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ cd cdk/trunk/cdk
$ ant -lib develjar/junit-4.3.1.jar -logfile ant.log test-all
$ cd ../../branches/egonw/remove-non-cdkatomtype-code/
$ ant -lib develjar/junit-4.3.1.jar -logfile ant.log test-all
$ cd ../../..
$ grep Testcase branches/egonw/remove-non-cdkatomtype-code/reports/*.txt | cut -d':' -f2,3 &gt; branch.results
$ grep Testcase trunk/cdk/reports/*.txt | cut -d':' -f2,3 &gt; trunk.results
$ diff -u trunk.results branch.results
</code></pre></div></div>

<p>The last diff commands gives me a quick overview of what has changed. See get the statistics, I can do:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ diff -u trunk.results branch.results | grep "^-Testcase" | wc -l
$ diff -u trunk.results branch.results | grep "^+Testcase" | wc -l
</code></pre></div></div>

<p>The first gives me the number of JUnit tests which are now no longer failing, while the second
gives me the number of tests which are new fails. Ideally, the second is zero. Unfortunately, not yet the case :)</p>]]></content><author><name>Egon Willighagen</name></author><category term="cdk" /><category term="junit" /><summary type="html"><![CDATA[I have started using branches for non-trivial patches, like removing the HückelAromaticityDetector, in favor of the new CDKHückelAromaticityDetector . I am doing this in my personal remove-non-cdkatomtype-code branch, where I can quietly work on the patch until I am happy about it. I make sure to keep it synchronized with trunk with regular svn merge commands.]]></summary></entry><entry><title type="html">Atom typing in the CDK</title><link href="https://chem-bla-ics.linkedchemistry.info/2007/07/01/atom-typing-in-cdk.html" rel="alternate" type="text/html" title="Atom typing in the CDK" /><published>2007-07-01T00:00:00+00:00</published><updated>2007-07-01T00:00:00+00:00</updated><id>https://chem-bla-ics.linkedchemistry.info/2007/07/01/atom-typing-in-cdk</id><content type="html" xml:base="https://chem-bla-ics.linkedchemistry.info/2007/07/01/atom-typing-in-cdk.html"><![CDATA[<p>Atom typing is one of principal activities in chemoinformatics. Atom types provide additional information that cannot be derived
from the connection table that is being used, or may define what force fields terms should be used. This makes perception of
atom types very important.</p>

<p>The <a href="http://cdk.sf.net/">CDK</a> has a few places where atom types are perceived. The <a href="http://cdk.svn.sf.net/svnroot/cdk/trunk/cdk/src/org/openscience/cdk/tools/HydrogenAdder.java">HydrogenAdder</a>
and <a href="http://cdk.svn.sf.net/svnroot/cdk/trunk/cdk/src/org/openscience/cdk/tools/ValencyChecker.java">ValencyChecker</a> are two examples.
Getting the perception wrong, makes it impossible to correctly add hydrogens (of course, hydrogen should always be explicit!) For a
long time, these perception algorithms have been embedded in the classes that used them, but efforts have been undertaken to refactor
the algorithms into separate classes. These can be found in the package <a href="http://cdk.svn.sf.net/svnroot/cdk/trunk/cdk/src/org/openscience/cdk/atomype/">cdk/atomtype/</a>.</p>

<h2 id="different-applications-different-scheme">Different applications, different scheme</h2>

<p>Now, the CDK can be a bit confusing with respect to the HydrogenAdder and <a href="http://cdk.svn.sf.net/svnroot/cdk/trunk/cdk/src/org/openscience/cdk/tools/IValencyChecker.java">IValencyChecker</a>.
Originally, the CDK had only one atom type list, the <a href="http://cdk.svn.sf.net/svnroot/cdk/trunk/cdk/src/org/openscience/cdk/config/data/valency_atomtypes.xml">StructGen Atom Types</a>.
This list was used by the deterministic structure generator (and still is), and only defined atom types for neutral atoms, and does not know anything about hybridization states.</p>

<p>The first bug reports dropped in when people applied the HydrogenAdder to charged molecules. However, as said, charged atoms were not defined and the algorithm failed,
not silently, just gave the wrong answer. Therefore, the <a href="http://cdk.svn.sf.net/svnroot/cdk/trunk/cdk/src/org/openscience/cdk/config/data/valency_atomtypes.xml">Valency Atom Types</a>
list was setup, which does include charged atoms. Everyone happy again.</p>

<p>Later, bugs were reported about the SMILES parser, which comes with additional problems: bond orders are not explicit, and have to be
deduced from the connectivity; atom type perception is the only way to decide how many bonds an atom should have, and with what bond
order. However, SMILES defines hybridization states, and the CDK did not have an atom type list with hybridization information. So,
while the Valency Atom Types list was extended from the StructGen Atom Type List, a new list was created extending from the Valency
Atom Type list: the <a href="http://cdk.svn.sf.net/svnroot/cdk/trunk/cdk/src/org/openscience/cdk/config/data/hybridization_atomtypes.xml">Hybridization Atom Types</a>
list.</p>

<p>Since then, applications asked for other atom type lists, such as the <a href="http://cdk.svn.sf.net/svnroot/cdk/trunk/cdk/src/org/openscience/cdk/config/data/mm2_atomtypes.xml">MM2</a>,
<a href="http://cdk.svn.sf.net/svnroot/cdk/trunk/cdk/src/org/openscience/cdk/config/data/mmff94_atomtypes.xml">MMFF94</a>,
<a href="http://cdk.svn.sf.net/svnroot/cdk/trunk/cdk/src/org/openscience/cdk/config/data/pdb_atomtypes.xml">PDB</a>, and
<a href="http://cdk.svn.sf.net/svnroot/cdk/trunk/cdk/src/org/openscience/cdk/config/data/mol2_atomtypes.xml">Sybyl</a> atom
types. The first two are used for the force field code in the CDK, while the latter two are used for the respective
IChemObjectReaders.</p>

<h2 id="junit-testing-the-perceivers">JUnit testing the perceivers</h2>

<p>Not all applications actually already make use of the new atom type perception classes in cdk.atomtype. It is wished that these well tested
before the replace code in the classes that use those atom types. Therefore, Rajarshi and me have been working on JUnit test suites. The
latest step in this process was that I transformed the test classes to extend a new JUnit4-based
<a href="http://cdk.svn.sf.net/svnroot/cdk/trunk/cdk/src/org/openscience/cdk/test/atomtype/AbstractAtomTypeTest.java">AbstractAtomTypeTest</a> class.
New in this class is that it report which atom types in the atom type list have been tested, and the test will fail if not all atom types
are tested. The StructGen Atom Types list is mostly covered now, but for all other lists tests still have to be written (monitor the progress
on <a href="http://cheminfo.informatics.indiana.edu/~rguha/code/java/nightly/test/result-core.html">CDK Nightly</a>).</p>

<p>For the MOL2 atom type list, there is no Java implementation of the IAtomTypeMatcher, but we have Fortran code that can be ported (provided
by Martin Ott). Anyone interested?</p>]]></content><author><name>Egon Willighagen</name></author><category term="cdk" /><category term="junit" /><summary type="html"><![CDATA[Atom typing is one of principal activities in chemoinformatics. Atom types provide additional information that cannot be derived from the connection table that is being used, or may define what force fields terms should be used. This makes perception of atom types very important.]]></summary></entry><entry><title type="html">CDK 1.0: a milestone after 7 year of development</title><link href="https://chem-bla-ics.linkedchemistry.info/2007/04/23/cdk-10-milestone-after-7-year-of.html" rel="alternate" type="text/html" title="CDK 1.0: a milestone after 7 year of development" /><published>2007-04-23T00:00:00+00:00</published><updated>2007-04-23T00:00:00+00:00</updated><id>https://chem-bla-ics.linkedchemistry.info/2007/04/23/cdk-10-milestone-after-7-year-of</id><content type="html" xml:base="https://chem-bla-ics.linkedchemistry.info/2007/04/23/cdk-10-milestone-after-7-year-of.html"><![CDATA[<p>Last night, I <a href="http://sourceforge.net/project/showfiles.php?group_id=20024">released CDK 1.0</a> as the previous release candidate
did not show up new major problems. It is far from a perfect release (see these still <a href="http://wiki.cubic.uni-koeln.de/cdkwiki/doku.php?id=cdk1.0">TODO</a>’s
and <a href="http://cheminfo.informatics.indiana.edu/~rguha/code/java/nightly/">Nightly</a>, run by
<a href="http://cheminfoclub.blogspot.com/">Rajarshi</a>), but the core is pretty solid.</p>

<p>I would warmly thank everyone who has contributed to the project in one way or another (I worked more on maintainance than
implementing functionality), as it has been a great pleasure to make CDK releases. <a href="http://www.ohloh.net/">OHLOH</a> runs a rather nice
developer <a href="http://www.ohloh.net/projects/380/analyses/latest/contributors">hall of fame for the CDK</a>. You’ll see that
<a href="http://wiki.cubic.uni-koeln.de/blog/">Christoph</a>’s research group is the major contributor. User contributions, however,
are equally important and played a bug role in the quite <a href="http://cheminfo.informatics.indiana.edu/~rguha/code/java/nightly/junitsummary.html">large set of JUnit tests</a>
we have now (3300+).</p>

<p>Another reason why this is an important milestone, is that it is the last release I am creating. I wrote on the user list:</p>

<blockquote>
  <p>In advance of the actual CDK 1.0 release, thanx very much to all that contributed big <em>and</em> small ! It was a great 7 years of open source
chemoinformatics development!</p>

  <p>Hey, that actually sounds like I am stepping down… Well, it <em>is</em> time for a new generation to step up indeed. I won’t leave the project,
but being CDK News editor, CDK release manager, CDK code developer is a bit much for doing outside office hours. I feel that I have clearly
enough made my point for open source chemoinformatics, and it is time for something else… which will very likely involve the CDK, but
likely more as user only… I was hoping in the past few years, that the transition would go smoothly, and have been trying to get people
interested in various emails, including this one; however, being humans, we wait for the catastrophe and only after that we’re shocked and
start doing something about it. So, yeah, I’m forced to make this drastic announcement: CDK 1.0 will be the last CDK release <em>I</em> will make.</p>
</blockquote>

<p>So, who wants to take over? Some one will have to. I, however, will put my focus on other things. Very likely involving the CDK, as there
are still many things I want to do. Some things I have on my list:</p>

<ul>
  <li>the Java2D based 2D renderer/editor</li>
  <li>more accurate atom type perception</li>
  <li>more articles for CDK News</li>
  <li>the book “CDK for Dummies”</li>
  <li>improved structure generator</li>
  <li>validation</li>
  <li>…</li>
</ul>]]></content><author><name>Egon Willighagen</name></author><category term="cdk" /><category term="cheminf" /><category term="junit" /><summary type="html"><![CDATA[Last night, I released CDK 1.0 as the previous release candidate did not show up new major problems. It is far from a perfect release (see these still TODO’s and Nightly, run by Rajarshi), but the core is pretty solid.]]></summary></entry><entry><title type="html">Code coverage: making sure your code is tested</title><link href="https://chem-bla-ics.linkedchemistry.info/2006/11/28/code-coverage-making-sure-your-code-is.html" rel="alternate" type="text/html" title="Code coverage: making sure your code is tested" /><published>2006-11-28T00:00:00+00:00</published><updated>2006-11-28T00:00:00+00:00</updated><id>https://chem-bla-ics.linkedchemistry.info/2006/11/28/code-coverage-making-sure-your-code-is</id><content type="html" xml:base="https://chem-bla-ics.linkedchemistry.info/2006/11/28/code-coverage-making-sure-your-code-is.html"><![CDATA[<p>Recently I <a href="https://chem-bla-ics.linkedchemistry.info/2006/10/26/running-single-junit-tests-in-eclipse.html">discussed JUnit testing from within Eclipse <i class="fa-solid fa-recycle fa-xs"></i></a>,
and blogged at <a href="http://search.blogger.com/?as_q=JUnit&amp;ie=UTF-8&amp;x=0&amp;y=0&amp;q=JUnit+blogurl:chem-bla-ics.blogspot.com&amp;ui=blg&amp;start=0">several occasions</a> <!-- keep link -->
about it in other situations. I cannot stress enough how useful unit testing is: it adds this extra set of
<a href="http://en.wikipedia.org/wiki/Given_enough_eyeballs,_all_bugs_are_shallow">eyeballs to make bugs shallow</a>.
And it does that, indeed.</p>

<p>Ensuring that you actually test all the code you write, however, is not easy. A couple of years back I read an article about
<a href="http://hansel.sf.net/">Hansel</a>, which does code coverage checking, but never got it nicely working for the
<a href="http://cdk.sf.net/">CDK project</a>. Never looked at that lately, so no idea how the current release would work out.
Hansel is an extension of <a href="http://www.junit.org/">JUnit</a>, and requires hard coding class names, which conflicts with
CDK’s module setup.</p>

<p>Thomas Kuhn pointed me last week to <a href="http://emma.sf.net/">Emma</a>, which seems a nice tool. It does not require hacking
our source, and generates cool HTML:</p>

<p><img src="/assets/images/emmaCoverage.png" alt="" /></p>

<p>And even highlights the source code:</p>

<p><img src="/assets/images/emmaCoverage1.png" alt="" /></p>

<p>BTW, I seem to be in good company: <a href="http://www.gnu.org/software/classpath/">Classpath</a> is
<a href="http://builder.classpath.org/~cpdev/coverage/">using it too</a>.</p>

<p>Below is the command I issued to generate the HTML output. Rajarshi, maybe this can be integrated into
<a href="http://cheminfo.informatics.indiana.edu/~rguha/code/java/nightly/">Nightly</a>? Note that it only runs the tests
for the data module:</p>

<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>ant dist-large dist-test-large
java <span class="nt">-cp</span> ~/tmp/emma-2.0.5312/lib/emma.jar emmarun <span class="se">\</span>
  <span class="nt">-cp</span> develjar/junit.jar:dist/jar/cdk-svn-20061128.jar:dist/jar/cdk-test-svn-20061128.jar <span class="se">\</span>
  <span class="nt">-r</span> html <span class="nt">-sp</span> src junit.textui.TestRunner org.openscience.cdk.test.MdataTest
</code></pre></div></div>]]></content><author><name>Egon Willighagen</name></author><category term="opensource" /><category term="cdk" /><category term="junit" /><summary type="html"><![CDATA[Recently I discussed JUnit testing from within Eclipse , and blogged at several occasions about it in other situations. I cannot stress enough how useful unit testing is: it adds this extra set of eyeballs to make bugs shallow. And it does that, indeed.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://chem-bla-ics.linkedchemistry.info/assets/images/emmaCoverage1.png" /><media:content medium="image" url="https://chem-bla-ics.linkedchemistry.info/assets/images/emmaCoverage1.png" xmlns:media="http://search.yahoo.com/mrss/" /></entry></feed>