<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/css" href="http://commons.oreilly.com/wiki/skins/common/feed.css?97"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://commons.oreilly.com/wiki/index.php?title=The_Three_Laws_of_Test-Driven_Development&amp;action=history&amp;feed=atom</id>
		<title>The Three Laws of Test-Driven Development - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://commons.oreilly.com/wiki/index.php?title=The_Three_Laws_of_Test-Driven_Development&amp;action=history&amp;feed=atom"/>
		<link rel="alternate" type="text/html" href="http://commons.oreilly.com/wiki/index.php?title=The_Three_Laws_of_Test-Driven_Development&amp;action=history"/>
		<updated>2013-05-22T22:54:55Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.11.0</generator>

	<entry>
		<id>http://commons.oreilly.com/wiki/index.php?title=The_Three_Laws_of_Test-Driven_Development&amp;diff=24774&amp;oldid=prev</id>
		<title>Kevlin: Professionalism and Test-Driven Development moved to The Three Laws of Test-Driven Development</title>
		<link rel="alternate" type="text/html" href="http://commons.oreilly.com/wiki/index.php?title=The_Three_Laws_of_Test-Driven_Development&amp;diff=24774&amp;oldid=prev"/>
				<updated>2009-07-10T14:09:46Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;a href=&quot;/wiki/index.php/Professionalism_and_Test-Driven_Development&quot; title=&quot;Professionalism and Test-Driven Development&quot;&gt;Professionalism and Test-Driven Development&lt;/a&gt; moved to &lt;a href=&quot;/wiki/index.php/The_Three_Laws_of_Test-Driven_Development&quot; title=&quot;The Three Laws of Test-Driven Development&quot;&gt;The Three Laws of Test-Driven Development&lt;/a&gt;&lt;/p&gt;

			&lt;table style=&quot;background-color: white; color:black;&quot;&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
			&lt;tr&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;←Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 14:09, 10 July 2009&lt;/td&gt;
			&lt;/tr&gt;
		&lt;/table&gt;</summary>
		<author><name>Kevlin</name></author>	</entry>

	<entry>
		<id>http://commons.oreilly.com/wiki/index.php?title=The_Three_Laws_of_Test-Driven_Development&amp;diff=24713&amp;oldid=prev</id>
		<title>Kevlin at 19:16, 8 July 2009</title>
		<link rel="alternate" type="text/html" href="http://commons.oreilly.com/wiki/index.php?title=The_Three_Laws_of_Test-Driven_Development&amp;diff=24713&amp;oldid=prev"/>
				<updated>2009-07-08T19:16:54Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;

			&lt;table style=&quot;background-color: white; color:black;&quot;&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
			&lt;tr&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;←Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 19:16, 8 July 2009&lt;/td&gt;
			&lt;/tr&gt;
		&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;The jury is in. The controversy is over. The debate has ended&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;, and the &lt;/del&gt;conclusion is: ''TDD works''. Sorry.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;The jury is in. The controversy is over. The debate has ended&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;. The &lt;/ins&gt;conclusion is: ''TDD works''. Sorry.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Test-Driven Development (TDD) is a programming discipline whereby programmers drive the design and implementation of their code by using unit tests. There are three simple laws:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Test-Driven Development (TDD) is a programming discipline whereby programmers drive the design and implementation of their code by using unit tests. There are three simple laws:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 13:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 13:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;* '''Debugging''' &amp;lt;br/&amp;gt; What would programming be like if you were never more than a few minutes away from running everything and seeing it work? Imagine working on a project where you ''never'' have several modules torn to shreds hoping you can get them all put back together next Tuesday. Imagine your debug time shrinking to the extent that you lose the muscle memory for your debugging hot keys.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;* '''Debugging''' &amp;lt;br/&amp;gt; What would programming be like if you were never more than a few minutes away from running everything and seeing it work? Imagine working on a project where you ''never'' have several modules torn to shreds hoping you can get them all put back together next Tuesday. Imagine your debug time shrinking to the extent that you lose the muscle memory for your debugging hot keys.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;* '''Courage''' &amp;lt;br/&amp;gt; Have you ever seen code in a module that was so ugly that your first reaction was &amp;quot;Wow, I should clean this.&amp;quot; Of course your next reaction was: &amp;quot;I'm not touching it!&amp;quot;. Why? Because you were ''afraid'' you'd break it. How much code could be cleaned if we could conquer our fear of breaking it? If you have a suite of tests that you trust, then you are not afraid to make changes. &amp;lt;br/&amp;gt; ''You are not afraid to make changes!'' &amp;lt;br/&amp;gt;You see a messy functions, you clean it. All the tests pass! The tests give you the courage to clean the code! &amp;lt;br/&amp;gt; Nothing makes a system more flexible than a suite of tests &amp;amp;mdash; nothing. If you have a beautiful design and architecture, but have no tests, you are still afraid to change the code. But if you have a suite of high-coverage tests&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;, &lt;/del&gt;then even if your design and architecture are terrible, you are not afraid to clean up the design and architecture.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;* '''Courage''' &amp;lt;br/&amp;gt; Have you ever seen code in a module that was so ugly that your first reaction was &amp;quot;Wow, I should clean this.&amp;quot; Of course your next reaction was: &amp;quot;I'm not touching it!&amp;quot;. Why? Because you were ''afraid'' you'd break it. How much code could be cleaned if we could conquer our fear of breaking it? If you have a suite of tests that you trust, then you are not afraid to make changes. &amp;lt;br/&amp;gt; ''You are not afraid to make changes!'' &amp;lt;br/&amp;gt;You see a messy functions, you clean it. All the tests pass! The tests give you the courage to clean the code! &amp;lt;br/&amp;gt; Nothing makes a system more flexible than a suite of tests &amp;amp;mdash; nothing. If you have a beautiful design and architecture, but have no tests, you are still afraid to change the code. But if you have a suite of high-coverage tests then&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;, &lt;/ins&gt;even if your design and architecture are terrible, you are not afraid to clean up the design and architecture.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;* '''Documentation''' &amp;lt;br/&amp;gt; Have you ever integrated a third party package? They send you a nice manual written by a tech writer. At the back of that manual is an ugly section where all the code examples are shown. Where's the first place you go? You go to the code examples. You go to the code examples because that's where the &amp;lt;i&amp;gt;truth&amp;lt;/i&amp;gt; is. &amp;lt;br/&amp;gt; Unit tests are just like those code examples. If you want to know how to call a method, there are tests that call that method every way it can be called. These tests are small, focused ''documents'' that describe how to use the production code. They are ''design documents'' that are written in a language that the programmers understand; are unambiguous; are so formal that they ''execute''; and cannot get out of sync with the production code.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;* '''Documentation''' &amp;lt;br/&amp;gt; Have you ever integrated a third party package? They send you a nice manual written by a tech writer. At the back of that manual is an ugly section where all the code examples are shown. Where's the first place you go? You go to the code examples. You go to the code examples because that's where the &amp;lt;i&amp;gt;truth&amp;lt;/i&amp;gt; is. &amp;lt;br/&amp;gt; Unit tests are just like those code examples. If you want to know how to call a method, there are tests that call that method every way it can be called. These tests are small, focused ''documents'' that describe how to use the production code. They are ''design documents'' that are written in a language that the programmers understand; are unambiguous; are so formal that they ''execute''; and cannot get out of sync with the production code.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Kevlin</name></author>	</entry>

	<entry>
		<id>http://commons.oreilly.com/wiki/index.php?title=The_Three_Laws_of_Test-Driven_Development&amp;diff=23445&amp;oldid=prev</id>
		<title>Unclebob at 17:18, 18 February 2009</title>
		<link rel="alternate" type="text/html" href="http://commons.oreilly.com/wiki/index.php?title=The_Three_Laws_of_Test-Driven_Development&amp;diff=23445&amp;oldid=prev"/>
				<updated>2009-02-18T17:18:05Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;

			&lt;table style=&quot;background-color: white; color:black;&quot;&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
			&lt;tr&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;←Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 17:18, 18 February 2009&lt;/td&gt;
			&lt;/tr&gt;
		&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 15:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 15:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;* '''Courage''' &amp;lt;br/&amp;gt; Have you ever seen code in a module that was so ugly that your first reaction was &amp;quot;Wow, I should clean this.&amp;quot; Of course your next reaction was: &amp;quot;I'm not touching it!&amp;quot;. Why? Because you were ''afraid'' you'd break it. How much code could be cleaned if we could conquer our fear of breaking it? If you have a suite of tests that you trust, then you are not afraid to make changes. &amp;lt;br/&amp;gt; ''You are not afraid to make changes!'' &amp;lt;br/&amp;gt;You see a messy functions, you clean it. All the tests pass! The tests give you the courage to clean the code! &amp;lt;br/&amp;gt; Nothing makes a system more flexible than a suite of tests &amp;amp;mdash; nothing. If you have a beautiful design and architecture, but have no tests, you are still afraid to change the code. But if you have a suite of high-coverage tests, then even if your design and architecture are terrible, you are not afraid to clean up the design and architecture.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;* '''Courage''' &amp;lt;br/&amp;gt; Have you ever seen code in a module that was so ugly that your first reaction was &amp;quot;Wow, I should clean this.&amp;quot; Of course your next reaction was: &amp;quot;I'm not touching it!&amp;quot;. Why? Because you were ''afraid'' you'd break it. How much code could be cleaned if we could conquer our fear of breaking it? If you have a suite of tests that you trust, then you are not afraid to make changes. &amp;lt;br/&amp;gt; ''You are not afraid to make changes!'' &amp;lt;br/&amp;gt;You see a messy functions, you clean it. All the tests pass! The tests give you the courage to clean the code! &amp;lt;br/&amp;gt; Nothing makes a system more flexible than a suite of tests &amp;amp;mdash; nothing. If you have a beautiful design and architecture, but have no tests, you are still afraid to change the code. But if you have a suite of high-coverage tests, then even if your design and architecture are terrible, you are not afraid to clean up the design and architecture.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;* '''Documentation''' &amp;lt;br/&amp;gt; Have you ever integrated a third party package? &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;You get &lt;/del&gt;a nice manual written by a tech writer. At the back of that manual is an ugly section where all the code examples are shown. Where's the first place you go? You go to the code examples. You go to the code examples because that's where the truth is. &amp;lt;br/&amp;gt; Unit tests are just like those code examples. If you want to know how to call a method, there are tests that call that method every way it can be called. These tests are small, focused ''documents'' that describe how to use the production code. They are ''design documents'' that are written in a language that the programmers understand; are unambiguous; are so formal that they ''execute''; and cannot get out of sync with the production code.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;* '''Documentation''' &amp;lt;br/&amp;gt; Have you ever integrated a third party package? &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;They send you &lt;/ins&gt;a nice manual written by a tech writer. At the back of that manual is an ugly section where all the code examples are shown. Where's the first place you go? You go to the code examples. You go to the code examples because that's where the &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;i&amp;gt;&lt;/ins&gt;truth&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/i&amp;gt; &lt;/ins&gt;is. &amp;lt;br/&amp;gt; Unit tests are just like those code examples. If you want to know how to call a method, there are tests that call that method every way it can be called. These tests are small, focused ''documents'' that describe how to use the production code. They are ''design documents'' that are written in a language that the programmers understand; are unambiguous; are so formal that they ''execute''; and cannot get out of sync with the production code.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;* '''Design''' &amp;lt;br/&amp;gt; If you follow the three laws every module will be ''testable'' by definition. And another word for ''testable'' is ''decoupled''. In order to write your tests first, you have to decouple the units you are testing from the rest of the system. There's simply no other way to do it. This means your designs are more flexible, more maintainable, and just cleaner.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;* '''Design''' &amp;lt;br/&amp;gt; If you follow the three laws every module will be ''testable'' by definition. And another word for ''testable'' is ''decoupled''. In order to write your tests first, you have to decouple the units you are testing from the rest of the system. There's simply no other way to do it. This means your designs are more flexible, more maintainable, and just cleaner.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;!-- diff cache key wikicontent:diff:version:1.11a:oldid:23444:newid:23445 --&gt;
&lt;/table&gt;</summary>
		<author><name>Unclebob</name></author>	</entry>

	<entry>
		<id>http://commons.oreilly.com/wiki/index.php?title=The_Three_Laws_of_Test-Driven_Development&amp;diff=23444&amp;oldid=prev</id>
		<title>Unclebob at 17:16, 18 February 2009</title>
		<link rel="alternate" type="text/html" href="http://commons.oreilly.com/wiki/index.php?title=The_Three_Laws_of_Test-Driven_Development&amp;diff=23444&amp;oldid=prev"/>
				<updated>2009-02-18T17:16:10Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;

			&lt;table style=&quot;background-color: white; color:black;&quot;&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
			&lt;tr&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;←Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 17:16, 18 February 2009&lt;/td&gt;
			&lt;/tr&gt;
		&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 13:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 13:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;* '''Debugging''' &amp;lt;br/&amp;gt; What would programming be like if you were never more than a few minutes away from running everything and seeing it work? Imagine working on a project where you ''never'' have several modules torn to shreds hoping you can get them all put back together next Tuesday. Imagine your debug time shrinking to the extent that you lose the muscle memory for your debugging hot keys.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;* '''Debugging''' &amp;lt;br/&amp;gt; What would programming be like if you were never more than a few minutes away from running everything and seeing it work? Imagine working on a project where you ''never'' have several modules torn to shreds hoping you can get them all put back together next Tuesday. Imagine your debug time shrinking to the extent that you lose the muscle memory for your debugging hot keys.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;* '''Courage''' &amp;lt;br/&amp;gt; Have you ever seen code in a module that was so ugly that your first reaction was &amp;quot;Wow, I should clean this.&amp;quot; Of course your next reaction was: &amp;quot;I'm not touching it!&amp;quot;. Why? Because you were ''afraid'' you'd break it. How much code could be cleaned if we could conquer our fear of breaking it? If you have a suite of tests that you trust, then you are not afraid to make changes. &amp;lt;br/&amp;gt; ''You are not afraid to make changes!'' &amp;lt;br/&amp;gt;You see a messy functions, you clean it. All the tests pass! The tests give you the courage to clean the code! &amp;lt;br/&amp;gt; Nothing &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;make &lt;/del&gt;a system more flexible than a suite of tests &amp;amp;mdash; nothing. If you have a beautiful design and architecture, but have no tests, you are still afraid to change the code. But if you have a suite of high-coverage tests, then even if your design and architecture are terrible, you are not afraid to clean up the design and architecture.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;* '''Courage''' &amp;lt;br/&amp;gt; Have you ever seen code in a module that was so ugly that your first reaction was &amp;quot;Wow, I should clean this.&amp;quot; Of course your next reaction was: &amp;quot;I'm not touching it!&amp;quot;. Why? Because you were ''afraid'' you'd break it. How much code could be cleaned if we could conquer our fear of breaking it? If you have a suite of tests that you trust, then you are not afraid to make changes. &amp;lt;br/&amp;gt; ''You are not afraid to make changes!'' &amp;lt;br/&amp;gt;You see a messy functions, you clean it. All the tests pass! The tests give you the courage to clean the code! &amp;lt;br/&amp;gt; Nothing &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;makes &lt;/ins&gt;a system more flexible than a suite of tests &amp;amp;mdash; nothing. If you have a beautiful design and architecture, but have no tests, you are still afraid to change the code. But if you have a suite of high-coverage tests, then even if your design and architecture are terrible, you are not afraid to clean up the design and architecture.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;* '''Documentation''' &amp;lt;br/&amp;gt; Have you ever integrated a third party package? You get a nice manual written by a tech writer. At the back of that manual is an ugly section where all the code examples are shown. Where's the first place you go? You go to the code examples. You go to the code examples because that's where the truth is. &amp;lt;br/&amp;gt; Unit tests are just like those code examples. If you want to know how to call a method, there are tests that call that method every way it can be called. These tests are small, focused ''documents'' that describe how to use the production code. They are ''design documents'' that are written in a language that the programmers understand; are unambiguous; are so formal that they ''execute''; and cannot get out of sync with the production code.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;* '''Documentation''' &amp;lt;br/&amp;gt; Have you ever integrated a third party package? You get a nice manual written by a tech writer. At the back of that manual is an ugly section where all the code examples are shown. Where's the first place you go? You go to the code examples. You go to the code examples because that's where the truth is. &amp;lt;br/&amp;gt; Unit tests are just like those code examples. If you want to know how to call a method, there are tests that call that method every way it can be called. These tests are small, focused ''documents'' that describe how to use the production code. They are ''design documents'' that are written in a language that the programmers understand; are unambiguous; are so formal that they ''execute''; and cannot get out of sync with the production code.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Unclebob</name></author>	</entry>

	<entry>
		<id>http://commons.oreilly.com/wiki/index.php?title=The_Three_Laws_of_Test-Driven_Development&amp;diff=23443&amp;oldid=prev</id>
		<title>Unclebob at 17:15, 18 February 2009</title>
		<link rel="alternate" type="text/html" href="http://commons.oreilly.com/wiki/index.php?title=The_Three_Laws_of_Test-Driven_Development&amp;diff=23443&amp;oldid=prev"/>
				<updated>2009-02-18T17:15:28Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;

			&lt;table style=&quot;background-color: white; color:black;&quot;&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
			&lt;tr&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;←Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 17:15, 18 February 2009&lt;/td&gt;
			&lt;/tr&gt;
		&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 9:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 9:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;If you follow these three laws you will be locked into a cycle that is, perhaps, 30 seconds long.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;If you follow these three laws you will be locked into a cycle that is, perhaps, 30 seconds long.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Experienced programmers' first impression of these &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;rules &lt;/del&gt;is that they are just ''stupid''. But if we &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;work this way&lt;/del&gt;, we soon discover that there are a number of benefits:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Experienced programmers' first impression of these &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;laws &lt;/ins&gt;is that they are just ''stupid''. But if we &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;follow these laws&lt;/ins&gt;, we soon discover that there are a number of benefits:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;* '''Debugging''' &amp;lt;br/&amp;gt; What would programming be like if you were never more than a few minutes away from running everything and seeing it work? Imagine working on a project where you ''never'' have several modules torn to shreds hoping you can get them all put back together next Tuesday. Imagine your debug time shrinking to the extent that you lose the muscle memory for your debugging hot keys.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;* '''Debugging''' &amp;lt;br/&amp;gt; What would programming be like if you were never more than a few minutes away from running everything and seeing it work? Imagine working on a project where you ''never'' have several modules torn to shreds hoping you can get them all put back together next Tuesday. Imagine your debug time shrinking to the extent that you lose the muscle memory for your debugging hot keys.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;* '''Courage''' &amp;lt;br/&amp;gt; Have you ever seen code in a module that was so ugly that your first reaction was &amp;quot;Wow, I should clean this.&amp;quot; Of course your next reaction was: &amp;quot;I'm not touching it!&amp;quot;. Why? Because you were ''afraid'' you'd break it. How much code could be cleaned if we could conquer &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;the &lt;/del&gt;fear &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;that we'd break the code we were cleaning&lt;/del&gt;? If you &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;have &lt;/del&gt;have a suite of tests that you trust, then you are not afraid to make changes. &amp;lt;br/&amp;gt; ''You are not afraid to make changes!'' &amp;lt;br/&amp;gt;You see a messy functions, you clean it. All the tests pass! The tests give you the courage to clean the code! &amp;lt;br/&amp;gt; Nothing make a system more flexible than a suite of tests &amp;amp;mdash; nothing. If you have a beautiful design and architecture, but have no tests, you are still afraid to change the code. But if you have a suite of high-coverage tests, then even if your design and architecture are terrible, you are not afraid to clean up the design and architecture.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;* '''Courage''' &amp;lt;br/&amp;gt; Have you ever seen code in a module that was so ugly that your first reaction was &amp;quot;Wow, I should clean this.&amp;quot; Of course your next reaction was: &amp;quot;I'm not touching it!&amp;quot;. Why? Because you were ''afraid'' you'd break it. How much code could be cleaned if we could conquer &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;our &lt;/ins&gt;fear &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;of breaking it&lt;/ins&gt;? If you have a suite of tests that you trust, then you are not afraid to make changes. &amp;lt;br/&amp;gt; ''You are not afraid to make changes!'' &amp;lt;br/&amp;gt;You see a messy functions, you clean it. All the tests pass! The tests give you the courage to clean the code! &amp;lt;br/&amp;gt; Nothing make a system more flexible than a suite of tests &amp;amp;mdash; nothing. If you have a beautiful design and architecture, but have no tests, you are still afraid to change the code. But if you have a suite of high-coverage tests, then even if your design and architecture are terrible, you are not afraid to clean up the design and architecture.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;* '''Documentation''' &amp;lt;br/&amp;gt; Have you ever integrated a third party package? You get a nice manual written by a tech writer. At the back of that manual is an ugly section where all the code examples are shown. Where's the first place you go? You go to the code examples. You go to the code examples because that's where the truth is. &amp;lt;br/&amp;gt; Unit tests are just like those code examples. If you want to know how to call a method, there are tests that call that method every way it can be called. These tests are small, focused ''documents'' that describe how to use the production code. They are ''design documents'' that are written in a language that the programmers understand; are unambiguous; are so formal that they ''execute''; and cannot get out of sync with the production code.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;* '''Documentation''' &amp;lt;br/&amp;gt; Have you ever integrated a third party package? You get a nice manual written by a tech writer. At the back of that manual is an ugly section where all the code examples are shown. Where's the first place you go? You go to the code examples. You go to the code examples because that's where the truth is. &amp;lt;br/&amp;gt; Unit tests are just like those code examples. If you want to know how to call a method, there are tests that call that method every way it can be called. These tests are small, focused ''documents'' that describe how to use the production code. They are ''design documents'' that are written in a language that the programmers understand; are unambiguous; are so formal that they ''execute''; and cannot get out of sync with the production code.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Unclebob</name></author>	</entry>

	<entry>
		<id>http://commons.oreilly.com/wiki/index.php?title=The_Three_Laws_of_Test-Driven_Development&amp;diff=23440&amp;oldid=prev</id>
		<title>Unclebob at 16:45, 18 February 2009</title>
		<link rel="alternate" type="text/html" href="http://commons.oreilly.com/wiki/index.php?title=The_Three_Laws_of_Test-Driven_Development&amp;diff=23440&amp;oldid=prev"/>
				<updated>2009-02-18T16:45:38Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;

			&lt;table style=&quot;background-color: white; color:black;&quot;&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
			&lt;tr&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;←Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 16:45, 18 February 2009&lt;/td&gt;
			&lt;/tr&gt;
		&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 9:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 9:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;If you follow these three laws you will be locked into a cycle that is, perhaps, 30 seconds long.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;If you follow these three laws you will be locked into a cycle that is, perhaps, 30 seconds long.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;Upon &lt;/del&gt;first &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;hearing &lt;/del&gt;these &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;laws, experienced programmers conclude &lt;/del&gt;that they are just ''stupid''. But if we work this way, we soon discover that there are a number of benefits:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;Experienced programmers' &lt;/ins&gt;first &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;impression of &lt;/ins&gt;these &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;rules is &lt;/ins&gt;that they are just ''stupid''. But if we work this way, we soon discover that there are a number of benefits:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;* '''Debugging''' &amp;lt;br/&amp;gt; What would programming be like if you were never more than a few minutes away from running everything and seeing it work? Imagine working on a project where you ''never'' have several modules torn to shreds hoping you can get them all put back together next Tuesday. Imagine your debug time shrinking to the extent that you lose the muscle memory for your debugging hot keys.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;* '''Debugging''' &amp;lt;br/&amp;gt; What would programming be like if you were never more than a few minutes away from running everything and seeing it work? Imagine working on a project where you ''never'' have several modules torn to shreds hoping you can get them all put back together next Tuesday. Imagine your debug time shrinking to the extent that you lose the muscle memory for your debugging hot keys.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;!-- diff cache key wikicontent:diff:version:1.11a:oldid:21800:newid:23440 --&gt;
&lt;/table&gt;</summary>
		<author><name>Unclebob</name></author>	</entry>

	<entry>
		<id>http://commons.oreilly.com/wiki/index.php?title=The_Three_Laws_of_Test-Driven_Development&amp;diff=21800&amp;oldid=prev</id>
		<title>Kevlin: Professionalism and Test Driven Development moved to Professionalism and Test-Driven Development</title>
		<link rel="alternate" type="text/html" href="http://commons.oreilly.com/wiki/index.php?title=The_Three_Laws_of_Test-Driven_Development&amp;diff=21800&amp;oldid=prev"/>
				<updated>2008-11-27T17:36:31Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;a href=&quot;/wiki/index.php/Professionalism_and_Test_Driven_Development&quot; title=&quot;Professionalism and Test Driven Development&quot;&gt;Professionalism and Test Driven Development&lt;/a&gt; moved to &lt;a href=&quot;/wiki/index.php/Professionalism_and_Test-Driven_Development&quot; title=&quot;Professionalism and Test-Driven Development&quot;&gt;Professionalism and Test-Driven Development&lt;/a&gt;&lt;/p&gt;

			&lt;table style=&quot;background-color: white; color:black;&quot;&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
			&lt;tr&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;←Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 17:36, 27 November 2008&lt;/td&gt;
			&lt;/tr&gt;
		&lt;/table&gt;</summary>
		<author><name>Kevlin</name></author>	</entry>

	<entry>
		<id>http://commons.oreilly.com/wiki/index.php?title=The_Three_Laws_of_Test-Driven_Development&amp;diff=21759&amp;oldid=prev</id>
		<title>Unclebob: New page: The jury is in. The controversy is over. The debate has ended, and the conclusion is: ''TDD works''. Sorry.  Test-Driven Development (TDD) is a programming discipline whereby programmers d...</title>
		<link rel="alternate" type="text/html" href="http://commons.oreilly.com/wiki/index.php?title=The_Three_Laws_of_Test-Driven_Development&amp;diff=21759&amp;oldid=prev"/>
				<updated>2008-11-26T13:16:41Z</updated>
		
		<summary type="html">&lt;p&gt;New page: The jury is in. The controversy is over. The debate has ended, and the conclusion is: ''TDD works''. Sorry.  Test-Driven Development (TDD) is a programming discipline whereby programmers d...&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;The jury is in. The controversy is over. The debate has ended, and the conclusion is: ''TDD works''. Sorry.&lt;br /&gt;
&lt;br /&gt;
Test-Driven Development (TDD) is a programming discipline whereby programmers drive the design and implementation of their code by using unit tests. There are three simple laws:&lt;br /&gt;
&lt;br /&gt;
# You can't write any production code until you have first written a failing unit test.&lt;br /&gt;
# You can't write more of a unit test than is sufficient to fail, and not compiling is failing.&lt;br /&gt;
# You can't write more production code than is sufficient to pass the currently failing unit test.&lt;br /&gt;
&lt;br /&gt;
If you follow these three laws you will be locked into a cycle that is, perhaps, 30 seconds long.&lt;br /&gt;
&lt;br /&gt;
Upon first hearing these laws, experienced programmers conclude that they are just ''stupid''. But if we work this way, we soon discover that there are a number of benefits:&lt;br /&gt;
&lt;br /&gt;
* '''Debugging''' &amp;lt;br/&amp;gt; What would programming be like if you were never more than a few minutes away from running everything and seeing it work? Imagine working on a project where you ''never'' have several modules torn to shreds hoping you can get them all put back together next Tuesday. Imagine your debug time shrinking to the extent that you lose the muscle memory for your debugging hot keys.&lt;br /&gt;
&lt;br /&gt;
* '''Courage''' &amp;lt;br/&amp;gt; Have you ever seen code in a module that was so ugly that your first reaction was &amp;quot;Wow, I should clean this.&amp;quot; Of course your next reaction was: &amp;quot;I'm not touching it!&amp;quot;. Why? Because you were ''afraid'' you'd break it. How much code could be cleaned if we could conquer the fear that we'd break the code we were cleaning? If you have have a suite of tests that you trust, then you are not afraid to make changes. &amp;lt;br/&amp;gt; ''You are not afraid to make changes!'' &amp;lt;br/&amp;gt;You see a messy functions, you clean it. All the tests pass! The tests give you the courage to clean the code! &amp;lt;br/&amp;gt; Nothing make a system more flexible than a suite of tests &amp;amp;mdash; nothing. If you have a beautiful design and architecture, but have no tests, you are still afraid to change the code. But if you have a suite of high-coverage tests, then even if your design and architecture are terrible, you are not afraid to clean up the design and architecture.&lt;br /&gt;
&lt;br /&gt;
* '''Documentation''' &amp;lt;br/&amp;gt; Have you ever integrated a third party package? You get a nice manual written by a tech writer. At the back of that manual is an ugly section where all the code examples are shown. Where's the first place you go? You go to the code examples. You go to the code examples because that's where the truth is. &amp;lt;br/&amp;gt; Unit tests are just like those code examples. If you want to know how to call a method, there are tests that call that method every way it can be called. These tests are small, focused ''documents'' that describe how to use the production code. They are ''design documents'' that are written in a language that the programmers understand; are unambiguous; are so formal that they ''execute''; and cannot get out of sync with the production code.&lt;br /&gt;
&lt;br /&gt;
* '''Design''' &amp;lt;br/&amp;gt; If you follow the three laws every module will be ''testable'' by definition. And another word for ''testable'' is ''decoupled''. In order to write your tests first, you have to decouple the units you are testing from the rest of the system. There's simply no other way to do it. This means your designs are more flexible, more maintainable, and just cleaner.&lt;br /&gt;
&lt;br /&gt;
* '''Professionalism''' &amp;lt;br/&amp;gt; Given that these benefits are real, the bottom line is that it would be ''unprofessional'' not to adopt the practice that yields them.&lt;br /&gt;
&lt;br /&gt;
by [[Uncle Bob]]&lt;br /&gt;
&lt;br /&gt;
This work is licensed under a&lt;br /&gt;
[http://creativecommons.org/licenses/by/3.0/us/ Creative Commons Attribution 3] &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Back to [[97 Things Every Programmer Should Know]] home page&lt;/div&gt;</summary>
		<author><name>Unclebob</name></author>	</entry>

	</feed>