<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>rob bowley &#187; internal quality</title>
	<atom:link href="http://blog.robbowley.net/tag/internal-quality/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.robbowley.net</link>
	<description>adventures in extreme programming</description>
	<lastBuildDate>Thu, 15 Jul 2010 08:12:02 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Visualising the internal quality of software: Part 2</title>
		<link>http://blog.robbowley.net/2009/11/03/visualising-the-internal-quality-of-software-pt-2/</link>
		<comments>http://blog.robbowley.net/2009/11/03/visualising-the-internal-quality-of-software-pt-2/#comments</comments>
		<pubDate>Tue, 03 Nov 2009 17:23:26 +0000</pubDate>
		<dc:creator>rob</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[code quality]]></category>
		<category><![CDATA[dashboards]]></category>
		<category><![CDATA[internal quality]]></category>

		<guid isPermaLink="false">http://blog.robbowley.net/?p=915</guid>
		<description><![CDATA[In part 1 I talked about how we&#8217;re using NDepend and NCover to generate highly visual reports for our projects.
These tools look great, but are of limited use without being able to analyse how changes to the code have affected the metrics. In this article I want to talk about a couple of ways we [...]]]></description>
			<content:encoded><![CDATA[<p>In <strong><a href="/2009/10/28/visualising-the-internal-quality-of-software-part-1/">part 1</a></strong> I talked about how we&#8217;re using NDepend and NCover to generate highly visual reports for our projects.</p>
<p>These tools look great, but are of limited use without being able to analyse how changes to the code have affected the metrics. In this article I want to talk about a couple of ways we can use tools like <a href="http://www.ndepend.com/">NDepend</a>, <a href="http://www.ncover.com/">NCover</a> and <a href="http://www.jetbrains.com/teamcity/">TeamCity</a> to generate other visual reports to support our dashboards.</p>
<h3>NDepend</h3>
<div id="attachment_957" class="wp-caption alignright" style="width: 160px"><a href="http://blog.robbowley.net/wp-content/uploads/2009/11/VisualNDepend1.gif"><img class="size-thumbnail wp-image-957 " title="VisualNDepend" src="http://blog.robbowley.net/wp-content/uploads/2009/11/VisualNDepend1-150x150.gif" alt="Using VisualNDepend to analyse the dashboards project" width="150" height="150" /></a><p class="wp-caption-text">VisualNDepend analysing the dashboards project</p></div>
<p>VisualNDepend is a fantastic tool, but takes time to learn how to use and it often requires considerable digging around to find what you&#8217;re looking for.  A more immediate and visual tool is the  NDepend report (<a href="http://www.ndepend.com/SampleReports/OnNUnit/NDependReport.html">example</a>) which can be generated through VisualNDepend or via the <a href="http://www.ndepend.com/NDependConsole.aspx">NDependConsole</a>.  It contains a nice summary of things such as <a href="http://www.ndepend.com/SampleReports/OnNUnit/NDependReport.html#APPMETRIC">assembly metrics</a> and CQL queries such as methods with more than 10 lines of code. Importantly here, TeamCity can generate and display NDepend reports using NDependConsole as Laurent Kempé explains <a href="http://weblogs.asp.net/lkempe/archive/2008/04/25/using-ndepend-in-team-city-build-management-tool.aspx">here</a> (using <a href="http://msdn.microsoft.com/en-us/library/wea2sca5.aspx">MSBuild</a> though it&#8217;s just as possible with <a href="http://nant.sourceforge.net/">NAnt</a> or <a href="http://rake.rubyforge.org/">Rake</a>).</p>
<p>However I find even this report contains too much information  so we&#8217;ve modified the NDepend configuration file to show only four of the sections (<a href="http://blog.robbowley.net/wp-content/uploads/2009/11/NDependReport/NDependReport.html">see example</a>) Assemblies Metrics, Assemblies Abstractness vs. Instability, Assemblies Dependencies Diagram and CQL Queries and Constraints. It&#8217;s now much easier to read. For example, we can see the assemby metrics at the top show us some of the same metrics used in the dashboards but broken down by each assembly. When this is integrated into TeamCity you merely need to click back to see how any of them have changed since previous builds.</p>
<p><a href="http://blog.robbowley.net/wp-content/uploads/2009/11/PreviousReport.gif"><img class="size-full wp-image-961 alignnone" style="border: 0pt none;" title="PreviousReport" src="http://blog.robbowley.net/wp-content/uploads/2009/11/PreviousReport.gif" alt="PreviousReport" width="422" height="141" /></a></p>
<p>We can also see the method &#8220;WriteChange(&#8230;)&#8221; clearly needs some love being the <a href="http://blog.robbowley.net/wp-content/uploads/2009/11/NDependReport/NDependReport.html#CQLQUERIESCONSTRAINTS">top method to refactor</a>. When you compare the two reports <a href="http://www.ndepend.com/SampleReports/OnNUnit/NDependReport.html">side</a> by <a href="http://blog.robbowley.net/wp-content/uploads/2009/11/NDependReport/NDependReport.html">side</a> it&#8217;s easy to see how, just like methods or classes with too many lines of code, too much information can make what are otherwise valuable reports unreadable. I have to admit it took me a long time to get into using NDepend well and a lot of that is down to the overwhelming amount of information it produces.</p>
<h3>NCover</h3>
<p style="text-align: center;"><a href="http://blog.robbowley.net/wp-content/uploads/2009/11/NCover.gif"><img class="aligncenter size-full wp-image-968" style="border: 0pt none;" title="NCover" src="http://blog.robbowley.net/wp-content/uploads/2009/11/NCover.gif" alt="NCover" width="626" height="153" /></a></p>
<p>It&#8217;s no good finding out your test coverage has gone down if you don&#8217;t know why. You could pay for an NCover licence for each developer, but less costly is to integrate the NCover report into TeamCity. Again, Laurent Kempé explains how to do this <a href="http://weblogs.asp.net/lkempe/archive/2008/03/30/integration-of-ncover-into-team-city-for-tech-head-brothers.aspx">here</a> and here is an <a href="http://blog.robbowley.net/wp-content/uploads/2009/11/NCover.html">example of the NCover report for our Dasbhoards project</a>.  It doesn&#8217;t provide the same amount of detail as the NCover GUI, but will at least give you a good head start in the right direction.</p>
<p><a href="../wp-content/uploads/2009/11/Tabs.gif"><img class="alignright" style="border: 0pt none;" title="Tabs" src="../wp-content/uploads/2009/11/Tabs.gif" alt="Tabs" width="351" height="94" /></a></p>
<p>So, in the end we have three tabs in our TeamCity project builds which, when used in conjuction with each other, give us a highly visual representation of how modifications are affecting the maintainability of our code. Of course there are many other reasons why code could be problematic but the context these these tools open up make it much easier for developers to learn and understand and therefore be able care more about the maintanability of their projects and the consequences of writing bad code.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.robbowley.net/2009/11/03/visualising-the-internal-quality-of-software-pt-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Visualising the internal quality of software: Part 1</title>
		<link>http://blog.robbowley.net/2009/10/28/visualising-the-internal-quality-of-software-part-1/</link>
		<comments>http://blog.robbowley.net/2009/10/28/visualising-the-internal-quality-of-software-part-1/#comments</comments>
		<pubDate>Wed, 28 Oct 2009 17:01:38 +0000</pubDate>
		<dc:creator>rob</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[code quality]]></category>
		<category><![CDATA[dashboards]]></category>
		<category><![CDATA[internal quality]]></category>

		<guid isPermaLink="false">http://blog.robbowley.net/?p=878</guid>
		<description><![CDATA[There are essentially two ways you can discuss the quality of software. External quality is something everyone can appreciate. For example, how easy it is for customers to use one of our products and whether they encounter any problems (bugs) whilst doing so. Internal quality however, is a lot more complex and tricky to get [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.robbowley.net/wp-content/uploads/2009/10/line-charts.gif"></a>There are essentially two ways you can discuss the quality of software. <strong>External quality</strong> is something everyone can appreciate. For example, how easy it is for customers to use one of our products and whether they encounter any problems (bugs) whilst doing so. <strong>Internal quality</strong> however, is a lot more complex and tricky to get right, but is just as important as external quality (if not more so). To me, internal quality is about how efficiently you can add or modify functionality whilst not breaking any of the existing functionality, not just today but over a long period of time. This is also known as the <strong><a href="http://www.agilemodeling.com/essays/costOfChange.htm" target="_blank">cost of change</a></strong>.</p>
<p>Another well known term  is <strong><a href="http://en.wikipedia.org/wiki/Software_entropy" target="_blank">software entropy</a> </strong>- the more you add to and change a piece software the more complex and difficult it becomes to do so. Eventually the cost of change simply becomes too high and the long and arduous task of replacing the system begins. Of course, doing this this has a massive impact on competitiveness as you&#8217;re unable to deliver new functionality until you&#8217;ve done so and why it&#8217;s so important to make the effort to keep your code in good condition.</p>
<p>In the new world of software development we&#8217;re all really keen on visualisation (or &#8220;information radiators&#8221; as we&#8217;re supposed to call them) and with good reason.  It aids conversation and helps identify any pain points so, as a team, we can focus on removing them. A while ago a former colleague and friend of mine Peter Camfield <a href="http://leftshift.wordpress.com/2008/09/11/quality-in-the-real-world/">blogged</a> about quality dashboards he and <a href="http://twitter.com/Joshski">Josh Chisolm</a> had been working on. We&#8217;ve recently implemented them at my current company as well. I&#8217;d like to go into more detail about the dashboards, some improvements I&#8217;ve made and how, in combination with other visualisation tools, we&#8217;re able to make the most of them.</p>
<div id="attachment_901" class="wp-caption aligncenter" style="width: 620px"><a href="http://blog.robbowley.net/wp-content/uploads/2009/10/trafficlights1.gif"><img class="size-full wp-image-901" title="trafficlights" src="http://blog.robbowley.net/wp-content/uploads/2009/10/trafficlights1.gif" alt="trafficlights" width="610" height="311" /></a><p class="wp-caption-text">The &quot;traffic lights&quot; for one of our applications</p></div>
<p>The dashboards are created by running <a href="http://www.ndepend.com/">NDepend</a> CQL Queries* and <a href="http://www.ncover.com/">NCover</a> on the code and test assemblies for a project, aggregating the results, comparing them to previous recording and outputting them as a set of traffic lights with arrows to show whether the measurement has improved or worsened. The levels at which the traffic lights change colour are mostly based on recommendations from the NDepend <a href="http://www.ndepend.com/Metrics.aspx">Metrics Definition</a> page.</p>
<p><a href="http://blog.robbowley.net/wp-content/uploads/2009/10/TeamCityDashboards.gif"><img class="alignright size-full wp-image-906" style="border: 2px solid #f3f3f3;" title="TeamCityDashboards" src="http://blog.robbowley.net/wp-content/uploads/2009/10/TeamCityDashboards.gif" alt="TeamCityDashboards" width="279" height="148" /></a>We&#8217;ve been running them in <a href="http://www.jetbrains.com/teamcity/index.html">TeamCity</a> (and added the output as a tab) any time code is checked in. Having lived with these dashboards for a while now I can say I&#8217;ve found them invaluable. They&#8217;ve raised countless discussions around how changes to the code base have impacted the metrics and really made us think about what good internal quality is.  However it&#8217;s also been frustrating as until now they&#8217;ve only shown changes from one build to the next, so I&#8217;ve recently spent some time working on adding line charts (using the <a href="http://code.google.com/apis/chart/">Google Chart API</a>) to show how the metrics have changed over time:</p>
<div class="wp-caption alignnone" style="width: 620px"><a href="http://blog.robbowley.net/wp-content/uploads/2009/10/line-charts.gif"><img style="display: block; margin-left: auto; margin-right: auto; border: 0px initial initial;" title="line charts" src="http://blog.robbowley.net/wp-content/uploads/2009/10/line-charts.gif" alt="line charts" width="610" height="311" /></a><p class="wp-caption-text">Line charts for the same application as above</p></div>
<p>The line charts are configured so that &#8220;up is good&#8221;. They give an immediate (albeit subjective) view on whether the internal quality is improving. We&#8217;ve only had these for a few weeks and it will be really interesting to see how easy it is to get all the lines to go up or at least remain stable** and whether improvements in the metrics are reflected in the cost of change.</p>
<p>In <a href="/2009/11/03/visualising-the-internal-quality-of-software-pt-2/"><strong>part 2</strong></a> I will talk about how we can use these reports in combination with other visualisations to help us understand how code modifications affect internal quality.</p>
<address>* It would take a long time to go into the detail of the CQL queries suffice to say they were chosen to try and give the broadest picture of the condition of the code without having so many that it just becomes a noise.</address>
<address>** From the small experience I&#8217;ve had so far I don&#8217;t think it&#8217;s going to be very easy.</address>
]]></content:encoded>
			<wfw:commentRss>http://blog.robbowley.net/2009/10/28/visualising-the-internal-quality-of-software-part-1/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
