<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/atom.xsl" media="screen"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-US"><title type="html">bmalcolm's WebLog</title><subtitle type="html" /><id>http://blogs.msdn.com/bmalcolm/atom.xml</id><link rel="alternate" type="text/html" href="http://blogs.msdn.com/bmalcolm/default.aspx" /><link rel="self" type="application/atom+xml" href="http://blogs.msdn.com/bmalcolm/atom.xml" /><generator uri="http://communityserver.org" version="2.1.61025.2">Community Server</generator><updated>2004-05-24T11:41:00Z</updated><entry><title>Unit Tests! What are they good for?</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/bmalcolm/archive/2004/05/24/140343.aspx" /><id>http://blogs.msdn.com/bmalcolm/archive/2004/05/24/140343.aspx</id><published>2004-05-24T18:41:00Z</published><updated>2004-05-24T18:41:00Z</updated><content type="html">&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;</content><author><name>bmalcolm</name><uri>http://blogs.msdn.com/members/bmalcolm.aspx</uri></author></entry></feed>