<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>bmalcolm's WebLog</title><link>http://blogs.msdn.com/bmalcolm/default.aspx</link><description /><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Unit Tests! What are they good for?</title><link>http://blogs.msdn.com/bmalcolm/archive/2004/05/24/140343.aspx</link><pubDate>Mon, 24 May 2004 18:41:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:140343</guid><dc:creator>bmalcolm</dc:creator><slash:comments>5</slash:comments><comments>http://blogs.msdn.com/bmalcolm/comments/140343.aspx</comments><wfw:commentRss>http://blogs.msdn.com/bmalcolm/commentrss.aspx?PostID=140343</wfw:commentRss><description>&lt;P&gt;Just a quick introduction:&lt;/P&gt;

&lt;P&gt;My name's Brian Malcolm, and I'm a developer on the Burton Testing Tools team.&lt;/P&gt;

&lt;P&gt;I can remember when I first joined this team, and was told that developers would have to write unit tests for their features before they were allowed to check their code in. I can sum up my initial thoughts in one word:&lt;/P&gt;

&lt;P&gt;Ugh!&lt;/P&gt;

&lt;P&gt;I mean, what a waste of time that I could instead be using to write cool new features! Obviously my code works, otherwise I wouldn't be checking it in. Why waste time writing unit tests?&lt;/P&gt;

&lt;P&gt;But then I soon realized the folly of my ways. It's not about you, oh great programmer, it's about everyone else.&lt;/P&gt;

&lt;P&gt;You see, if you have robust unit tests for your features, and if you have a policy that says that no one is allowed to check-in code unless that code passes all available unit tests, then you are protected from someone else checking in a change that breaks your code.&lt;/P&gt;

&lt;P&gt;Because, let's face it, when a feature in your code breaks, you're the one they're going to call, regardless of who checked in the breaking fix, right?&lt;/P&gt;

&lt;P&gt;Right.&lt;/P&gt;


&lt;P&gt;So, write unit tests. Use code coverage to verify that your unit tests are hitting all of the important areas in your code. Establish a checkin policy using those unit tests so breaking changes don't get checked in.&lt;/P&gt;

&lt;P&gt;And spend less time fixing other people's regressions. &lt;/P&gt;

&lt;P&gt;And spend more time writing cool new features.&lt;/P&gt;

&lt;P&gt;B.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=140343" width="1" height="1"&gt;</description></item></channel></rss>