{
  "version": "https://jsonfeed.org/version/1.1",
  "title": "chem-bla-ics",
  "description": "Chemblaics (pronounced chem-bla-ics) is the science that uses open science and computers to solve problems in chemistry, biochemistry and related fields.",
  "home_page_url": "https://chem-bla-ics.linkedchemistry.info/",
  "feed_url": "https://chem-bla-ics.linkedchemistry.info/2006/11/28/code-coverage-making-sure-your-code-is.json",
  "icon": "https://chem-bla-ics.linkedchemistry.info/assets/images/chem-bla-ics_logo.png",
  "language": "en",
  "authors": [
    {
      "name": "Egon Willighagen",
      "url": "https://orcid.org/0000-0001-7542-0286",
      "_orcid": "0000-0001-7542-0286"
    }
  ],
  "items": [

    {
      "id": "https://doi.org/10.59350/gtt31-tee03",
      "url": "https://chem-bla-ics.linkedchemistry.info/2006/11/28/code-coverage-making-sure-your-code-is.html",
      "title": "Code coverage: making sure your code is tested",
      "content_html": "<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>,\nand 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 -->\nabout it in other situations. I cannot stress enough how useful unit testing is: it adds this extra set of\n<a href=\"http://en.wikipedia.org/wiki/Given_enough_eyeballs,_all_bugs_are_shallow\">eyeballs to make bugs shallow</a>.\nAnd it does that, indeed.</p>\n\n<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\n<a href=\"http://hansel.sf.net/\">Hansel</a>, which does code coverage checking, but never got it nicely working for the\n<a href=\"http://cdk.sf.net/\">CDK project</a>. Never looked at that lately, so no idea how the current release would work out.\nHansel is an extension of <a href=\"http://www.junit.org/\">JUnit</a>, and requires hard coding class names, which conflicts with\nCDK’s module setup.</p>\n\n<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\nour source, and generates cool HTML:</p>\n\n<p><img src=\"/assets/images/emmaCoverage.png\" alt=\"\" /></p>\n\n<p>And even highlights the source code:</p>\n\n<p><img src=\"/assets/images/emmaCoverage1.png\" alt=\"\" /></p>\n\n<p>BTW, I seem to be in good company: <a href=\"http://www.gnu.org/software/classpath/\">Classpath</a> is\n<a href=\"http://builder.classpath.org/~cpdev/coverage/\">using it too</a>.</p>\n\n<p>Below is the command I issued to generate the HTML output. Rajarshi, maybe this can be integrated into\n<a href=\"http://cheminfo.informatics.indiana.edu/~rguha/code/java/nightly/\">Nightly</a>? Note that it only runs the tests\nfor the data module:</p>\n\n<div class=\"language-shell highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code>ant dist-large dist-test-large\njava <span class=\"nt\">-cp</span> ~/tmp/emma-2.0.5312/lib/emma.jar emmarun <span class=\"se\">\\</span>\n  <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>\n  <span class=\"nt\">-r</span> html <span class=\"nt\">-sp</span> src junit.textui.TestRunner org.openscience.cdk.test.MdataTest\n</code></pre></div></div>",
      "summary": "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.",
      "image": "https://chem-bla-ics.linkedchemistry.info/assets/images/emmaCoverage1.png",
      "date_published": "2006-11-28T00:00:00+00:00",
      "date_modified": "2025-02-16T00:00:00+00:00",
      "tags": ["opensource","cdk","junit"],
      
      
      
      
      
      
        "authors": [ { "name": "Egon Willighagen", "url": "https://orcid.org/0000-0001-7542-0286" } ]
      
    }

  ]
}
