<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Measuring &#8220;white box&#8221; testing</title>
	<atom:link href="http://testingblues.com/index.php/archives/2008/02/measuring-white-box-testing/feed/" rel="self" type="application/rss+xml" />
	<link>http://testingblues.com/index.php/archives/2008/02/measuring-white-box-testing/</link>
	<description>Test is the new Development</description>
	<lastBuildDate>Tue, 10 Jan 2012 18:40:14 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Todd Jordan</title>
		<link>http://testingblues.com/index.php/archives/2008/02/measuring-white-box-testing/comment-page-1/#comment-146</link>
		<dc:creator>Todd Jordan</dc:creator>
		<pubDate>Fri, 29 Feb 2008 19:03:43 +0000</pubDate>
		<guid isPermaLink="false">http://testingblues.com/index.php/archives/2008/02/measuring-white-box-testing/#comment-146</guid>
		<description>I&#039;ve also heard of teams evaluating stats like asserts per test and tests per method as ways of judging the adequacy of unit test cases.  

Another aspect you can look at is coverage trends, especially if you are trying to build up test coverage on a legacy codebase.  The principle is, as you develop or change code, the overall test coverage (at an overall, component, and package level) should never go down.  If it doesn&#039;t then you are probably not adding enough coverage for the new code you are writing.  

I&#039;ll also assert that I think its more important to do a review of unit tests than of code, especially if you have good unit test coverage and good metrics tools (static analysis, dependency analysis, etc) output.   

Reviews would focus on:
* testing the proper scenarios 
* finding missing scenarios
* performing adequate asserts

If one was thinking agile and lean, you could move the low-level designs to being unit test javadoc, so your unit test reviews would be equivalent to low level design reviews.  This would eliminate a form of documentation and put the info in a place where it is easier kept up to date (if it gets out of date - theoretically the testcase will fail).</description>
		<content:encoded><![CDATA[<p>I&#8217;ve also heard of teams evaluating stats like asserts per test and tests per method as ways of judging the adequacy of unit test cases.  </p>
<p>Another aspect you can look at is coverage trends, especially if you are trying to build up test coverage on a legacy codebase.  The principle is, as you develop or change code, the overall test coverage (at an overall, component, and package level) should never go down.  If it doesn&#8217;t then you are probably not adding enough coverage for the new code you are writing.  </p>
<p>I&#8217;ll also assert that I think its more important to do a review of unit tests than of code, especially if you have good unit test coverage and good metrics tools (static analysis, dependency analysis, etc) output.   </p>
<p>Reviews would focus on:<br />
* testing the proper scenarios<br />
* finding missing scenarios<br />
* performing adequate asserts</p>
<p>If one was thinking agile and lean, you could move the low-level designs to being unit test javadoc, so your unit test reviews would be equivalent to low level design reviews.  This would eliminate a form of documentation and put the info in a place where it is easier kept up to date (if it gets out of date &#8211; theoretically the testcase will fail).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Arthur Barr</title>
		<link>http://testingblues.com/index.php/archives/2008/02/measuring-white-box-testing/comment-page-1/#comment-145</link>
		<dc:creator>Arthur Barr</dc:creator>
		<pubDate>Fri, 29 Feb 2008 17:14:22 +0000</pubDate>
		<guid isPermaLink="false">http://testingblues.com/index.php/archives/2008/02/measuring-white-box-testing/#comment-145</guid>
		<description>I absolutely agree that there are a lot of additional benefits to unit testing.  I was really trying to focus on how we measure when we&#039;ve done enough.  Of course, with a test-driven approach (where you write the test first), this is less of an issue, but not everyone does that.  Either way, you often want a tangible way of measuring how much testing you&#039;ve done, so that you can gauge the quality of the delivered code.

Your point about unit testing simply not getting done later in the cycle is a good one, but by making a conscious shift in project planning, and by having a good way of measuring the tests, I wonder if we could make it work.

I used the term &quot;white box&quot; testing as an alternative to &quot;unit tests&quot;, in an attempt to separate the two slightly.  In an ideal world it might be possible to thoroughly unit test (and get the benefits you highlighted), and still have some time to focus on rounding out the code coverage later on with more white box tests.  The trick is then deciding how we measure whether we&#039;ve done enough in that first round of unit tests.

I also agree that additional metrics such as code complexity are useful.  I haven&#039;t seen xRadar before and will certainly take a look.</description>
		<content:encoded><![CDATA[<p>I absolutely agree that there are a lot of additional benefits to unit testing.  I was really trying to focus on how we measure when we&#8217;ve done enough.  Of course, with a test-driven approach (where you write the test first), this is less of an issue, but not everyone does that.  Either way, you often want a tangible way of measuring how much testing you&#8217;ve done, so that you can gauge the quality of the delivered code.</p>
<p>Your point about unit testing simply not getting done later in the cycle is a good one, but by making a conscious shift in project planning, and by having a good way of measuring the tests, I wonder if we could make it work.</p>
<p>I used the term &#8220;white box&#8221; testing as an alternative to &#8220;unit tests&#8221;, in an attempt to separate the two slightly.  In an ideal world it might be possible to thoroughly unit test (and get the benefits you highlighted), and still have some time to focus on rounding out the code coverage later on with more white box tests.  The trick is then deciding how we measure whether we&#8217;ve done enough in that first round of unit tests.</p>
<p>I also agree that additional metrics such as code complexity are useful.  I haven&#8217;t seen xRadar before and will certainly take a look.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Todd Jordan</title>
		<link>http://testingblues.com/index.php/archives/2008/02/measuring-white-box-testing/comment-page-1/#comment-144</link>
		<dc:creator>Todd Jordan</dc:creator>
		<pubDate>Fri, 29 Feb 2008 16:36:01 +0000</pubDate>
		<guid isPermaLink="false">http://testingblues.com/index.php/archives/2008/02/measuring-white-box-testing/#comment-144</guid>
		<description>As a developer, I&#039;m going to have to disagree with you some here.  The reason we unit test is not to get the code good enough to test.  Its more of the reverse - A well thought through set of tests create an environment suitable to code.  

There are several reasons:
* Provides immediate feedback to code changes. A full unit test suite for a large product should take about 10 minutes.  individual test methods should run around a tenth of a second.
* Forces you to write maintainable code (you have to write thing in small chuck and think through dependencies and abstraction in order to write an effective unit test)
* Guards against regression.  The specific logic paths that your code should take are continuously run every time a change to the code is made.  This lets people other than the authors make changes with confidence.
* Documents your low level design (you should write and name your tests to described the desired behavior of your code.  Google behavior driven development (BDD) for more on this.

Also, you can&#039;t wait until function tests are done to apply unit tests.  In my experience, if you wait until after the code is developed (and especially tested) to add unit tests, then it just simply won&#039;t get done.   There is no need and no pressure to add them.  the next work item will always take precedence.  You have to do unit tests while and even before you code.

You are right that relying coverage tools alone can be misleading.  That&#039;s why you have to use a variety of data points as quality indicators, such as code complexity, static analysis, peer reviews, and dependency analysis.  A good tool for aggregating this data is xRadar (http://xradar.sourceforge.net/).  

You are also right that unit test alone is not good enough to guarantee quality.  Higher level component tests (testing larger units to ensure interactions between classes), acceptance/functional testing (validating overall flows work and are meeting the business requirements) are all vital pieces of the puzzle (as well as system test, and all the other varieties).</description>
		<content:encoded><![CDATA[<p>As a developer, I&#8217;m going to have to disagree with you some here.  The reason we unit test is not to get the code good enough to test.  Its more of the reverse &#8211; A well thought through set of tests create an environment suitable to code.  </p>
<p>There are several reasons:<br />
* Provides immediate feedback to code changes. A full unit test suite for a large product should take about 10 minutes.  individual test methods should run around a tenth of a second.<br />
* Forces you to write maintainable code (you have to write thing in small chuck and think through dependencies and abstraction in order to write an effective unit test)<br />
* Guards against regression.  The specific logic paths that your code should take are continuously run every time a change to the code is made.  This lets people other than the authors make changes with confidence.<br />
* Documents your low level design (you should write and name your tests to described the desired behavior of your code.  Google behavior driven development (BDD) for more on this.</p>
<p>Also, you can&#8217;t wait until function tests are done to apply unit tests.  In my experience, if you wait until after the code is developed (and especially tested) to add unit tests, then it just simply won&#8217;t get done.   There is no need and no pressure to add them.  the next work item will always take precedence.  You have to do unit tests while and even before you code.</p>
<p>You are right that relying coverage tools alone can be misleading.  That&#8217;s why you have to use a variety of data points as quality indicators, such as code complexity, static analysis, peer reviews, and dependency analysis.  A good tool for aggregating this data is xRadar (<a href="http://xradar.sourceforge.net/" rel="nofollow">http://xradar.sourceforge.net/</a>).  </p>
<p>You are also right that unit test alone is not good enough to guarantee quality.  Higher level component tests (testing larger units to ensure interactions between classes), acceptance/functional testing (validating overall flows work and are meeting the business requirements) are all vital pieces of the puzzle (as well as system test, and all the other varieties).</p>
]]></content:encoded>
	</item>
</channel>
</rss>

