<?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/'><id>tag:blogger.com,1999:blog-2813261110497121234.post5207941897696839357..comments</id><updated>2008-08-22T13:20:27.953-07:00</updated><title type='text'>Comments on Beech Bonanza: Moist Tests: Production Code Needs to be DRY, But ...</title><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://www.shaneharvie.com/feeds/5207941897696839357/comments/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2813261110497121234/5207941897696839357/comments/default'/><link rel='alternate' type='text/html' href='http://www.shaneharvie.com/2007/07/production-code-needs-to-be-dry-tests.html'/><author><name>Shane Harvie</name><uri>http://www.blogger.com/profile/01016971334424471677</uri><email>noreply@blogger.com</email></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>6</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-2813261110497121234.post-5634509154291445920</id><published>2008-08-22T13:20:27.953-07:00</published><updated>2008-08-22T13:20:27.953-07:00</updated><title type='text'>You need to differentiate between test-cases and s...</title><content type='html'>You need to differentiate between test-cases and support code. &lt;BR/&gt;&lt;BR/&gt;Tests tend to have repeating support code (especially if the Testing Framework used does not support the technology needed, like creating sample documents, threading, mocks or stuff.&lt;BR/&gt;&lt;BR/&gt;It is not a good idea to have 5 lines of DOM Parser code in multiple places when all you need is a instance of a fixed XML fragment.&lt;BR/&gt;&lt;BR/&gt;It is much better to have a private "createDomFromString()" or "initialiseMockServer(p1, p2, p3) or "validateDomElement(dom, key, value)" than to repeat that code.&lt;BR/&gt;&lt;BR/&gt;In the end the tests get more human readable as well.&lt;BR/&gt;&lt;BR/&gt;Gruss&lt;BR/&gt;Bernd&lt;BR/&gt;-- &lt;BR/&gt;http://itblog.eckenfels.net</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2813261110497121234/5207941897696839357/comments/default/5634509154291445920'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2813261110497121234/5207941897696839357/comments/default/5634509154291445920'/><link rel='alternate' type='text/html' href='http://www.shaneharvie.com/2007/07/production-code-needs-to-be-dry-tests.html?showComment=1219436427953#c5634509154291445920' title=''/><author><name>Bernd Eckenfels</name><uri>http://www.blogger.com/profile/09887787460408336985</uri><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://www.shaneharvie.com/2007/07/production-code-needs-to-be-dry-tests.html' ref='tag:blogger.com,1999:blog-2813261110497121234.post-5207941897696839357' source='http://www.blogger.com/feeds/2813261110497121234/posts/default/5207941897696839357' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-2813261110497121234.post-7427597350002881013</id><published>2007-08-24T20:23:34.329-07:00</published><updated>2007-08-24T20:23:34.329-07:00</updated><title type='text'>*Multiple Occurrences of Identical or Similar Text...</title><content type='html'>*Multiple Occurrences of Identical or Similar Text (MOIST)</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2813261110497121234/5207941897696839357/comments/default/7427597350002881013'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2813261110497121234/5207941897696839357/comments/default/7427597350002881013'/><link rel='alternate' type='text/html' href='http://www.shaneharvie.com/2007/07/production-code-needs-to-be-dry-tests.html?showComment=1188012214329#c7427597350002881013' title=''/><author><name>Patrick Farley</name><uri>http://www.blogger.com/profile/06361239021571823970</uri><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://www.shaneharvie.com/2007/07/production-code-needs-to-be-dry-tests.html' ref='tag:blogger.com,1999:blog-2813261110497121234.post-5207941897696839357' source='http://www.blogger.com/feeds/2813261110497121234/posts/default/5207941897696839357' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-2813261110497121234.post-7601778706479430357</id><published>2007-07-28T04:35:19.059-07:00</published><updated>2007-07-28T04:35:19.059-07:00</updated><title type='text'>I'd go a step further. It's not just about fixing ...</title><content type='html'>I'd go a step further. It's not just about fixing broken tests... in Agile, we talk a lot about how our tests are our documentation. When I want to understand how a class works, I'll often read the tests first. When I'm trying to get a handle on a new codebase, it's frustrating in the extreme if I have to continually jump out to setup methods and object mothers to see exactly what the important parts of my test objects are. (This is even more frustrating if your team uses an underpowered "IDE" (read as: "text editor") like TextMate where you can't easily jump to method definitions.) I don't mind having a generic "default" object set up somewhere else, as long as every test modifies the pertinent fields within the test body itself so that I can read them.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2813261110497121234/5207941897696839357/comments/default/7601778706479430357'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2813261110497121234/5207941897696839357/comments/default/7601778706479430357'/><link rel='alternate' type='text/html' href='http://www.shaneharvie.com/2007/07/production-code-needs-to-be-dry-tests.html?showComment=1185622519059#c7601778706479430357' title=''/><author><name>sarnacke</name><uri>http://www.blogger.com/profile/17163795870473996913</uri><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://www.shaneharvie.com/2007/07/production-code-needs-to-be-dry-tests.html' ref='tag:blogger.com,1999:blog-2813261110497121234.post-5207941897696839357' source='http://www.blogger.com/feeds/2813261110497121234/posts/default/5207941897696839357' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-2813261110497121234.post-2199727558926825962</id><published>2007-07-27T17:22:26.676-07:00</published><updated>2007-07-27T17:22:26.676-07:00</updated><title type='text'>Hi Dale, On my current project we have 6 devs and ...</title><content type='html'>Hi Dale, On my current project we have 6 devs and have been working for a year - we don't have a huge problem with test maintenance.  If we keep to a convention we can make changes pretty quickly using regular expression search/replace, but my regex skills have had to improve a bit, I must say.  I really like your last comment about taking code out that isn't specifically relevant to the piece of functionality. This is really important.  It's really hard to get the abstraction right (ie choosing exactly what to take out, and what to leave in).  Not many developers seem to understand and/or care about the subtleties of abstraction.  I'm interested in this concept and trying to put together something on it.  Thanks for your comments...</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2813261110497121234/5207941897696839357/comments/default/2199727558926825962'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2813261110497121234/5207941897696839357/comments/default/2199727558926825962'/><link rel='alternate' type='text/html' href='http://www.shaneharvie.com/2007/07/production-code-needs-to-be-dry-tests.html?showComment=1185582146676#c2199727558926825962' title=''/><author><name>Shane Harvie</name><uri>http://www.blogger.com/profile/01016971334424471677</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='07163103376474242918'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://www.shaneharvie.com/2007/07/production-code-needs-to-be-dry-tests.html' ref='tag:blogger.com,1999:blog-2813261110497121234.post-5207941897696839357' source='http://www.blogger.com/feeds/2813261110497121234/posts/default/5207941897696839357' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-2813261110497121234.post-2854354862913017991</id><published>2007-07-27T10:14:25.189-07:00</published><updated>2007-07-27T10:14:25.189-07:00</updated><title type='text'>DRY is not just about reducing bugs. It is also ab...</title><content type='html'>DRY is not just about reducing bugs. It is also about reducing maintenance  and refactoring costs. &lt;BR/&gt;&lt;BR/&gt;I agree that your approach makes reading tests much simpler.&lt;BR/&gt;&lt;BR/&gt;I've tested this approach on a bigish project (8 devs - 6 months). Test maintenance did become a serious issue towards the end.&lt;BR/&gt;&lt;BR/&gt;Have you followed this on large projects? did it scale for you?&lt;BR/&gt;&lt;BR/&gt;I believe there is a balance here. If you have setup code that isn't specifically relevant to the piece of functionality under test I think you can factor this out. But not necessarily into a private method.  Pushing this stuff out sideways into a sensible testing domain model will provide more reuseable code. &lt;BR/&gt;&lt;BR/&gt;&lt;BR/&gt;Just my 2 pence.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2813261110497121234/5207941897696839357/comments/default/2854354862913017991'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2813261110497121234/5207941897696839357/comments/default/2854354862913017991'/><link rel='alternate' type='text/html' href='http://www.shaneharvie.com/2007/07/production-code-needs-to-be-dry-tests.html?showComment=1185556465189#c2854354862913017991' title=''/><author><name>dale</name><uri>http://www.blogger.com/profile/01854345391121255098</uri><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://www.shaneharvie.com/2007/07/production-code-needs-to-be-dry-tests.html' ref='tag:blogger.com,1999:blog-2813261110497121234.post-5207941897696839357' source='http://www.blogger.com/feeds/2813261110497121234/posts/default/5207941897696839357' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-2813261110497121234.post-321629264578438116</id><published>2007-07-27T07:08:56.055-07:00</published><updated>2007-07-27T07:08:56.055-07:00</updated><title type='text'>Hey, nice post, i totally agree with you. I've see...</title><content type='html'>Hey, nice post, i totally agree with you. I've seen people abuse the DRY principle, will point them to you blog entry the next time.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2813261110497121234/5207941897696839357/comments/default/321629264578438116'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2813261110497121234/5207941897696839357/comments/default/321629264578438116'/><link rel='alternate' type='text/html' href='http://www.shaneharvie.com/2007/07/production-code-needs-to-be-dry-tests.html?showComment=1185545336055#c321629264578438116' title=''/><author><name>obfuscated</name><uri>http://www.blogger.com/profile/16001744752504935648</uri><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://www.shaneharvie.com/2007/07/production-code-needs-to-be-dry-tests.html' ref='tag:blogger.com,1999:blog-2813261110497121234.post-5207941897696839357' source='http://www.blogger.com/feeds/2813261110497121234/posts/default/5207941897696839357' type='text/html'/></entry></feed>