<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Clayton Lengel-Zigich &#187; Uncategorized</title>
	<atom:link href="http://www.claytonlz.com/category/uncategorized/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.claytonlz.com</link>
	<description>Agile Practitioner, CSP, CSPO, CSM in Phoenix, AZ</description>
	<lastBuildDate>Thu, 03 May 2012 17:29:18 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Agile Principles: Iterate. Evaluate. Repeat</title>
		<link>http://www.claytonlz.com/2011/07/iterate-evaluate-repeat/</link>
		<comments>http://www.claytonlz.com/2011/07/iterate-evaluate-repeat/#comments</comments>
		<pubDate>Tue, 05 Jul 2011 17:00:33 +0000</pubDate>
		<dc:creator>Clayton</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.claytonlz.com/?p=535</guid>
		<description><![CDATA[Welcome changing requirements, even late in development. Agile processes harness change for the customer&#8217;s competitive advantage. The first thought here is the means, the second the end. Let&#8217;s start with the second. Evaluate We want to afford the customer the ability to adapt to rapidly changing markets. Processes that restrict the customer&#8217;s ability to adjust [...]]]></description>
			<content:encoded><![CDATA[<blockquote class="wide">Welcome changing requirements, even late in development. Agile processes harness change for the customer&#8217;s competitive advantage.</blockquote>
The first thought here is the means, the second the end. Let&#8217;s start with the second.

<h3>Evaluate</h3>

<p>We want to afford the customer the ability to adapt to rapidly changing markets. Processes that restrict the customer&#8217;s ability to adjust the implementation strategy of their vision make it impossible to use change as a competitive advantage.</p>

<h3>Iterate</h3>

<p>Focus on current priorities, delivering value with a consistent cadence. As you iterate, allow for the customer to evaluate changing conditions in the marketplace.</p>

<p>Iterate. Evaluate. Repeat.</p>]]></content:encoded>
			<wfw:commentRss>http://www.claytonlz.com/2011/07/iterate-evaluate-repeat/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Do You Make This Common Debugging Mistake?</title>
		<link>http://www.claytonlz.com/2010/10/common-debugging-mistake/</link>
		<comments>http://www.claytonlz.com/2010/10/common-debugging-mistake/#comments</comments>
		<pubDate>Fri, 22 Oct 2010 17:00:04 +0000</pubDate>
		<dc:creator>Clayton</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.claytonlz.com/?p=452</guid>
		<description><![CDATA[Hi, my name is Clayton and I use ruby-debug. There, I said it. As a matter of fact, I use ruby-debug a lot, I use it too much. I&#8217;m not even solving complex problems or debugging nitty gritty internals, I&#8217;m just being lazy. Sure, ruby-debug is a really awesome tool, but we abuse the hell [...]]]></description>
			<content:encoded><![CDATA[<p>Hi, my name is Clayton and I use <code>ruby-debug</code>. There, I said it. As a matter of fact, I use <code>ruby-debug</code> a lot, I use it <em>too</em> much. I&#8217;m not even solving complex problems or debugging nitty gritty internals, I&#8217;m just being lazy. Sure, <code>ruby-debug</code> is a really awesome tool, but we abuse the hell out of it. If you&#8217;re reading this and thinking &#8220;hey, that&#8217;s what I do&#8221; then you&#8217;re making a mistake, a mistake that&#8217;s hurting your code.</p>

<h3>How Debuggers are Abused</h3>

<p>Marking breakpoints and stepping through your code, evaluating each line and variable is a pretty typical practice. There are some developers who <del>literally</del> figuratively could not live without their debugger. I suspect this is most common in languages where <span class="caps">IDE</span>s are prevalent, but lets not forget about the modify-refresh-repeat paradigm in the <span class="caps">PHP </span>world. </p>

<p>Sometimes, when I come across some unexpected result or outcome, I will immediately add my <code>debugger</code> statement and start stepping through the code line-by-line echoing variables, assignments and conditionals to the terminal trying to track down my problem. Recently, I had a colleague scoff at the idea of not having <code>ruby-debug</code> for their rails project. The idea that we <em>need</em> this tool for day-to-day development is absurd.</p>

<h3>Our One Step Program</h3>

<p>When you&#8217;re testing the logic and/or output of your code with a debugger you&#8217;re making the mistake of not writing automated tests.</p>

<p>There are few problems that are solved via the manual and time-consuming process of a debugger that cannot be solved with an automated test. If you&#8217;re confused about the output of a calculation or method, write a quick unit test for that method. When the logic of your application doesn&#8217;t appear correct based on the input, maybe an integration test is in order to evaluate the flow of your program.</p>

<p>Not only do you get rid of the debugger baggage, you gain all of the other benefits that go along with testing.</p>

<h3><span class="caps">BONUS</span>: Excuse Resolution Table</h3>

<p>If you&#8217;re getting ready to excuse your debugging behavior, check this list of resolutions first:</p>

<blockquote><p>But <em>excuse</em>, I need a debugger&#8230;</p></blockquote>

<p>Write more tests. Don&#8217;t have tests? Quit your job.</p>]]></content:encoded>
			<wfw:commentRss>http://www.claytonlz.com/2010/10/common-debugging-mistake/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using Ruby&#8217;s true in Cucumber Multiline Tables</title>
		<link>http://www.claytonlz.com/2009/06/using-rubys-true-in-cucumber-multiline-tables/</link>
		<comments>http://www.claytonlz.com/2009/06/using-rubys-true-in-cucumber-multiline-tables/#comments</comments>
		<pubDate>Sat, 06 Jun 2009 04:02:39 +0000</pubDate>
		<dc:creator>Clayton</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.claytonlz.com/?p=266</guid>
		<description><![CDATA[Last week my pair and I ran into a problem with a failing Cucumber scenario. We were using one of the more awesome features of Cucumber, multiline tables, when we got the unexpected failure. We realized that what we were doing was probably a common pattern and would certain trip other's up.]]></description>
			<content:encoded><![CDATA[<p>Last week my pair and I ran into a problem with a failing Cucumber scenario. We were using one of the more awesome features of Cucumber, multiline tables, when we got the unexpected failure. We realized that what we were doing was probably a common pattern and would certain trip other&#8217;s up.</p>

<h3>Scenario and Step</h3>

<p>If you&#8217;re not familiar with multiline tables in cucumber, take a look at the <a href="http://wiki.github.com/aslakhellesoy/cucumber/multiline-step-arguments">wiki entry</a>.  We were specifying a list of attributes on one of our models that we wanted to have access to in our step. First, here is an example scenario outline.</p>


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code"><pre class="ruby" style="font-family:monospace;">Scenario: Finding a specific dog
  Given an existing microchipped dog named <span style="color:#996600;">&quot;George&quot;</span>
  <span style="color:#9966CC; font-weight:bold;">When</span> I search <span style="color:#9966CC; font-weight:bold;">for</span> a dog with the following attributes:
    <span style="color:#006600; font-weight:bold;">|</span> name   <span style="color:#006600; font-weight:bold;">|</span> microchipped <span style="color:#006600; font-weight:bold;">|</span>
    <span style="color:#006600; font-weight:bold;">|</span> George <span style="color:#006600; font-weight:bold;">|</span> <span style="color:#0000FF; font-weight:bold;">true</span>         <span style="color:#006600; font-weight:bold;">|</span>
  <span style="color:#9966CC; font-weight:bold;">Then</span> I find <span style="color:#996600;">&quot;1&quot;</span> dog
  <span style="color:#9966CC; font-weight:bold;">And</span> that dog should be named <span style="color:#996600;">&quot;George&quot;</span></pre></td></tr></table></div>




<p>Our step was taking the multiline table attributes and using them in an ActiveRecord find, like this.</p>


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#006600; font-weight:bold;">/</span>^I search <span style="color:#9966CC; font-weight:bold;">for</span> a dog with the following attributes:$<span style="color:#006600; font-weight:bold;">/</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>table<span style="color:#006600; font-weight:bold;">|</span>
  table.<span style="color:#9900CC;">hashes</span>.<span style="color:#9900CC;">each</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>attributes<span style="color:#006600; font-weight:bold;">|</span>
    <span style="color:#0066ff; font-weight:bold;">@dog</span> = Dog.<span style="color:#9900CC;">find</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:first</span>, <span style="color:#ff3333; font-weight:bold;">:conditions</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> attributes<span style="color:#006600; font-weight:bold;">&#41;</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></td></tr></table></div>




<p>In our example we are looking for two attributes a string called &#8220;name&#8221; and a boolean called &#8220;microchipped&#8221;. However, this find will always fail, even if your &#8216;Given an existing microchipped dog named &#8220;George&#8221;&#8216; step explicitly sets up the correct object in the beginning of the test.</p>

<h3>The Fix</h3>

<p>We found that if we changed our scenario to look like this, everything worked fine.</p>


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code"><pre class="ruby" style="font-family:monospace;">Scenario: Finding a specific dog
  Given an existing microchipped dog named <span style="color:#996600;">&quot;George&quot;</span>
  <span style="color:#9966CC; font-weight:bold;">When</span> I search <span style="color:#9966CC; font-weight:bold;">for</span> a dog with the following attributes:
    <span style="color:#006600; font-weight:bold;">|</span> name   <span style="color:#006600; font-weight:bold;">|</span> microchipped <span style="color:#006600; font-weight:bold;">|</span>
    <span style="color:#006600; font-weight:bold;">|</span> George <span style="color:#006600; font-weight:bold;">|</span> <span style="color:#006666;">1</span>            <span style="color:#006600; font-weight:bold;">|</span>
  <span style="color:#9966CC; font-weight:bold;">Then</span> I find <span style="color:#996600;">&quot;1&quot;</span> dog
  <span style="color:#9966CC; font-weight:bold;">And</span> that dog should be named <span style="color:#996600;">&quot;George&quot;</span></pre></td></tr></table></div>




<p>See the change? We changed &#8220;true&#8221; for microchipped to &#8220;1&#8243;. Typically when you&#8217;re working with rails you can pass <tt>true</tt> in the conditions of an ActiveRecord find and Rails will convert that to the correct <span class="caps">SQL </span>string for you. However, because cucumber passes each argument in the multiline table rows as strings, Rails never has the chance to covert that <tt>true</tt> for you.</p>

<p>In the first, failing, example you end up with something like this for your <span class="caps">SQL</span>:</p>


<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">SELECT</span> <span style="color: #66cc66;">*</span> <span style="color: #993333; font-weight: bold;">FROM</span> dogs <span style="color: #993333; font-weight: bold;">WHERE</span> name <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">&quot;George&quot;</span> <span style="color: #993333; font-weight: bold;">AND</span> microchipped <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">&quot;true&quot;</span> <span style="color: #993333; font-weight: bold;">LIMIT</span> <span style="color: #cc66cc;">1</span>;</pre></div></div>




<p>In the second, passing, example you end up with something like this:</p>


<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">SELECT</span> <span style="color: #66cc66;">*</span> <span style="color: #993333; font-weight: bold;">FROM</span> dogs <span style="color: #993333; font-weight: bold;">WHERE</span> name <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">&quot;George&quot;</span> <span style="color: #993333; font-weight: bold;">AND</span> microchipped <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">&quot;1&quot;</span> <span style="color: #993333; font-weight: bold;">LIMIT</span> <span style="color: #cc66cc;">1</span>;</pre></div></div>
]]></content:encoded>
			<wfw:commentRss>http://www.claytonlz.com/2009/06/using-rubys-true-in-cucumber-multiline-tables/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

