{"id":121,"date":"2004-06-01T15:04:02","date_gmt":"2004-06-01T05:04:02","guid":{"rendered":"http:\/\/www.malcolmgroves.com\/blog\/?p=121"},"modified":"2008-09-16T15:03:56","modified_gmt":"2008-09-16T05:03:56","slug":"test-lists-in-tdd","status":"publish","type":"post","link":"http:\/\/www.malcolmgroves.com\/blog\/?p=121","title":{"rendered":"Test Lists in TDD"},"content":{"rendered":"<p>I was flicking through <a href=\"http:\/\/www.amazon.com\/exec\/obidos\/ASIN\/0735619484\/qid=1085892528\/sr=2-1\/ref=sr_2_1\/103-2792179-5435836\">Test-Driven Development in Microsoft .NET<\/a> in Borders yesterday. <\/p>\n<p>In it, one of the authors suggests you make a Test List when creating your test class. A Test List, cunningly named as it is, is a list of tests you think you might need for the particular class you are testing. The idea being that not only is it a place to capture all the initial thoughts you had about potential tests you should perform, and the others you think of while you are working, but they also went on to outline a couple of different strategies to choose which tests to write first, and how your choices may affect the design of your class. <\/p>\n<p>Seems like a good idea to me: simple, useful, obvious, but in spite of the fact that I&#8217;ve been using DUnit and JUnit for quite a few years, and more recently NUnit, it&#8217;s not something that I&#8217;ve ever formally done. I usually just keep them in my head (invariably forgetting a few) or scrawl them down randomly on a bit of paper and immediately lose them. I&#8217;ve had the embarrasing situation a couple of times, where upon tracking down a bug, I&#8217;ve said to myself &quot;But I&#8217;m sure I wrote a test for that&quot; only to find that I meant to, but&#8230;<\/p>\n<p>So, mark up one habit I&#8217;m going to try and get into. However it seems that Delphi and C#Builder can help me out here. I&#8217;ve already got the following code added to a Code Template:<\/p>\n<p>{$REGION &#8216;|&#8217;}<\/p>\n<p>{$ENDREGION}<\/p>\n<p>so that I can add collapsible code sections with a simple Ctrl-J. So, from now on I&#8217;m going to try and get in the habit of putting one of these up somewhere near the declaration of my test classes, and within it use the To-Do List features of Delphi and C#Builder to embed my Test List into my code. I then get a nice, non-distracting collapsed section like this:<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/www.malcolmgroves.com\/images\/2004\/05\/30\/20040530001.gif\" \/><\/p>\n<p>but which when needed, expands out to this:<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/www.malcolmgroves.com\/images\/2004\/05\/30\/20040530002.gif\" \/><\/p>\n<p>but more importantly, I can access via the To-Do List viewer:<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/www.malcolmgroves.com\/images\/2004\/05\/30\/20040530003.gif\" \/><\/p>\n<p>So at the very least, I can now prove I really did mean to add that test after I spend a bunch of time tracking down a bug \ud83d\ude42<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I was flicking through Test-Driven Development in Microsoft .NET in Borders yesterday. In it, one of the authors suggests you make a Test List when creating your test class. A Test List, cunningly named as it is, is a list of tests you think you might need for the particular class you are testing. The [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-121","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"http:\/\/www.malcolmgroves.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/121","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.malcolmgroves.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.malcolmgroves.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.malcolmgroves.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/www.malcolmgroves.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=121"}],"version-history":[{"count":1,"href":"http:\/\/www.malcolmgroves.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/121\/revisions"}],"predecessor-version":[{"id":122,"href":"http:\/\/www.malcolmgroves.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/121\/revisions\/122"}],"wp:attachment":[{"href":"http:\/\/www.malcolmgroves.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=121"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.malcolmgroves.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=121"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.malcolmgroves.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=121"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}