<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-7593993311797068924</id><updated>2012-02-16T07:42:37.127+01:00</updated><category term='Agile Methods'/><category term='Blog'/><title type='text'>this.game.Program();</title><subtitle type='html'>C#, XNA, and Agile Methods</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://davidwhart.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7593993311797068924/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://davidwhart.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>David Hart</name><uri>http://www.blogger.com/profile/05347031059599250642</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://lh3.google.co.uk/image/david.w.hart/RgMgapJhZaI/AAAAAAAAAAo/mAMQkVoJUyM/Graduation%20Ceremony%20079.JPG'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>3</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-7593993311797068924.post-4288267193248724158</id><published>2008-08-04T20:02:00.003+02:00</published><updated>2008-08-04T20:03:31.825+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Blog'/><title type='text'>Blog Therapy</title><content type='html'>&lt;p&gt;After writing my first post on my blog, I discovered something I hadn't even thought about: blogging not only helps people who might be reading it, it also helps you!&lt;/p&gt;&lt;p&gt;Having to write down and structure what was previously only some disorganised thoughts allowed me to better understand them. Providing links to similar articles, blog posts or presentations made me research the topic and learn even more.&lt;/p&gt;  &lt;p&gt;So if you want to help yourself ponder about a specific topic, don't hesitate: create a blog. Even if you don't have any readers, it will help you first and foremost.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7593993311797068924-4288267193248724158?l=davidwhart.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://davidwhart.blogspot.com/feeds/4288267193248724158/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7593993311797068924&amp;postID=4288267193248724158' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7593993311797068924/posts/default/4288267193248724158'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7593993311797068924/posts/default/4288267193248724158'/><link rel='alternate' type='text/html' href='http://davidwhart.blogspot.com/2008/08/blog-therapy.html' title='Blog Therapy'/><author><name>David Hart</name><uri>http://www.blogger.com/profile/05347031059599250642</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://lh3.google.co.uk/image/david.w.hart/RgMgapJhZaI/AAAAAAAAAAo/mAMQkVoJUyM/Graduation%20Ceremony%20079.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7593993311797068924.post-2847850014240383213</id><published>2008-08-03T17:48:00.001+02:00</published><updated>2008-08-03T18:02:14.355+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Agile Methods'/><title type='text'>Test-Driven Game Development</title><content type='html'>&lt;p&gt;A few years ago I bought a book called &lt;a title="Test-Driven Development: A Practical Guide" href="http://www.pearsonhighered.com/educator/academic/product/0,3110,0131016490,00.html" target="_blank"&gt;Test-Driven Development: A Practical Guide&lt;/a&gt; by David Astels. I saw it in a book shop after having had a quick read about the topic on the Internet, and it opened my eyes to a new way of programming. I gave it a go on a gimmick project and it worked beautifully. It took me longer to write the project than if I had plunged straight in, but thanks to it, I nearly never had to open the Visual Studio debugger.&lt;/p&gt;  &lt;p&gt;The problems starting arising when I tried to use it on a game project. All of a sudden, I could not follow the number one rule of TDD: never write a line of code or feature before having written the tests to back it up. How am I supposed to test a function that draws to the screen, that loads a resource, or that controls an AI character? I was so depressed about these &amp;quot;failures&amp;quot; of TDD that I abandoned the technique.&lt;/p&gt;  &lt;p&gt;A few years later, after more programming and work experience using conventional ad-hoc working techniques alone and in teams, I drew one conclusion: something needs to be done. Perhaps TDD is not so bad and needs another go! So I searched the Internet for ways to make it work. This is what I have learned:&lt;/p&gt;  &lt;h5&gt;Separate what cant be tested from the rest of the code base&lt;/h5&gt;  &lt;p&gt;Take graphics for example, I'm sure we can all agree that it's pretty much un-testable. When I have a look at the code I write, graphics is so tightly bound with logic that it's just simply impossible to test the logic by itself. The GameComponent architecture of the XNA framework doesn't help you, providing an Update and Draw function to override in the same class!&lt;/p&gt;  &lt;p&gt;The solution is to completely separate concerns and if possible put the graphics code in a completely different module. Test the logic, makes sure it's rock solid, and apply ad-hoc coding on what's left. The &lt;a href="http://martinfowler.com/eaaDev/ModelViewPresenter.html" target="_blank"&gt;Model-View-Presenter&lt;/a&gt; design pattern can help a lot in this case. More on that in another article.&lt;/p&gt;  &lt;h5&gt;Keep your tests simple&lt;/h5&gt;  &lt;p&gt;I read a presentation about &lt;a href="http://www.convexhull.com/articles/agile_development_html/" target="_blank"&gt;Agile Game Development&lt;/a&gt; that dates back to 2004. I'd like to use one of it's examples that demonstrates how simplification, one of the central keywords of eXtreme Programming, can help you unit-test code that you thought couldn't be tested.&lt;/p&gt;  &lt;p&gt;How do we test that when a character is shot and it's low in health, it runs for cover? Test this complex behaviour separately. Test that when it's shot, it's health goes down. Test that when health is below a certain level, flags are turned on. Test that when it's low in health and shot, it turns run-for-cover mode on. Test that when cover mode is on, it looks for the right path nodes. You get the point.&lt;/p&gt;  &lt;h5&gt;Mock objects are your friend&lt;/h5&gt;  &lt;p&gt;I don't know how to emphasize this enough. At first, they seemed to me like a nice trick to solve rare cases when the tested code needs to talk to an external resource like a database or the network card. But I learned that it's so useful it should be used all the time, simply to decouple objects for testing.&lt;/p&gt;  &lt;p&gt;If you don't use them, you will find that your tests will not only be clunky, but also very intricate and hard to refactor: your tests will have to assume that the objects your current code depends on is working for the tests to make any sense. Very bad design.&lt;/p&gt;  &lt;p&gt;Of course, I made all these mistakes and I will surely make even more along the way to becoming a great test writer. Don't hesitate to comment on this article and bring your own experience of TDD.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7593993311797068924-2847850014240383213?l=davidwhart.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://davidwhart.blogspot.com/feeds/2847850014240383213/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7593993311797068924&amp;postID=2847850014240383213' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7593993311797068924/posts/default/2847850014240383213'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7593993311797068924/posts/default/2847850014240383213'/><link rel='alternate' type='text/html' href='http://davidwhart.blogspot.com/2008/08/test-driven-game-development.html' title='Test-Driven Game Development'/><author><name>David Hart</name><uri>http://www.blogger.com/profile/05347031059599250642</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://lh3.google.co.uk/image/david.w.hart/RgMgapJhZaI/AAAAAAAAAAo/mAMQkVoJUyM/Graduation%20Ceremony%20079.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7593993311797068924.post-6261306920749924801</id><published>2008-08-02T13:11:00.001+02:00</published><updated>2008-08-02T13:11:47.622+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Blog'/><title type='text'>Hello World</title><content type='html'>&lt;p&gt;Welcome to game development blog!&lt;/p&gt;  &lt;p&gt;I've decided to open up a blog on my passion and work: game development. I will try to keep it up to date with my thoughts on my favourite topics: C#, XNA, and Agile methods.&lt;/p&gt;  &lt;p&gt;My current project is to build a set of tools and libraries in C# for the use of XNA. As I work on the features, I will try to describe them the best I can and hopefully, with the help of the readers, improve them.&lt;/p&gt;  &lt;p&gt;Enjoy!&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7593993311797068924-6261306920749924801?l=davidwhart.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://davidwhart.blogspot.com/feeds/6261306920749924801/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7593993311797068924&amp;postID=6261306920749924801' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7593993311797068924/posts/default/6261306920749924801'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7593993311797068924/posts/default/6261306920749924801'/><link rel='alternate' type='text/html' href='http://davidwhart.blogspot.com/2008/08/hello-world.html' title='Hello World'/><author><name>David Hart</name><uri>http://www.blogger.com/profile/05347031059599250642</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://lh3.google.co.uk/image/david.w.hart/RgMgapJhZaI/AAAAAAAAAAo/mAMQkVoJUyM/Graduation%20Ceremony%20079.JPG'/></author><thr:total>0</thr:total></entry></feed>
