<?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: Exploring the C++ Unit Testing Framework Jungle</title>
	<atom:link href="http://gamesfromwithin.com/exploring-the-c-unit-testing-framework-jungle/feed" rel="self" type="application/rss+xml" />
	<link>http://gamesfromwithin.com/exploring-the-c-unit-testing-framework-jungle</link>
	<description>Living the indie life</description>
	<lastBuildDate>Tue, 15 May 2012 19:19:00 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: /* Rambling comments... */</title>
		<link>http://gamesfromwithin.com/exploring-the-c-unit-testing-framework-jungle/comment-page-1#comment-72</link>
		<dc:creator>/* Rambling comments... */</dc:creator>
		<pubDate>Tue, 02 Aug 2005 07:15:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.gamesfromwithin.dreamhosters.com/?p=318#comment-72</guid>
		<description>&lt;strong&gt;Exploring the C++ Unit Testing Framework Jungle&lt;/strong&gt;







Exploring the C++ Unit Testing Framework Jungle over on Games from Within is a really good look at all of the C++ unit testing frameworks out there. It compares the following frameworks: * CppUnit * Boost.Test * CppUnitLite * NanoCppUnit...</description>
		<content:encoded><![CDATA[<p><strong>Exploring the C++ Unit Testing Framework Jungle</strong></p>
<p>Exploring the C++ Unit Testing Framework Jungle over on Games from Within is a really good look at all of the C++ unit testing frameworks out there. It compares the following frameworks: * CppUnit * Boost.Test * CppUnitLite * NanoCppUnit&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alexis Smirnov</title>
		<link>http://gamesfromwithin.com/exploring-the-c-unit-testing-framework-jungle/comment-page-1#comment-71</link>
		<dc:creator>Alexis Smirnov</dc:creator>
		<pubDate>Tue, 12 Jul 2005 00:01:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.gamesfromwithin.dreamhosters.com/?p=318#comment-71</guid>
		<description>&lt;strong&gt;Test driven development of distributed systems&lt;/strong&gt;







Years of work on various large-scale software systems made me realize a few simple things: &#160; Software testing is hard. Great advances in Test Driven Development made testing more productive. Still, to achieve full test coverage for a system,...</description>
		<content:encoded><![CDATA[<p><strong>Test driven development of distributed systems</strong></p>
<p>Years of work on various large-scale software systems made me realize a few simple things: &nbsp; Software testing is hard. Great advances in Test Driven Development made testing more productive. Still, to achieve full test coverage for a system,&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: : linkblog/links_2005-05-16.html</title>
		<link>http://gamesfromwithin.com/exploring-the-c-unit-testing-framework-jungle/comment-page-1#comment-70</link>
		<dc:creator>: linkblog/links_2005-05-16.html</dc:creator>
		<pubDate>Wed, 18 May 2005 03:11:13 +0000</pubDate>
		<guid isPermaLink="false">http://www.gamesfromwithin.dreamhosters.com/?p=318#comment-70</guid>
		<description>&lt;strong&gt;2005-05-16 links&lt;/strong&gt;








2005-05-16 links



* Games from Within: Exploring the C++ Unit Testing Framework Jungle

* SCons: A software construction tool



Taken from Jims del.icio.us links

Feet Up!</description>
		<content:encoded><![CDATA[<p><strong>2005-05-16 links</strong></p>
<p>2005-05-16 links</p>
<p>* Games from Within: Exploring the C++ Unit Testing Framework Jungle</p>
<p>* SCons: A software construction tool</p>
<p>Taken from Jims del.icio.us links</p>
<p>Feet Up!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alexis Smirnov</title>
		<link>http://gamesfromwithin.com/exploring-the-c-unit-testing-framework-jungle/comment-page-1#comment-69</link>
		<dc:creator>Alexis Smirnov</dc:creator>
		<pubDate>Tue, 15 Mar 2005 14:36:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.gamesfromwithin.dreamhosters.com/?p=318#comment-69</guid>
		<description>&lt;strong&gt;Comparing C++ unit testing frameworks&lt;/strong&gt;







If you&#8217;re shopping around for a C++ unit test framework, make sure to check out this analysis of C++ unit test frameworks. It&#8217;s a good idea to pay attention to the conclusions made by the author of such a...</description>
		<content:encoded><![CDATA[<p><strong>Comparing C++ unit testing frameworks</strong></p>
<p>If you&rsquo;re shopping around for a C++ unit test framework, make sure to check out this analysis of C++ unit test frameworks. It&rsquo;s a good idea to pay attention to the conclusions made by the author of such a&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Myroslav Rubanets</title>
		<link>http://gamesfromwithin.com/exploring-the-c-unit-testing-framework-jungle/comment-page-1#comment-59</link>
		<dc:creator>Myroslav Rubanets</dc:creator>
		<pubDate>Sun, 13 Mar 2005 07:40:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.gamesfromwithin.dreamhosters.com/?p=318#comment-59</guid>
		<description>Hi, Noel!

Great review. I did spent some time comparing unit test frameworks and asking people for something simple.

For now i&#039;m using TUT &lt;a href=&quot;http://tut-framework.sourceforge.net&quot; rel=&quot;nofollow&quot;&gt;http://tut-framework.sourceforge.net&lt;/a&gt; . Its favourite feature for me - fixtures. Once you wrote struct containing data setup(ctor) and teardown(dtor) for test it gets constructed and destructed for each test in a group. And fixture members are  referenced implicitly through &quot;this&quot; pointer. I choosed it over a boost because i dont like libraries that need to be built in some special way only. Major drawback of TUT is in its compiler requirements - i just cant use it in the old project built by MSVC6.</description>
		<content:encoded><![CDATA[<p>Hi, Noel!</p>
<p>Great review. I did spent some time comparing unit test frameworks and asking people for something simple.</p>
<p>For now i&#8217;m using TUT <a href="http://tut-framework.sourceforge.net" rel="nofollow">http://tut-framework.sourceforge.net</a> . Its favourite feature for me &#8211; fixtures. Once you wrote struct containing data setup(ctor) and teardown(dtor) for test it gets constructed and destructed for each test in a group. And fixture members are  referenced implicitly through &#8220;this&#8221; pointer. I choosed it over a boost because i dont like libraries that need to be built in some special way only. Major drawback of TUT is in its compiler requirements &#8211; i just cant use it in the old project built by MSVC6.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Fosta's Blog</title>
		<link>http://gamesfromwithin.com/exploring-the-c-unit-testing-framework-jungle/comment-page-1#comment-68</link>
		<dc:creator>Fosta's Blog</dc:creator>
		<pubDate>Mon, 07 Mar 2005 20:20:13 +0000</pubDate>
		<guid isPermaLink="false">http://www.gamesfromwithin.dreamhosters.com/?p=318#comment-68</guid>
		<description>&lt;strong&gt;Test Driven Development&lt;/strong&gt;</description>
		<content:encoded><![CDATA[<p><strong>Test Driven Development</strong></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bill Nalen</title>
		<link>http://gamesfromwithin.com/exploring-the-c-unit-testing-framework-jungle/comment-page-1#comment-58</link>
		<dc:creator>Bill Nalen</dc:creator>
		<pubDate>Mon, 07 Feb 2005 14:36:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.gamesfromwithin.dreamhosters.com/?p=318#comment-58</guid>
		<description>I&#039;m guessing that if I keep the minimum amount of code in the gui and move all the logic to a separate class it will help a lot with unit testing. That said I&#039;m only halfway through TDD and I haven&#039;t used it in practice at all. I love seeing how other people have put these kinds of methods into practice, i.e. do they really work for projects. Do the tests really stick around throughout the project, or do they get tossed like most class diagrams or project plans once you get started.



I also find book reviews by people who actually do a lot of programming very useful. Sometimes it&#039;s really hard to find books that don&#039;t talk about the basics for half the book. So I&#039;m really happy to see your reviews, keep it up :-)



BTW, would you mind mentioning what MT plugin you are using for the currently reading section? I&#039;m new to the MT world.



Thanks</description>
		<content:encoded><![CDATA[<p>I&#8217;m guessing that if I keep the minimum amount of code in the gui and move all the logic to a separate class it will help a lot with unit testing. That said I&#8217;m only halfway through TDD and I haven&#8217;t used it in practice at all. I love seeing how other people have put these kinds of methods into practice, i.e. do they really work for projects. Do the tests really stick around throughout the project, or do they get tossed like most class diagrams or project plans once you get started.</p>
<p>I also find book reviews by people who actually do a lot of programming very useful. Sometimes it&#8217;s really hard to find books that don&#8217;t talk about the basics for half the book. So I&#8217;m really happy to see your reviews, keep it up <img src='http://gamesfromwithin.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>BTW, would you mind mentioning what MT plugin you are using for the currently reading section? I&#8217;m new to the MT world.</p>
<p>Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Noel Llopis</title>
		<link>http://gamesfromwithin.com/exploring-the-c-unit-testing-framework-jungle/comment-page-1#comment-57</link>
		<dc:creator>Noel Llopis</dc:creator>
		<pubDate>Mon, 07 Feb 2005 02:27:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.gamesfromwithin.dreamhosters.com/?p=318#comment-57</guid>
		<description>Thanks, Bill. An article on doing TDD with games is the next one I&#039;ll write. I promise! It&#039;s just that other things keep coming up :-)



GUI applications are the most difficult kind to do with TDD (and, to a certain extent, the ones you get least amount of benefit from, especially if they don&#039;t have much real &quot;logic&quot; inside).



Some resources for TDD with GUIs are the Yahoo mailing list (very little traffic) &lt;a href=&quot;http://groups.yahoo.com/group/TestFirstUserInterfaces/,&quot; rel=&quot;nofollow&quot;&gt;http://groups.yahoo.com/group/TestFirstUserInterfaces/,&lt;/a&gt; and Phlip&#039;s book (&lt;a href=&quot;http://www.amazon.com/exec/obidos/tg/detail/-/0321227328),&quot; rel=&quot;nofollow&quot;&gt;http://www.amazon.com/exec/obidos/tg/detail/-/0321227328),&lt;/a&gt; which should be available in a few months.



The main problem with GUI apps is that you often end up having to twist the framework around to be able to do TDD comfortably.



Games on the other hand, are *not* mostly GUIs. There&#039;s a layer that deals with rendering graphics or creating sound, but most of it is the game logic inside, which can easily be done in a TDD way (especially for anything below game scripts, I&#039;m not convinced that TDD is the right way to go for really high level gameplay code which is changing all the time and nothing depends on it).



More about all this soon. Very soon :-)</description>
		<content:encoded><![CDATA[<p>Thanks, Bill. An article on doing TDD with games is the next one I&#8217;ll write. I promise! It&#8217;s just that other things keep coming up <img src='http://gamesfromwithin.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>GUI applications are the most difficult kind to do with TDD (and, to a certain extent, the ones you get least amount of benefit from, especially if they don&#8217;t have much real &#8220;logic&#8221; inside).</p>
<p>Some resources for TDD with GUIs are the Yahoo mailing list (very little traffic) <a href="http://groups.yahoo.com/group/TestFirstUserInterfaces/," rel="nofollow">http://groups.yahoo.com/group/TestFirstUserInterfaces/,</a> and Phlip&#8217;s book (<a href="http://www.amazon.com/exec/obidos/tg/detail/-/0321227328)," rel="nofollow"></a><a href="http://www.amazon.com/exec/obidos/tg/detail/-/0321227328" rel="nofollow">http://www.amazon.com/exec/obidos/tg/detail/-/0321227328</a>), which should be available in a few months.</p>
<p>The main problem with GUI apps is that you often end up having to twist the framework around to be able to do TDD comfortably.</p>
<p>Games on the other hand, are *not* mostly GUIs. There&#8217;s a layer that deals with rendering graphics or creating sound, but most of it is the game logic inside, which can easily be done in a TDD way (especially for anything below game scripts, I&#8217;m not convinced that TDD is the right way to go for really high level gameplay code which is changing all the time and nothing depends on it).</p>
<p>More about all this soon. Very soon <img src='http://gamesfromwithin.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bill Nalen</title>
		<link>http://gamesfromwithin.com/exploring-the-c-unit-testing-framework-jungle/comment-page-1#comment-56</link>
		<dc:creator>Bill Nalen</dc:creator>
		<pubDate>Mon, 07 Feb 2005 02:09:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.gamesfromwithin.dreamhosters.com/?p=318#comment-56</guid>
		<description>Wow, this is a great article Noel. I&#039;d love to see a step by step article about how you do TDD on a real project, say adding a dialog to a config screen or something. I can&#039;t help thinking that TDD doesn&#039;t work well for apps that are mostly GUI in nature and games might be the most GUI. I&#039;m about to start a big new project at my day job that involves a lot of back end coding that seems suitable to TDD so I thought I&#039;d try the same thing with my own stuff. However, since a lot of the code is GUI I&#039;m having trouble applying it.</description>
		<content:encoded><![CDATA[<p>Wow, this is a great article Noel. I&#8217;d love to see a step by step article about how you do TDD on a real project, say adding a dialog to a config screen or something. I can&#8217;t help thinking that TDD doesn&#8217;t work well for apps that are mostly GUI in nature and games might be the most GUI. I&#8217;m about to start a big new project at my day job that involves a lot of back end coding that seems suitable to TDD so I thought I&#8217;d try the same thing with my own stuff. However, since a lot of the code is GUI I&#8217;m having trouble applying it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: JohnA</title>
		<link>http://gamesfromwithin.com/exploring-the-c-unit-testing-framework-jungle/comment-page-1#comment-55</link>
		<dc:creator>JohnA</dc:creator>
		<pubDate>Fri, 21 Jan 2005 06:42:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.gamesfromwithin.dreamhosters.com/?p=318#comment-55</guid>
		<description>Check out:

&lt;a href=&quot;http://arrizza.com/unittesters/jutasserter/jutasserter.html&quot; rel=&quot;nofollow&quot;&gt;http://arrizza.com/unittesters/jutasserter/jutasserter.html&lt;/a&gt;



for a very simple unittester



# Small:



* UtAsserter.h: 55 lines

* UtAsserter.cpp: 343 lines

* main.cpp: 2 lines



# Simple:



* Test cases are created by declaring them: TEST(x)

* main() requires only one line TestSuite::Run()



# don&#039;t have to maintain the test suite, done automatically

# easy to add more assert types

# format works with MSVCs next_error (F4)

# works with VC6 &amp; VC7; partially works with g++</description>
		<content:encoded><![CDATA[<p>Check out:</p>
<p><a href="http://arrizza.com/unittesters/jutasserter/jutasserter.html" rel="nofollow">http://arrizza.com/unittesters/jutasserter/jutasserter.html</a></p>
<p>for a very simple unittester</p>
<p># Small:</p>
<p>* UtAsserter.h: 55 lines</p>
<p>* UtAsserter.cpp: 343 lines</p>
<p>* main.cpp: 2 lines</p>
<p># Simple:</p>
<p>* Test cases are created by declaring them: TEST(x)</p>
<p>* main() requires only one line TestSuite::Run()</p>
<p># don&#8217;t have to maintain the test suite, done automatically</p>
<p># easy to add more assert types</p>
<p># format works with MSVCs next_error (F4)</p>
<p># works with VC6 &#038; VC7; partially works with g++</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Reiot's Righteous Game-Photo Laboratory</title>
		<link>http://gamesfromwithin.com/exploring-the-c-unit-testing-framework-jungle/comment-page-1#comment-67</link>
		<dc:creator>Reiot's Righteous Game-Photo Laboratory</dc:creator>
		<pubDate>Tue, 11 Jan 2005 15:42:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.gamesfromwithin.dreamhosters.com/?p=318#comment-67</guid>
		<description>&lt;strong&gt;Boost.Test&lt;/strong&gt;</description>
		<content:encoded><![CDATA[<p><strong>Boost.Test</strong></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Cry's Diary</title>
		<link>http://gamesfromwithin.com/exploring-the-c-unit-testing-framework-jungle/comment-page-1#comment-66</link>
		<dc:creator>Cry's Diary</dc:creator>
		<pubDate>Tue, 11 Jan 2005 15:39:46 +0000</pubDate>
		<guid isPermaLink="false">http://www.gamesfromwithin.dreamhosters.com/?p=318#comment-66</guid>
		<description>&lt;strong&gt;Boost.Test&#12434;&#21547;&#12417;&#12383;&#12486;&#12473;&#12488;&#12501;&#12524;&#12540;&#12512;&#12527;&#12540;&#12463;&#12398;&#12414;&#12392;&#12417;&lt;/strong&gt;</description>
		<content:encoded><![CDATA[<p><strong>Boost.Test&#12434;&#21547;&#12417;&#12383;&#12486;&#12473;&#12488;&#12501;&#12524;&#12540;&#12512;&#12527;&#12540;&#12463;&#12398;&#12414;&#12392;&#12417;</strong></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gennadiy</title>
		<link>http://gamesfromwithin.com/exploring-the-c-unit-testing-framework-jungle/comment-page-1#comment-54</link>
		<dc:creator>Gennadiy</dc:creator>
		<pubDate>Mon, 10 Jan 2005 15:04:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.gamesfromwithin.dreamhosters.com/?p=318#comment-54</guid>
		<description>You could read my comments here:



&lt;a href=&quot;http://article.gmane.org/gmane.comp.lib.boost.devel/116244&quot; rel=&quot;nofollow&quot;&gt;http://article.gmane.org/gmane.comp.lib.boost.devel/116244&lt;/a&gt;</description>
		<content:encoded><![CDATA[<p>You could read my comments here:</p>
<p><a href="http://article.gmane.org/gmane.comp.lib.boost.devel/116244" rel="nofollow">http://article.gmane.org/gmane.comp.lib.boost.devel/116244</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Noel Llopis</title>
		<link>http://gamesfromwithin.com/exploring-the-c-unit-testing-framework-jungle/comment-page-1#comment-53</link>
		<dc:creator>Noel Llopis</dc:creator>
		<pubDate>Mon, 10 Jan 2005 00:39:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.gamesfromwithin.dreamhosters.com/?p=318#comment-53</guid>
		<description>&gt; With proper test framework you will get pointed exactly

&gt; to the error location whether or not you use one

&gt; assertion per test case. One thing I am sure though is

&gt; that one assertion per test case will definitely lead to

&gt; longer run time ( with couple hundred assertions in

&gt; test - 10 times and more), more time spend on tests

&gt; development



It not so much a matter of style, but of maintainability. Doing TDD, I expect to write a lot of unit tests. Usually about as many lines of code as production code, or even more. I also expect to refactor my code heavily, which means refactoring my unit tests as well.



When I used to write &quot;large&quot; unit tests (&gt;50 lines containing &gt;5 assert statements), I found it very difficult to refactor anything. The causes for a failure were not clear, and it often required me to jump in the debugger and step through the code.



Having really simple test cases (I rather use that term than &quot;one assertion per test case&quot;), wich means test cases &lt;10 lines and at most 1-2 asserts, I find that I can refactor any test case trivially because it&#039;s immediatelly obvious what they&#039;re trying to accomplish.



Yes, it&#039;ll be slower to run the tests, but hopefully not much slower (I usually want a unit test to take less than 1ms to execute). When the running time goes over 3-4 seconds then it&#039;s when I have to start using suites. Also, that&#039;s when having per-suite setup/teardown can really help with some of those performance issues.



But you hit in the nail when you said that the main problem of working in a completely generic library is trying to support everybody. I&#039;m sure there are people who want exactly the opposite.



I&#039;m sure you found some of these links already, but here is some reading on the whole &quot;one assert per test approach&quot;: &lt;a href=&quot;http://www.artima.com/weblogs/viewpost.jsp?thread=35578&quot; rel=&quot;nofollow&quot;&gt;http://www.artima.com/weblogs/viewpost.jsp?thread=35578&lt;/a&gt; and &lt;a href=&quot;http://www.theserverside.com/news/thread.tss?thread_id=24136.&quot; rel=&quot;nofollow&quot;&gt;http://www.theserverside.com/news/thread.tss?thread_id=24136.&lt;/a&gt;



I will definitely write about it in the near future :-)</description>
		<content:encoded><![CDATA[<p>> With proper test framework you will get pointed exactly</p>
<p>> to the error location whether or not you use one</p>
<p>> assertion per test case. One thing I am sure though is</p>
<p>> that one assertion per test case will definitely lead to</p>
<p>> longer run time ( with couple hundred assertions in</p>
<p>> test &#8211; 10 times and more), more time spend on tests</p>
<p>> development</p>
<p>It not so much a matter of style, but of maintainability. Doing TDD, I expect to write a lot of unit tests. Usually about as many lines of code as production code, or even more. I also expect to refactor my code heavily, which means refactoring my unit tests as well.</p>
<p>When I used to write &#8220;large&#8221; unit tests (>50 lines containing >5 assert statements), I found it very difficult to refactor anything. The causes for a failure were not clear, and it often required me to jump in the debugger and step through the code.</p>
<p>Having really simple test cases (I rather use that term than &#8220;one assertion per test case&#8221;), wich means test cases &lt;10 lines and at most 1-2 asserts, I find that I can refactor any test case trivially because it&#8217;s immediatelly obvious what they&#8217;re trying to accomplish.</p>
<p>Yes, it&#8217;ll be slower to run the tests, but hopefully not much slower (I usually want a unit test to take less than 1ms to execute). When the running time goes over 3-4 seconds then it&#8217;s when I have to start using suites. Also, that&#8217;s when having per-suite setup/teardown can really help with some of those performance issues.</p>
<p>But you hit in the nail when you said that the main problem of working in a completely generic library is trying to support everybody. I&#8217;m sure there are people who want exactly the opposite.</p>
<p>I&#8217;m sure you found some of these links already, but here is some reading on the whole &#8220;one assert per test approach&#8221;: <a href="http://www.artima.com/weblogs/viewpost.jsp?thread=35578" rel="nofollow">http://www.artima.com/weblogs/viewpost.jsp?thread=35578</a> and <a href="http://www.theserverside.com/news/thread.tss?thread_id=24136." rel="nofollow">http://www.theserverside.com/news/thread.tss?thread_id=24136.</a></p>
<p>I will definitely write about it in the near future <img src='http://gamesfromwithin.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gennadiy Rozental</title>
		<link>http://gamesfromwithin.com/exploring-the-c-unit-testing-framework-jungle/comment-page-1#comment-52</link>
		<dc:creator>Gennadiy Rozental</dc:creator>
		<pubDate>Sun, 09 Jan 2005 23:57:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.gamesfromwithin.dreamhosters.com/?p=318#comment-52</guid>
		<description>&gt; As for the &quot;one assertion per test case&quot;, I

&gt; have applied that in real life. In practice a

&gt; few test cases end up with two assertions, but

&gt; the majority of them only have one. When I

&gt; started using unit tests, I would cram a lot

&gt; of asserts in a single test case, but that

&gt; lead to tests that were difficult to refactor.

&gt; When you&#039;re doing TDD, you need to refactor

&gt; your tests as much as your production code,

&gt; and simplicity is essential.



After you mention this principle I read a couple of articles and discussions about it and it still doesn&#039;t make too much sense to me. In general I am in favor in TDD ideas but I never like extremes in any aspects of life. Solid unit tests written pre/during/post class implementation is a cornerstone of reliable development. But what you advocate is just a matter of style IMO. I prefer test cases organization by feature/area: test constructors. test destructors, test access method, test comparison, test search, validations e.t.c. With proper test framework you will get pointed exactly to the error location whether or not you use one assertion per test case. One thing I am sure though is that one assertion per test case will definitely lead to longer run time ( with couple hundred assertions in test - 10 times and more), more time spend on tests development (just compare how many lines more you will need to type) and more time spend on fixures preparation and managing (imagine simple case where you just refactor common code into fixure. But then you found that one assertion require slightly different one, the same with another. Now you write second fixure that reuse first one e.t.c). All in all I dont see how writing several related assertions together make my unit test code less &quot;requirement like&quot;.

As a side note I would like to mention that in design and implementation on test framework the biggest challenge I found is not code portability (even though Boost.Test works on several dozens of configurations - essentially most that I know about - which should say something about portability) or support some specific features (like test case dependency - which BTW could be useful, believe it or not, specifically in a cases when you know that one test case will run very long and fail if another test case is failing). The biggest challenge is huge diversity of requirements to/expectations from unit test framework. And in many case they contradict each other. You yourself managed to state both requirements independency from exception handling and complete exception handling support for your ideal framework. For this reason Boost.Test is presented not as one monolithic framework, but rather as a collection of many components used in different environments/circumstances: from simplest one header minimal testing component to the full featured Unit Test Framework. I did not try to enforce any specific testing style and I am trying to support features that could be useful.</description>
		<content:encoded><![CDATA[<p>> As for the &#8220;one assertion per test case&#8221;, I</p>
<p>> have applied that in real life. In practice a</p>
<p>> few test cases end up with two assertions, but</p>
<p>> the majority of them only have one. When I</p>
<p>> started using unit tests, I would cram a lot</p>
<p>> of asserts in a single test case, but that</p>
<p>> lead to tests that were difficult to refactor.</p>
<p>> When you&#8217;re doing TDD, you need to refactor</p>
<p>> your tests as much as your production code,</p>
<p>> and simplicity is essential.</p>
<p>After you mention this principle I read a couple of articles and discussions about it and it still doesn&#8217;t make too much sense to me. In general I am in favor in TDD ideas but I never like extremes in any aspects of life. Solid unit tests written pre/during/post class implementation is a cornerstone of reliable development. But what you advocate is just a matter of style IMO. I prefer test cases organization by feature/area: test constructors. test destructors, test access method, test comparison, test search, validations e.t.c. With proper test framework you will get pointed exactly to the error location whether or not you use one assertion per test case. One thing I am sure though is that one assertion per test case will definitely lead to longer run time ( with couple hundred assertions in test &#8211; 10 times and more), more time spend on tests development (just compare how many lines more you will need to type) and more time spend on fixures preparation and managing (imagine simple case where you just refactor common code into fixure. But then you found that one assertion require slightly different one, the same with another. Now you write second fixure that reuse first one e.t.c). All in all I dont see how writing several related assertions together make my unit test code less &#8220;requirement like&#8221;.</p>
<p>As a side note I would like to mention that in design and implementation on test framework the biggest challenge I found is not code portability (even though Boost.Test works on several dozens of configurations &#8211; essentially most that I know about &#8211; which should say something about portability) or support some specific features (like test case dependency &#8211; which BTW could be useful, believe it or not, specifically in a cases when you know that one test case will run very long and fail if another test case is failing). The biggest challenge is huge diversity of requirements to/expectations from unit test framework. And in many case they contradict each other. You yourself managed to state both requirements independency from exception handling and complete exception handling support for your ideal framework. For this reason Boost.Test is presented not as one monolithic framework, but rather as a collection of many components used in different environments/circumstances: from simplest one header minimal testing component to the full featured Unit Test Framework. I did not try to enforce any specific testing style and I am trying to support features that could be useful.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

