<?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: Testing graphics code</title>
	<atom:link href="http://aras-p.info/blog/2007/07/31/testing-graphics-code/feed/" rel="self" type="application/rss+xml" />
	<link>http://aras-p.info/blog/2007/07/31/testing-graphics-code/</link>
	<description>Random thoughts of a triangle pusher</description>
	<lastBuildDate>Thu, 09 Feb 2012 07:56:51 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Lost in the Triangles &#187; Blog Archive &#187; Testing Graphics Code, 4 years later</title>
		<link>http://aras-p.info/blog/2007/07/31/testing-graphics-code/comment-page-1/#comment-102341</link>
		<dc:creator>Lost in the Triangles &#187; Blog Archive &#187; Testing Graphics Code, 4 years later</dc:creator>
		<pubDate>Fri, 17 Jun 2011 04:44:52 +0000</pubDate>
		<guid isPermaLink="false">http://aras-p.info/blog/2007/07/31/testing-graphics-code/#comment-102341</guid>
		<description>[...] four years ago I wrote how we test rendering code at Unity. Did it stand the test of time and more importantly, growing the company from less than 10 [...]</description>
		<content:encoded><![CDATA[<p>[...] four years ago I wrote how we test rendering code at Unity. Did it stand the test of time and more importantly, growing the company from less than 10 [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Catching Common Image Processing Programming Errors with Generic Unit Tests &#183; code-spot</title>
		<link>http://aras-p.info/blog/2007/07/31/testing-graphics-code/comment-page-1/#comment-31764</link>
		<dc:creator>Catching Common Image Processing Programming Errors with Generic Unit Tests &#183; code-spot</dc:creator>
		<pubDate>Thu, 13 May 2010 13:08:39 +0000</pubDate>
		<guid isPermaLink="false">http://aras-p.info/blog/2007/07/31/testing-graphics-code/#comment-31764</guid>
		<description>[...] Testing Graphics Code [...]</description>
		<content:encoded><![CDATA[<p>[...] Testing Graphics Code [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Aras Pranckevičius</title>
		<link>http://aras-p.info/blog/2007/07/31/testing-graphics-code/comment-page-1/#comment-19400</link>
		<dc:creator>Aras Pranckevičius</dc:creator>
		<pubDate>Mon, 08 Jun 2009 12:47:42 +0000</pubDate>
		<guid isPermaLink="false">http://aras-p.info/blog/2007/07/31/testing-graphics-code/#comment-19400</guid>
		<description>@Jonathan: the virtual clock thing, sure. In our graphics testing setup, we do run everything at exactly the same path (same clock values etc.).

For non-graphics related things, of course we have different test setups. I was talking about tests that specifically test graphics (and the code that interfaces with the graphics API).</description>
		<content:encoded><![CDATA[<p>@Jonathan: the virtual clock thing, sure. In our graphics testing setup, we do run everything at exactly the same path (same clock values etc.).</p>
<p>For non-graphics related things, of course we have different test setups. I was talking about tests that specifically test graphics (and the code that interfaces with the graphics API).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan Hartley</title>
		<link>http://aras-p.info/blog/2007/07/31/testing-graphics-code/comment-page-1/#comment-19399</link>
		<dc:creator>Jonathan Hartley</dc:creator>
		<pubDate>Mon, 08 Jun 2009 12:40:28 +0000</pubDate>
		<guid isPermaLink="false">http://aras-p.info/blog/2007/07/31/testing-graphics-code/#comment-19399</guid>
		<description>@Horn

One idea might be to have your simulation use a virtual clock. This clock will usually just output values that it gets directly from the real clock, and the simulation will run as normal. But in some circumstances (eg. while testing) you will ask the virtual clock to instead provide &#039;fake&#039; clock data. This could be used during testing to make sure your simulation progresses by a known amount between frames.

This behaviour of the virtual clock can be exhaustively unit-tested, separately.

Obviously this has the problem the your program under test will not be running precisely the same code paths in testing as in production, but this may still be the simplest and most reliable way to address the issue.

Unless you can directly compare frames using a very simple image-comparison (eg. is every pixel identical), then I think image processing to compare sorta-similar frames is going to be hard and unreliable. I&#039;d be tempted, for an application of this type, to only do minimal functional level testing by comparing images - just enough to verify that the program is running and framerates are sane and then test the rendering (of sky, ground, planes, shadows, etc.)

For the rest of the program behaviour that isn&#039;t rendering-related, I&#039;d then add a comprehensive layer of &#039;high-level unit tests&#039;, that exhaustively test, for example, plane movements by examining the changes to data structures in your program, or test the camera by examining the modelview matrix that is sent to OpenGL (or whatever), rather than examining the output from OpenGL.

I hope these ideas are applicable.

Best regards</description>
		<content:encoded><![CDATA[<p>@Horn</p>
<p>One idea might be to have your simulation use a virtual clock. This clock will usually just output values that it gets directly from the real clock, and the simulation will run as normal. But in some circumstances (eg. while testing) you will ask the virtual clock to instead provide &#8216;fake&#8217; clock data. This could be used during testing to make sure your simulation progresses by a known amount between frames.</p>
<p>This behaviour of the virtual clock can be exhaustively unit-tested, separately.</p>
<p>Obviously this has the problem the your program under test will not be running precisely the same code paths in testing as in production, but this may still be the simplest and most reliable way to address the issue.</p>
<p>Unless you can directly compare frames using a very simple image-comparison (eg. is every pixel identical), then I think image processing to compare sorta-similar frames is going to be hard and unreliable. I&#8217;d be tempted, for an application of this type, to only do minimal functional level testing by comparing images &#8211; just enough to verify that the program is running and framerates are sane and then test the rendering (of sky, ground, planes, shadows, etc.)</p>
<p>For the rest of the program behaviour that isn&#8217;t rendering-related, I&#8217;d then add a comprehensive layer of &#8216;high-level unit tests&#8217;, that exhaustively test, for example, plane movements by examining the changes to data structures in your program, or test the camera by examining the modelview matrix that is sent to OpenGL (or whatever), rather than examining the output from OpenGL.</p>
<p>I hope these ideas are applicable.</p>
<p>Best regards</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan Hartley</title>
		<link>http://aras-p.info/blog/2007/07/31/testing-graphics-code/comment-page-1/#comment-19398</link>
		<dc:creator>Jonathan Hartley</dc:creator>
		<pubDate>Mon, 08 Jun 2009 12:27:17 +0000</pubDate>
		<guid isPermaLink="false">http://aras-p.info/blog/2007/07/31/testing-graphics-code/#comment-19398</guid>
		<description>@myself

I forgot a very important step:

Add a test for it. *Run the test to watch it fail*. Fix the problem. Then run the tests again to watch them pass.

All tests should be written this way - if the tests are written after the working code, you will be amazed how many times you write a test which has a bug in it and always passes. Running the test to see it fail helps ensure your tests don&#039;t have bugs of this type.</description>
		<content:encoded><![CDATA[<p>@myself</p>
<p>I forgot a very important step:</p>
<p>Add a test for it. *Run the test to watch it fail*. Fix the problem. Then run the tests again to watch them pass.</p>
<p>All tests should be written this way &#8211; if the tests are written after the working code, you will be amazed how many times you write a test which has a bug in it and always passes. Running the test to see it fail helps ensure your tests don&#8217;t have bugs of this type.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan Hartley</title>
		<link>http://aras-p.info/blog/2007/07/31/testing-graphics-code/comment-page-1/#comment-19397</link>
		<dc:creator>Jonathan Hartley</dc:creator>
		<pubDate>Mon, 08 Jun 2009 12:25:05 +0000</pubDate>
		<guid isPermaLink="false">http://aras-p.info/blog/2007/07/31/testing-graphics-code/#comment-19397</guid>
		<description>@blackpawn

You&#039;re right that failures in totally unexpected ways are a problem.

I think the general testing philosophy to address this is that you create tests to cover as much as you reasonably can. Then every time you discover a new failure that the tests were not catching, you add a test for it. Fix it. Then run the tests again to watch them pass. In future you will be alerted if ever that particular failure regresses.

This isn&#039;t perfect, but it&#039;s still better than running with no tests at all.

Best regards.</description>
		<content:encoded><![CDATA[<p>@blackpawn</p>
<p>You&#8217;re right that failures in totally unexpected ways are a problem.</p>
<p>I think the general testing philosophy to address this is that you create tests to cover as much as you reasonably can. Then every time you discover a new failure that the tests were not catching, you add a test for it. Fix it. Then run the tests again to watch them pass. In future you will be alerted if ever that particular failure regresses.</p>
<p>This isn&#8217;t perfect, but it&#8217;s still better than running with no tests at all.</p>
<p>Best regards.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Game Rendering &#187; Regression Testing a Renderer</title>
		<link>http://aras-p.info/blog/2007/07/31/testing-graphics-code/comment-page-1/#comment-14479</link>
		<dc:creator>Game Rendering &#187; Regression Testing a Renderer</dc:creator>
		<pubDate>Fri, 07 Nov 2008 11:46:40 +0000</pubDate>
		<guid isPermaLink="false">http://aras-p.info/blog/2007/07/31/testing-graphics-code/#comment-14479</guid>
		<description>[...] Information about how Unity does testing of their graphics code http://aras-p.info/blog/2007/07/31/testing-graphics-code/ [...]</description>
		<content:encoded><![CDATA[<p>[...] Information about how Unity does testing of their graphics code <a href="http://aras-p.info/blog/2007/07/31/testing-graphics-code/" rel="nofollow">http://aras-p.info/blog/2007/07/31/testing-graphics-code/</a> [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: realtimecollisiondetection.net - the blog &#187; A brief graphics blog summary</title>
		<link>http://aras-p.info/blog/2007/07/31/testing-graphics-code/comment-page-1/#comment-11389</link>
		<dc:creator>realtimecollisiondetection.net - the blog &#187; A brief graphics blog summary</dc:creator>
		<pubDate>Mon, 14 Apr 2008 07:29:24 +0000</pubDate>
		<guid isPermaLink="false">http://aras-p.info/blog/2007/07/31/testing-graphics-code/#comment-11389</guid>
		<description>[...] not have noticed gamma being broken for several weeks (if indeed ever). &#8195;Another good post on testing graphics code can be found at Aras Pranckevi&#269;ius&#8217; [...]</description>
		<content:encoded><![CDATA[<p>[...] not have noticed gamma being broken for several weeks (if indeed ever). &emsp;Another good post on testing graphics code can be found at Aras Pranckevi&#269;ius&#8217; [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Horn</title>
		<link>http://aras-p.info/blog/2007/07/31/testing-graphics-code/comment-page-1/#comment-11030</link>
		<dc:creator>Horn</dc:creator>
		<pubDate>Mon, 17 Mar 2008 10:59:49 +0000</pubDate>
		<guid isPermaLink="false">http://aras-p.info/blog/2007/07/31/testing-graphics-code/#comment-11030</guid>
		<description>I just came across your blog and it seems that you are the right person to ask about Test Driven Development and Unit Testing in 3D graphics. I am doing a thesis in applying Test Driven Development in 3D training simulations, but I have trouble finding relevant material about this.

Here is a more precise formulation of what I work on:

I work on creating a tool to test if 3D graphics scenes are correctly displayed. The idea is to store a setup that I know is correctly displayed and rendered as a reference scene. How this oracle scene is chosen to be the reference scene is not so important. Maybe it is verified manually. 

The tool should be used on a military training simulator used to train Forward Air Controllers (FACTS). The simulation is written in C++ with Delta3D as engine. The tool might be integrated with a existing unit test framework. 

On strategy that I currently work on, is to capture frames and compare them against the oracle using image processing algorithms. However this approach seems to be hard because how should the timing interval be selected so the tool works independent of the pc running the simulation. I mean performance issues of the underlaying hardware should not affect which frames that are captured.

Another approach could be to compare selected 3D models in the scene by traversing their scene graphs, and that way avoiding performance issues related to different CPUs and GPUs.  

Hope to hear your ideas and thoughts towards this and if you have any references about something related I would appreciate it.

Best regards
Horn</description>
		<content:encoded><![CDATA[<p>I just came across your blog and it seems that you are the right person to ask about Test Driven Development and Unit Testing in 3D graphics. I am doing a thesis in applying Test Driven Development in 3D training simulations, but I have trouble finding relevant material about this.</p>
<p>Here is a more precise formulation of what I work on:</p>
<p>I work on creating a tool to test if 3D graphics scenes are correctly displayed. The idea is to store a setup that I know is correctly displayed and rendered as a reference scene. How this oracle scene is chosen to be the reference scene is not so important. Maybe it is verified manually. </p>
<p>The tool should be used on a military training simulator used to train Forward Air Controllers (FACTS). The simulation is written in C++ with Delta3D as engine. The tool might be integrated with a existing unit test framework. </p>
<p>On strategy that I currently work on, is to capture frames and compare them against the oracle using image processing algorithms. However this approach seems to be hard because how should the timing interval be selected so the tool works independent of the pc running the simulation. I mean performance issues of the underlaying hardware should not affect which frames that are captured.</p>
<p>Another approach could be to compare selected 3D models in the scene by traversing their scene graphs, and that way avoiding performance issues related to different CPUs and GPUs.  </p>
<p>Hope to hear your ideas and thoughts towards this and if you have any references about something related I would appreciate it.</p>
<p>Best regards<br />
Horn</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: blackpawn</title>
		<link>http://aras-p.info/blog/2007/07/31/testing-graphics-code/comment-page-1/#comment-1522</link>
		<dc:creator>blackpawn</dc:creator>
		<pubDate>Sat, 25 Aug 2007 07:23:21 +0000</pubDate>
		<guid isPermaLink="false">http://aras-p.info/blog/2007/07/31/testing-graphics-code/#comment-1522</guid>
		<description>whoa hardcore.  i&#039;m still doing things pretty ad hoc and relying a lot on alpha testers to report problems.  

i can see it being pretty hard to think of all the things that should be screenshot because some really random things can break.  for example objects fading to the haze color when the camera looks a certain direction, corrupt geometry on character with &gt; X bones, bad texture transform only on stage 2 or 3.  i guess even these could be picked up by luck in a particular shot.</description>
		<content:encoded><![CDATA[<p>whoa hardcore.  i&#8217;m still doing things pretty ad hoc and relying a lot on alpha testers to report problems.  </p>
<p>i can see it being pretty hard to think of all the things that should be screenshot because some really random things can break.  for example objects fading to the haze color when the camera looks a certain direction, corrupt geometry on character with &gt; X bones, bad texture transform only on stage 2 or 3.  i guess even these could be picked up by luck in a particular shot.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Aras Pranckevičius</title>
		<link>http://aras-p.info/blog/2007/07/31/testing-graphics-code/comment-page-1/#comment-1012</link>
		<dc:creator>Aras Pranckevičius</dc:creator>
		<pubDate>Wed, 01 Aug 2007 06:10:38 +0000</pubDate>
		<guid isPermaLink="false">http://aras-p.info/blog/2007/07/31/testing-graphics-code/#comment-1012</guid>
		<description>Roy: the thing is - there&#039;s no single reference card. A card might not support shaders = result is different (some effects will fallback). Or shadows = result is different (no shadows). And so on. What could be possibly done is storing a reference image set per &quot;card generation&quot; (&quot;this is how it should look on ps2.0 cards&quot;), and then do a bit of fuzzy comparison.

Ryan: thanks! It does not actually happen at the engine level, all that is required from the engine is the ability to do screenshots and load &quot;game levels&quot; (in this case it&#039;s test scenes) in succession.</description>
		<content:encoded><![CDATA[<p>Roy: the thing is &#8211; there&#8217;s no single reference card. A card might not support shaders = result is different (some effects will fallback). Or shadows = result is different (no shadows). And so on. What could be possibly done is storing a reference image set per &#8220;card generation&#8221; (&#8220;this is how it should look on ps2.0 cards&#8221;), and then do a bit of fuzzy comparison.</p>
<p>Ryan: thanks! It does not actually happen at the engine level, all that is required from the engine is the ability to do screenshots and load &#8220;game levels&#8221; (in this case it&#8217;s test scenes) in succession.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ryan</title>
		<link>http://aras-p.info/blog/2007/07/31/testing-graphics-code/comment-page-1/#comment-1007</link>
		<dc:creator>Ryan</dc:creator>
		<pubDate>Tue, 31 Jul 2007 23:47:08 +0000</pubDate>
		<guid isPermaLink="false">http://aras-p.info/blog/2007/07/31/testing-graphics-code/#comment-1007</guid>
		<description>Great work!

I work at a studio that used to contract for EA and was recently bought up, and I&#039;ve wanted to do this for every game I&#039;ve ever worked on.  It&#039;s much more cost-effective to do it at an engine level as you&#039;re doing, and I&#039;m so glad to hear that it actually works and is useful.  I think I&#039;ll keep around a bookmark to this entry to show my coworkers.

And FYI, EA has a compatibility testing lab for PC games that is quite rigorous.  There&#039;s always a bit of dread when submitting a build for compatibilty testing, because we invariably get strange bugs on the most obscure video cards.</description>
		<content:encoded><![CDATA[<p>Great work!</p>
<p>I work at a studio that used to contract for EA and was recently bought up, and I&#8217;ve wanted to do this for every game I&#8217;ve ever worked on.  It&#8217;s much more cost-effective to do it at an engine level as you&#8217;re doing, and I&#8217;m so glad to hear that it actually works and is useful.  I think I&#8217;ll keep around a bookmark to this entry to show my coworkers.</p>
<p>And FYI, EA has a compatibility testing lab for PC games that is quite rigorous.  There&#8217;s always a bit of dread when submitting a build for compatibilty testing, because we invariably get strange bugs on the most obscure video cards.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Roy</title>
		<link>http://aras-p.info/blog/2007/07/31/testing-graphics-code/comment-page-1/#comment-1006</link>
		<dc:creator>Roy</dc:creator>
		<pubDate>Tue, 31 Jul 2007 23:24:49 +0000</pubDate>
		<guid isPermaLink="false">http://aras-p.info/blog/2007/07/31/testing-graphics-code/#comment-1006</guid>
		<description>Don&#039;t some people also do &#039;fuzzy compares&#039; with reference images? As in, you basically have one card be the reference card of which you&#039;re certain it renders properly. Subsequently, all other cards should reasonably match the render of the reference card.

That would save quite a bit of screenshot flipping.</description>
		<content:encoded><![CDATA[<p>Don&#8217;t some people also do &#8216;fuzzy compares&#8217; with reference images? As in, you basically have one card be the reference card of which you&#8217;re certain it renders properly. Subsequently, all other cards should reasonably match the render of the reference card.</p>
<p>That would save quite a bit of screenshot flipping.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

