Integrating Structure101 with your build process
Since Miquel has blogged about his experiences integrating Coverity Prevent with our build process, I thought I would do something similar for Structure101. I explained what this tool is and how it helps you keep track of dependencies within your codebase in a previous posting. But that was just my experience of using the standalone client. Now I’m going to describe how I got it running as part of our continuous integration system.
Unlike Coverity Prevent, Structure101 is quite easy to integrate with ant. It doesn’t come with ant targets as such, but it does come with a set of java-driven command line utilities. These are easy to call from ant using the <java> task. So getting Structure101 to run was fairly easy.
I used the S101Report utility to generate a simple HTML file to show the overview details. However, it would be nice to show more detail and to be able to see changes over time. In order to do this you need to have a repository and to publish your results to it. Again this was not too difficult using S101Publisher. I appreciated the fact that you can label the snapshots you publish, which meant that I could use the build number coming from our continuous integration system and tie the information together.
Once you have published snapshots in the repository, you need to be able to view them. Like Coverity Prevent there is a web application that acts as a front end to this information. But unlike Coverity, this webapp can be deployed in a standard servlet container such as Apache Tomcat. This was good, because we are already running one to provide a web interface to the build system. So with the web application deployed I could link to the results stored in the repository.
So overall I was pleased with how easy it was to get it working. The details of the analysis are still slightly difficult to get at, because you have to navigate to the Structure101 web app to see them. It is possible to get simple graphs out of the web app which could be embedded in a project dashboard or the like. But there isn’t any documentation for these - you just end up grabbing the URL of the graphs already displayed and tinkering with them. In an ideal world there’d be some JavaScript that you could embed in a results page that would pull out the required graphs or figures without the need to actually navigate to the web app itself.

(3 votes, average: 4.67 out of 5)
December 14th, 2008 at 9:54 pm
[…] David (arriving a little late) said that he thought it was a brilliant book. The only problem is that he would prefer a small number of files to look at whereas with Java you tend to get something of an explosion of classes. Using dependency injection tends to exacerbate this. We moved on to discussing dependencies between packages and I gave Structure 101 a name check. I’ve used this at work to keep dependencies in check - a fact which I have blogged about. […]