cdk2024 #6: wrapping up already
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 have did a few more JUnit testing updates last week:
Actually, you see one pull request 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.
This coverage testing 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:
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:
The CDK started routinely using unit testing somewhere in the zeroes, with home made continous integration as early as 2006, shared with the development community every night, thanks to Rajarshi Guha’s effort. We had our first code coverage results in the same year. And at some point we had sufficient coverage that it gave us the opportunity to routinely check the impact of a patch. Of course, this is exactly what many open source projects do with GitHub Actions nowadays.
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!