<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: The Debugger as a Design Tool</title>
	<atom:link href="http://www.threeriversinstitute.org/blog/?feed=rss2&#038;p=348" rel="self" type="application/rss+xml" />
	<link>http://www.threeriversinstitute.org/blog/?p=348</link>
	<description>Thoughts on programming</description>
	<lastBuildDate>Tue, 13 Mar 2012 19:21:11 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: KentBeck</title>
		<link>http://www.threeriversinstitute.org/blog/?p=348&#038;cpage=1#comment-1316</link>
		<dc:creator>KentBeck</dc:creator>
		<pubDate>Thu, 10 Sep 2009 22:01:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.threeriversinstitute.org/blog/?p=348#comment-1316</guid>
		<description>George,

I&#039;m afraid I don&#039;t have an example easily to hand at the moment. Sometimes fixing a bug requires just making a change to code: &quot;&lt;&quot; becomes &quot;&lt;=&quot; and the test passes. Sometimes, though, fixing a bug requires a change to the design first: I&#039;m performing this conditional in B, but I need to perform it in A before B ever gets called. In this case I divide the fix into two phases, changing the design and then fixing the bug. The debugger and in particular the stack helps me in the first phase.

I&#039;ll try to catch myself the next time I do this and write it up in detail.</description>
		<content:encoded><![CDATA[<p>George,</p>
<p>I&#8217;m afraid I don&#8217;t have an example easily to hand at the moment. Sometimes fixing a bug requires just making a change to code: &#8220;<&#8221; becomes &#8220;<=&#8221; and the test passes. Sometimes, though, fixing a bug requires a change to the design first: I&#8217;m performing this conditional in B, but I need to perform it in A before B ever gets called. In this case I divide the fix into two phases, changing the design and then fixing the bug. The debugger and in particular the stack helps me in the first phase.</p>
<p>I&#8217;ll try to catch myself the next time I do this and write it up in detail.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: George Paci</title>
		<link>http://www.threeriversinstitute.org/blog/?p=348&#038;cpage=1#comment-1314</link>
		<dc:creator>George Paci</dc:creator>
		<pubDate>Thu, 10 Sep 2009 20:36:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.threeriversinstitute.org/blog/?p=348#comment-1314</guid>
		<description>Kent wrote:

&quot;Most problems are fixed by moving logic up or down the stack.
...
solutions (most often involving moving logic up or down the stack)...&quot;

Wait, what?

Do you mean fixing bugs involves this, or that fixing the design does?  I can kind of see that moving responsibilities between two classes that call (methods on) each other corresponds to &quot;moving logic up or down the stack&quot;.

A concrete example would help me understand this point.</description>
		<content:encoded><![CDATA[<p>Kent wrote:</p>
<p>&#8220;Most problems are fixed by moving logic up or down the stack.<br />
&#8230;<br />
solutions (most often involving moving logic up or down the stack)&#8230;&#8221;</p>
<p>Wait, what?</p>
<p>Do you mean fixing bugs involves this, or that fixing the design does?  I can kind of see that moving responsibilities between two classes that call (methods on) each other corresponds to &#8220;moving logic up or down the stack&#8221;.</p>
<p>A concrete example would help me understand this point.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mark M.</title>
		<link>http://www.threeriversinstitute.org/blog/?p=348&#038;cpage=1#comment-1288</link>
		<dc:creator>Mark M.</dc:creator>
		<pubDate>Fri, 28 Aug 2009 19:09:13 +0000</pubDate>
		<guid isPermaLink="false">http://www.threeriversinstitute.org/blog/?p=348#comment-1288</guid>
		<description>Throughout my career I&#039;ve used the debugger as a tool for building code.  I come up with a basic concept of what I&#039;m going to do and I code it out taking sometimes 3 or 4 days to get something that compiles.  By that time I&#039;m pretty proud of my infrastructure and what I&#039;ve built but then the real work begins.  I have to take my lump of clay and turn it into working code.  So where do I begin?  I set a break point in the main and or every button handler or other event handler in the app and I start stepping.  I started this practice in 1993 simply because it seemed natural to me.  What I found was that my colleagues thought I was crazy and that I was unnecessarily wasting lots of time in the debugger.  After my 3 days of getting something to compile I might then spend 4, 5, 6 hours stepping through the code until my lump of clay had become my &quot;working&quot; masterpiece.  Colleagues would point to the 6 hours of time as wasted time and I would point out that I actually only spent about a half hour, maybe less, stepping through the entirety of the source code.  So what was I doing during the other 5 hours and 30 minutes?  Finding and fixing bugs!  Finding and fixing flaws in the DESIGN that only became apparent to me once I began stepping!  And the debugger took me directly to these flaws!  I didn&#039;t have to waste hours and hours tracing numerous issues upstream!  I didn&#039;t have to find the issues after release into production and not only cause myself many many hours of grief but also the end users!  How eloquent, simple, and fast!

Later on when Kent and others began writing books on XP, I was introduced to the concept of unit testing.  What I began to realize at that time was that using the debugger was great on the first pass, but when you had to deliver lots and lots of versions it became very inefficient to have to re-visit the debugger.  I then came across numerous colleagues who would tell me that I was wasting my time in the debugger that I should be writing unit tests and those unit tests would solve all of my problems.  I began writing unit tests fairly heavily on larger projects but something wasn&#039;t right if I didn&#039;t spend time in the debugger too.  I knew that it was necessary but was just too busy to worry about why.  I think the answer is that I was designing on that first pass.  I design in the debugger minimally on a first pass and often times even further along than that.  The unit tests were necessary to reduce the amount of time I would have to spend in the debugger on successive passes and as the code grew this became more important.  I might step through the debugger only in new pieces of code or rarely in older pieces.  However, the unit tests would fail and catch huge errors caused by minor changes without me having to retrace through every line of code I had ever written on the given project.  I find that use of the debugger while coding, as opposed to when debugging has saved me more time than any other tool in my skill set.  Unit testing is second.  I need all that extra time... to spend with my kids.

If there&#039;s anyone else out there whose experienced this I&#039;d love to know because I usually feel pretty alone.</description>
		<content:encoded><![CDATA[<p>Throughout my career I&#8217;ve used the debugger as a tool for building code.  I come up with a basic concept of what I&#8217;m going to do and I code it out taking sometimes 3 or 4 days to get something that compiles.  By that time I&#8217;m pretty proud of my infrastructure and what I&#8217;ve built but then the real work begins.  I have to take my lump of clay and turn it into working code.  So where do I begin?  I set a break point in the main and or every button handler or other event handler in the app and I start stepping.  I started this practice in 1993 simply because it seemed natural to me.  What I found was that my colleagues thought I was crazy and that I was unnecessarily wasting lots of time in the debugger.  After my 3 days of getting something to compile I might then spend 4, 5, 6 hours stepping through the code until my lump of clay had become my &#8220;working&#8221; masterpiece.  Colleagues would point to the 6 hours of time as wasted time and I would point out that I actually only spent about a half hour, maybe less, stepping through the entirety of the source code.  So what was I doing during the other 5 hours and 30 minutes?  Finding and fixing bugs!  Finding and fixing flaws in the DESIGN that only became apparent to me once I began stepping!  And the debugger took me directly to these flaws!  I didn&#8217;t have to waste hours and hours tracing numerous issues upstream!  I didn&#8217;t have to find the issues after release into production and not only cause myself many many hours of grief but also the end users!  How eloquent, simple, and fast!</p>
<p>Later on when Kent and others began writing books on XP, I was introduced to the concept of unit testing.  What I began to realize at that time was that using the debugger was great on the first pass, but when you had to deliver lots and lots of versions it became very inefficient to have to re-visit the debugger.  I then came across numerous colleagues who would tell me that I was wasting my time in the debugger that I should be writing unit tests and those unit tests would solve all of my problems.  I began writing unit tests fairly heavily on larger projects but something wasn&#8217;t right if I didn&#8217;t spend time in the debugger too.  I knew that it was necessary but was just too busy to worry about why.  I think the answer is that I was designing on that first pass.  I design in the debugger minimally on a first pass and often times even further along than that.  The unit tests were necessary to reduce the amount of time I would have to spend in the debugger on successive passes and as the code grew this became more important.  I might step through the debugger only in new pieces of code or rarely in older pieces.  However, the unit tests would fail and catch huge errors caused by minor changes without me having to retrace through every line of code I had ever written on the given project.  I find that use of the debugger while coding, as opposed to when debugging has saved me more time than any other tool in my skill set.  Unit testing is second.  I need all that extra time&#8230; to spend with my kids.</p>
<p>If there&#8217;s anyone else out there whose experienced this I&#8217;d love to know because I usually feel pretty alone.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mark</title>
		<link>http://www.threeriversinstitute.org/blog/?p=348&#038;cpage=1#comment-1269</link>
		<dc:creator>Mark</dc:creator>
		<pubDate>Wed, 26 Aug 2009 02:34:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.threeriversinstitute.org/blog/?p=348#comment-1269</guid>
		<description>Actually, I did some programming on a Nintendo development box, way, way back. It was a lousy system, basically assembler-only. But the good thing about it was it kept the last 64K instructions executed, including effect on register or memory.

Nowadays 64K instructions is nothing, but at the time it was like a time-machine. From the point your program crashed (or where you put your break-point) you could go way back to see how it actually got there.

I wonder if the Java VM could be tricked into doing something like that.</description>
		<content:encoded><![CDATA[<p>Actually, I did some programming on a Nintendo development box, way, way back. It was a lousy system, basically assembler-only. But the good thing about it was it kept the last 64K instructions executed, including effect on register or memory.</p>
<p>Nowadays 64K instructions is nothing, but at the time it was like a time-machine. From the point your program crashed (or where you put your break-point) you could go way back to see how it actually got there.</p>
<p>I wonder if the Java VM could be tricked into doing something like that.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: KentBeck</title>
		<link>http://www.threeriversinstitute.org/blog/?p=348&#038;cpage=1#comment-1252</link>
		<dc:creator>KentBeck</dc:creator>
		<pubDate>Fri, 21 Aug 2009 14:20:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.threeriversinstitute.org/blog/?p=348#comment-1252</guid>
		<description>A time machine would be great, especially integrated with the IDE. I&#039;d like everything &quot;not yet called&quot; to be filtered out of searches. Then be able to say things like &quot;Stop the execution when this variable gets set to this value.&quot;</description>
		<content:encoded><![CDATA[<p>A time machine would be great, especially integrated with the IDE. I&#8217;d like everything &#8220;not yet called&#8221; to be filtered out of searches. Then be able to say things like &#8220;Stop the execution when this variable gets set to this value.&#8221;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Astrobe</title>
		<link>http://www.threeriversinstitute.org/blog/?p=348&#038;cpage=1#comment-1251</link>
		<dc:creator>Astrobe</dc:creator>
		<pubDate>Fri, 21 Aug 2009 14:01:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.threeriversinstitute.org/blog/?p=348#comment-1251</guid>
		<description>You don&#039;t want a debugger, you want a time machine:
http://weblogs.mozillazine.org/roc/archives/2006/12/introducing_amb.html</description>
		<content:encoded><![CDATA[<p>You don&#8217;t want a debugger, you want a time machine:<br />
<a href="http://weblogs.mozillazine.org/roc/archives/2006/12/introducing_amb.html" rel="nofollow">http://weblogs.mozillazine.org/roc/archives/2006/12/introducing_amb.html</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Itay Maman</title>
		<link>http://www.threeriversinstitute.org/blog/?p=348&#038;cpage=1#comment-1249</link>
		<dc:creator>Itay Maman</dc:creator>
		<pubDate>Fri, 21 Aug 2009 09:05:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.threeriversinstitute.org/blog/?p=348#comment-1249</guid>
		<description>Also, I think the debugger is valuable in discovering the design of exiting/legacy code. The source code does not give you the full picture. With a debugger you can see the actual (dynamic) wiring of objects, when this wiring takes place, etc.

A few years ago I worked on extending Sun&#039;s Javac compiler. As I was working I noticed that I am using the debugger to understand the design much more often than the raw source code.</description>
		<content:encoded><![CDATA[<p>Also, I think the debugger is valuable in discovering the design of exiting/legacy code. The source code does not give you the full picture. With a debugger you can see the actual (dynamic) wiring of objects, when this wiring takes place, etc.</p>
<p>A few years ago I worked on extending Sun&#8217;s Javac compiler. As I was working I noticed that I am using the debugger to understand the design much more often than the raw source code.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Yuri</title>
		<link>http://www.threeriversinstitute.org/blog/?p=348&#038;cpage=1#comment-1248</link>
		<dc:creator>Yuri</dc:creator>
		<pubDate>Fri, 21 Aug 2009 09:03:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.threeriversinstitute.org/blog/?p=348#comment-1248</guid>
		<description>Brilliant piece of text. I would like to think of it as follows.

In the automotive industry a lot of effort is put in making cars safe and even safer. But crash tests are the proof of the behaviour of the designed safety precautions built into a car. The results of the crash test show how the components behave. Video caps and sensor data are used to analyse the movement of parts in the car.
Walking through the vid caps and sensor data will give engineers information on how to redesign or recreate parts. 

This is exactly what debugging is about in software. Replaying the scenario over and over until you &#039;see&#039; what the problem is. You then decide to redesign or refactor or just fix the bug.

Now, isn&#039;t that beautiful?</description>
		<content:encoded><![CDATA[<p>Brilliant piece of text. I would like to think of it as follows.</p>
<p>In the automotive industry a lot of effort is put in making cars safe and even safer. But crash tests are the proof of the behaviour of the designed safety precautions built into a car. The results of the crash test show how the components behave. Video caps and sensor data are used to analyse the movement of parts in the car.<br />
Walking through the vid caps and sensor data will give engineers information on how to redesign or recreate parts. </p>
<p>This is exactly what debugging is about in software. Replaying the scenario over and over until you &#8216;see&#8217; what the problem is. You then decide to redesign or refactor or just fix the bug.</p>
<p>Now, isn&#8217;t that beautiful?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alexis</title>
		<link>http://www.threeriversinstitute.org/blog/?p=348&#038;cpage=1#comment-1247</link>
		<dc:creator>Alexis</dc:creator>
		<pubDate>Fri, 21 Aug 2009 08:50:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.threeriversinstitute.org/blog/?p=348#comment-1247</guid>
		<description>I do not have a lot of experience in development yet, but the one of the &quot;issue&quot; I observed amongst my fellow junior developers is the fact that most of them doesn&#039;t really use the debugger that often and, as a consequence, are not skilled at using them (therefore creating some kind of &quot;evil loop&quot;; they use the debugger less and less and they are less and less efficient with it).

It has become for me a way to evalute the skills of a developer; how good is he at debugging? how fast is he at finding a bug using a debugger? Usually, people with good debugging skills are also quite efficient at writing &quot;good&quot; code (but maybe it is only because they&#039;re more dedicated to development).

Otherwise, it seems true for me that the use of a debugger can help in your design by giving you another point of view, rather than just looking at plain code; having an idea of what&#039;s in the context of your application at some point can help you to easily check that the code is behaving the way you want it.</description>
		<content:encoded><![CDATA[<p>I do not have a lot of experience in development yet, but the one of the &#8220;issue&#8221; I observed amongst my fellow junior developers is the fact that most of them doesn&#8217;t really use the debugger that often and, as a consequence, are not skilled at using them (therefore creating some kind of &#8220;evil loop&#8221;; they use the debugger less and less and they are less and less efficient with it).</p>
<p>It has become for me a way to evalute the skills of a developer; how good is he at debugging? how fast is he at finding a bug using a debugger? Usually, people with good debugging skills are also quite efficient at writing &#8220;good&#8221; code (but maybe it is only because they&#8217;re more dedicated to development).</p>
<p>Otherwise, it seems true for me that the use of a debugger can help in your design by giving you another point of view, rather than just looking at plain code; having an idea of what&#8217;s in the context of your application at some point can help you to easily check that the code is behaving the way you want it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: KentBeck</title>
		<link>http://www.threeriversinstitute.org/blog/?p=348&#038;cpage=1#comment-1246</link>
		<dc:creator>KentBeck</dc:creator>
		<pubDate>Fri, 21 Aug 2009 07:24:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.threeriversinstitute.org/blog/?p=348#comment-1246</guid>
		<description>In my experience, most design happens after you write the code and try it out. That&#039;s when the debugger becomes a valuable design tool.</description>
		<content:encoded><![CDATA[<p>In my experience, most design happens after you write the code and try it out. That&#8217;s when the debugger becomes a valuable design tool.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

