<?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>Jeff Carouth&#039;s blog</title>
	<atom:link href="http://carouth.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://carouth.com</link>
	<description>Ramblings of a Web Application Developer</description>
	<lastBuildDate>Sat, 06 Feb 2010 21:36:18 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Professional Development with the Zend Framework: Unit Testing</title>
		<link>http://carouth.com/2010/02/05/prodevzf-unittesting/</link>
		<comments>http://carouth.com/2010/02/05/prodevzf-unittesting/#comments</comments>
		<pubDate>Fri, 05 Feb 2010 14:00:09 +0000</pubDate>
		<dc:creator>jcarouth</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://carouth.com/?p=109</guid>
		<description><![CDATA[I started this serious with a very specific goal in mind. I wanted to highlight some of the qualities I find most useful and most important within the context of the Zend Framework code as a way to show developers how to look at other projects and build upon their own professionalism. One of the [...]]]></description>
			<content:encoded><![CDATA[<div class='series_toc'><h3>Table of contents for Professional PHP Development</h3><ol><li><a href='http://carouth.com/2009/09/09/prodevzf-introduction/' title='Professional Development with the Zend Framework: Introduction'>Professional Development with the Zend Framework: Introduction</a></li><li>Professional Development with the Zend Framework: Unit Testing</li></ol></div> <p>I started this serious with a very specific goal in mind. I wanted to highlight some of the qualities I find most useful and most important within the context of the Zend Framework code as a way to show developers how to look at other projects and build upon their own professionalism. One of the most important facets—in my opinion of course—of the framework's code base is something that is often overlooked: the comprehensive test suite.</p>
<p>Testing is most often regarded as a liability by managers because it does not provide any measurable value to a product in the eyes of anyone excepting developers. But the value is definitely measurable and quite obvious if one would take the time to observe project development through the maintenance phase and, quite possibly even more importantly, in multi-developer environments.</p>
<h1>The Zend Framework Test Suite</h1>
<p>In the coming sub-sections we will look at the aspects of the framework's test suite that I find most influential to its success.</p>
<h2>Organization</h2>
<p>The first thing to notice about the tests directory for the framework is the slim profile. These few files and directories are a testament to the organizational aspect of the suite. This is important because tests that are difficult to find or inappropriately named will not be maintained.</p>
<p>It is completely possible to not use the AllTests method for suite organization which in smaller projects might seem like a burden. But the use of these groupings allows different subsets of tests to be run for a given component with consistent state and configuration.</p>
<h2>Configuration</h2>
<p>Since there are developers working on various components, features, and bugs throughout the world it is essential that each be able to have a consistent environment in which to test. This test suite uses a configuration file, TestConfiguration.php, and a helper file, TestHelper.php, to configure the environment through PHP constants and set up include paths, etc., respectively.</p>
<p>Tests that can only be run on a specific machine are almost as useless as no tests at all.</p>
<h2>Verbose Case Naming</h2>
<p>Looking at an individual test file you will notice that the cases, or methods, are named to signify exactly what the test will assert. This is incredibly helpful when staring at code after a while. Using an IDE's outline functionality it is simple to find the test that verifies that a useful message is thrown if a class is not found by the factory because it is contained with the testStaticFactoryClassNotFound() method.</p>
<h2>Use of Grouping Comments</h2>
<p>PHPUnit uses comments to accomplish some meta-data and grouping functionality. Throughout  the test suite you will run across individual test methods that have a @group annotation which, most of the time, references an issue in the issue tracker. For example a comment might look as follows for a test case that reproduces the issue ZF-2724.</p>
<p><code>/**<br />
* Handle file not found errors<br />
*<br />
* @group  ZF-2724<br />
* @param  int $errnum<br />
* @param  string $errstr<br />
* @return void<br />
*/<br />
</code></p>
<p>This is another way to run specific tests. Using the command-line test runner's <em>--group </em>switch you can specify the group of tests to run as follows.</p>
<pre>phpunit --group ZF-2724 .</pre>
<p>Which tests to run and which to skip can also be configured using the phpunit.xml configuration file.</p>
<h2>Testing For Backwards Compitability</h2>
<p>One of the Zend Framework project's goals is to ensure that no BC breaks occur except in major releases — this should be a common goal for all projects, but that's just my opinion. Throughout the test code you will find cases that both document and expect that the "old way" and the "new and improved way" of accomplishing something are tested.</p>
<p>This is an area often overlooked during major improvement cycles. I know I am guilty of changing something significant or deprecating a method, etc., and then updating my client code to use the new API but leaving other team members out in the cold. I didn't do it purposely, it was just a novice mistake.</p>
<p>The concept to take away is to not delete or rewrite a test case because you add a new API method (unless it's supposed to be a BC break, then by all means). Instead, write a new case to test the improved method while still maintaining the functionality of the older method. You will make the developers that use your code happy.</p>
<p>These are just a few of the many excellent qualities of the Zend Framework test code. I encourage you to share something you found and admire.</p>
<div class="acc_license"><a href="http://creativecommons.org/licenses/by/3.0/"><img src="http://i.creativecommons.org/l/by/3.0/88x31.png" alt="by" /></a></div><!--<rdf:RDF xmlns="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><Work rdf:about=""><license rdf:resource="http://creativecommons.org/licenses/by/3.0/" /></Work><License rdf:about="http://creativecommons.org/licenses/by/3.0/"><requires rdf:resource="http://creativecommons.org/ns#Attribution" /><permits rdf:resource="http://creativecommons.org/ns#Reproduction" /><permits rdf:resource="http://creativecommons.org/ns#Distribution" /><permits rdf:resource="http://creativecommons.org/ns#DerivativeWorks" /><requires rdf:resource="http://creativecommons.org/ns#Notice" /></License></rdf:RDF>-->


Share:


	<a rel="nofollow"  target="_blank" href="http://www.printfriendly.com/print?url=http%3A%2F%2Fcarouth.com%2F2010%2F02%2F05%2Fprodevzf-unittesting%2F&amp;partner=sociable" title="Print"><img src="http://carouth.com/wp-content/plugins/sociable/images/printfriendly.png" title="Print" alt="Print" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fcarouth.com%2F2010%2F02%2F05%2Fprodevzf-unittesting%2F&amp;title=Professional%20Development%20with%20the%20Zend%20Framework%3A%20Unit%20Testing&amp;bodytext=I%20started%20this%20serious%20with%20a%20very%20specific%20goal%20in%20mind.%20I%20wanted%20to%20highlight%20some%20of%20the%20qualities%20I%20find%20most%20useful%20and%20most%20important%20within%20the%20context%20of%20the%20Zend%20Framework%20code%20as%20a%20way%20to%20show%20developers%20how%20to%20look%20at%20other%20projects%20and%20bu" title="Digg"><img src="http://carouth.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fcarouth.com%2F2010%2F02%2F05%2Fprodevzf-unittesting%2F&amp;title=Professional%20Development%20with%20the%20Zend%20Framework%3A%20Unit%20Testing&amp;notes=I%20started%20this%20serious%20with%20a%20very%20specific%20goal%20in%20mind.%20I%20wanted%20to%20highlight%20some%20of%20the%20qualities%20I%20find%20most%20useful%20and%20most%20important%20within%20the%20context%20of%20the%20Zend%20Framework%20code%20as%20a%20way%20to%20show%20developers%20how%20to%20look%20at%20other%20projects%20and%20bu" title="del.icio.us"><img src="http://carouth.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fcarouth.com%2F2010%2F02%2F05%2Fprodevzf-unittesting%2F&amp;t=Professional%20Development%20with%20the%20Zend%20Framework%3A%20Unit%20Testing" title="Facebook"><img src="http://carouth.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fcarouth.com%2F2010%2F02%2F05%2Fprodevzf-unittesting%2F&amp;title=Professional%20Development%20with%20the%20Zend%20Framework%3A%20Unit%20Testing&amp;annotation=I%20started%20this%20serious%20with%20a%20very%20specific%20goal%20in%20mind.%20I%20wanted%20to%20highlight%20some%20of%20the%20qualities%20I%20find%20most%20useful%20and%20most%20important%20within%20the%20context%20of%20the%20Zend%20Framework%20code%20as%20a%20way%20to%20show%20developers%20how%20to%20look%20at%20other%20projects%20and%20bu" title="Google Bookmarks"><img src="http://carouth.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://reddit.com/submit?url=http%3A%2F%2Fcarouth.com%2F2010%2F02%2F05%2Fprodevzf-unittesting%2F&amp;title=Professional%20Development%20with%20the%20Zend%20Framework%3A%20Unit%20Testing" title="Reddit"><img src="http://carouth.com/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fcarouth.com%2F2010%2F02%2F05%2Fprodevzf-unittesting%2F&amp;title=Professional%20Development%20with%20the%20Zend%20Framework%3A%20Unit%20Testing" title="StumbleUpon"><img src="http://carouth.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://twitter.com/home?status=Professional%20Development%20with%20the%20Zend%20Framework%3A%20Unit%20Testing%20-%20http%3A%2F%2Fcarouth.com%2F2010%2F02%2F05%2Fprodevzf-unittesting%2F" title="Twitter"><img src="http://carouth.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a>


<br/><br/> <div class='series_links'><a href='http://carouth.com/2009/09/09/prodevzf-introduction/' title='Professional Development with the Zend Framework: Introduction'>Previous in series</a> </div>]]></content:encoded>
			<wfw:commentRss>http://carouth.com/2010/02/05/prodevzf-unittesting/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Development Mise en Place</title>
		<link>http://carouth.com/2010/01/25/development-mise-en-place/</link>
		<comments>http://carouth.com/2010/01/25/development-mise-en-place/#comments</comments>
		<pubDate>Mon, 25 Jan 2010 14:00:10 +0000</pubDate>
		<dc:creator>jcarouth</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://carouth.com/?p=160</guid>
		<description><![CDATA[Culinary artists have a French phrase "mise en place" — literally, putting in place — that teaches a cook to have his or her workstation ready in terms of ingredients and equipment. As a developer applying the mise en place concept to project developer simply makes sense.
Mise en Place is not Big Design Up Front
When [...]]]></description>
			<content:encoded><![CDATA[<p>Culinary artists have a French phrase "mise en place" — literally, putting in place — that teaches a cook to have his or her workstation ready in terms of ingredients and equipment. As a developer applying the mise en place concept to project developer simply makes sense.</p>
<h1>Mise en Place is not Big Design Up Front</h1>
<p>When thinking about this concept my first reaction was that it sounds a lot like a methodology we are trying to forget. The idea is not to get absolutely everything ready for the entire project at once, rather it is to prepare the tools, the functional requirements, the goals, etc. for an individual component before starting actual work.</p>
<p>A meal is composed of several "dishes" if you will. Normally you have a protein source, a vegetable, a salad, and maybe some bread. Each of these is a component of the overall meal and each can be prepared by a different cook. Now, I won't bore you with the names of each of the types of cooks — besides that is a great use for Wikipedia — but as developers we sometimes have the luxury of separating components and giving them to different team members or even to different teams.</p>
<h2>Preparing Your Workstation</h2>
<p>I don't mean your literal desk or even  your computer. I mean getting your project or component in order. The first part of mise en place involves building the tools used for your project. For example, getting the build system in order, or creating the test suite directories and bootstrap files. You have a better idea of the tasks that must be accomplished, but doing them all before you even start actually coding will benefit you in the long run.</p>
<p>After you get your high-level tools built and your environments configured you can start by gathering all the specifications for your portion of the component or project. This might be user stories, interface mock-ups, et cetera. Once you have the requirements you can create any tests, tools, or other components you need until you feel you are truly prepared to build the functional project code.</p>
<p>I like to break my work into small tasks. As such, I prepare my mise en place only for an individual unit of work by creating issues, bug reports, or feature requests in the issue tracker, writing the unit tests I hope to be able to pass as part of my development mise en place — which is why I employ TDD frequently, and generating some sample documentation for the individual component. Once I'm done with my work I'll go back and modify the documentation if something happened to change along the way. In this way, my documentation is as up-to-date as can be expected.</p>
<p>How do you practice the concept of Mise en Place?</p>
<div class="acc_license"><a href="http://creativecommons.org/licenses/by/3.0/"><img src="http://i.creativecommons.org/l/by/3.0/88x31.png" alt="by" /></a></div><!--<rdf:RDF xmlns="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><Work rdf:about=""><license rdf:resource="http://creativecommons.org/licenses/by/3.0/" /></Work><License rdf:about="http://creativecommons.org/licenses/by/3.0/"><requires rdf:resource="http://creativecommons.org/ns#Attribution" /><permits rdf:resource="http://creativecommons.org/ns#Reproduction" /><permits rdf:resource="http://creativecommons.org/ns#Distribution" /><permits rdf:resource="http://creativecommons.org/ns#DerivativeWorks" /><requires rdf:resource="http://creativecommons.org/ns#Notice" /></License></rdf:RDF>-->


Share:


	<a rel="nofollow"  target="_blank" href="http://www.printfriendly.com/print?url=http%3A%2F%2Fcarouth.com%2F2010%2F01%2F25%2Fdevelopment-mise-en-place%2F&amp;partner=sociable" title="Print"><img src="http://carouth.com/wp-content/plugins/sociable/images/printfriendly.png" title="Print" alt="Print" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fcarouth.com%2F2010%2F01%2F25%2Fdevelopment-mise-en-place%2F&amp;title=Development%20Mise%20en%20Place&amp;bodytext=Culinary%20artists%20have%20a%20French%20phrase%20%22mise%20en%20place%22%20%E2%80%94%20literally%2C%20putting%20in%20place%20%E2%80%94%20that%20teaches%20a%20cook%20to%20have%20his%20or%20her%20workstation%20ready%20in%20terms%20of%20ingredients%20and%20equipment.%20As%20a%20developer%20applying%20the%20mise%20en%20place%20concept%20to%20project%20dev" title="Digg"><img src="http://carouth.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fcarouth.com%2F2010%2F01%2F25%2Fdevelopment-mise-en-place%2F&amp;title=Development%20Mise%20en%20Place&amp;notes=Culinary%20artists%20have%20a%20French%20phrase%20%22mise%20en%20place%22%20%E2%80%94%20literally%2C%20putting%20in%20place%20%E2%80%94%20that%20teaches%20a%20cook%20to%20have%20his%20or%20her%20workstation%20ready%20in%20terms%20of%20ingredients%20and%20equipment.%20As%20a%20developer%20applying%20the%20mise%20en%20place%20concept%20to%20project%20dev" title="del.icio.us"><img src="http://carouth.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fcarouth.com%2F2010%2F01%2F25%2Fdevelopment-mise-en-place%2F&amp;t=Development%20Mise%20en%20Place" title="Facebook"><img src="http://carouth.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fcarouth.com%2F2010%2F01%2F25%2Fdevelopment-mise-en-place%2F&amp;title=Development%20Mise%20en%20Place&amp;annotation=Culinary%20artists%20have%20a%20French%20phrase%20%22mise%20en%20place%22%20%E2%80%94%20literally%2C%20putting%20in%20place%20%E2%80%94%20that%20teaches%20a%20cook%20to%20have%20his%20or%20her%20workstation%20ready%20in%20terms%20of%20ingredients%20and%20equipment.%20As%20a%20developer%20applying%20the%20mise%20en%20place%20concept%20to%20project%20dev" title="Google Bookmarks"><img src="http://carouth.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://reddit.com/submit?url=http%3A%2F%2Fcarouth.com%2F2010%2F01%2F25%2Fdevelopment-mise-en-place%2F&amp;title=Development%20Mise%20en%20Place" title="Reddit"><img src="http://carouth.com/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fcarouth.com%2F2010%2F01%2F25%2Fdevelopment-mise-en-place%2F&amp;title=Development%20Mise%20en%20Place" title="StumbleUpon"><img src="http://carouth.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://twitter.com/home?status=Development%20Mise%20en%20Place%20-%20http%3A%2F%2Fcarouth.com%2F2010%2F01%2F25%2Fdevelopment-mise-en-place%2F" title="Twitter"><img src="http://carouth.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a>


<br/><br/>]]></content:encoded>
			<wfw:commentRss>http://carouth.com/2010/01/25/development-mise-en-place/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Coding to an Interface</title>
		<link>http://carouth.com/2010/01/13/coding-to-an-interface/</link>
		<comments>http://carouth.com/2010/01/13/coding-to-an-interface/#comments</comments>
		<pubDate>Wed, 13 Jan 2010 18:05:18 +0000</pubDate>
		<dc:creator>jcarouth</dc:creator>
				<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Best Practice]]></category>
		<category><![CDATA[Design by Contract]]></category>

		<guid isPermaLink="false">http://carouth.com/?p=153</guid>
		<description><![CDATA[In a recent user group presentation the topic of using interfaces to enforce coding standards, ensure component compatibility, etc. was touched upon. The inevitable discussion about the definition of coding to an interface commenced.
The Literal Definition
Most people when first introduced to the concept of coding to an interface or even "design by contract" type concepts [...]]]></description>
			<content:encoded><![CDATA[<p>In a recent user group presentation the topic of using interfaces to enforce coding standards, ensure component compatibility, etc. was touched upon. The inevitable discussion about the definition of coding to an interface commenced.</p>
<h2>The Literal Definition</h2>
<p>Most people when first introduced to the concept of coding to an interface or even "design by contract" type concepts take the literal definition. At this basic level the technique means to use your programming languages OOP interface to define the behavior of the objects you will be using and accept objects that implement that interface where necessary, as illustrated in the following listing.</p>
<pre class="brush: php;">interface Deleteable
{
    //some methods
}

class Book implements Deleteable
{
    //implementation
}

class BookDataSource
{
    public function delete(Deleteable $book)
    {
        $this-&amp;gt;purge($book);
    }
}</pre>
<p>With this arrangement any methods that are necessary to prepare an object for deletion will be implemented in the Book class and the data source will only allow objects that implement the Deleteable interface to be purged from existence.</p>
<p>This technique is employed to allow better unit testing, for polymorphism, to ensure that objects have certain behavior, and a variety of other reasons. Coding to the contract provided by the interface is a great practice.</p>
<h2>An Expanded Definition</h2>
<p>While the literal definition above is definitely accurate and valuable, the interface extends into other areas. In modern software projects there are a variety of resourced one can call upon to learn about the behavior and properties of software components. Each of these resources is a part of the contract and useful as an interface to which developers should code.</p>
<h3>Documentation</h3>
<p>The most obvious resource for defining behavior and properties is documentation. Whether this is some sort of specification document in a wiki, in a binder, on notecards, on napkins, etc., or code comments documentation is a useful interface as long as it is maintained. Maintenance is the pitfall of using documentation as a contract because it is so often and so easily neglected.</p>
<p>Because documentation is most likely out of date — hey, I code in the real world — it is my last choice for an interface-defining resource. However it's better than having nothing.</p>
<h3>Unit Tests</h3>
<p>Thinking about it, unit tests are the ultimate supplemental contract for code. They will immediately notify the developer if the terms of the contract (the assertions) are broken. They also provide usage documentation that will help integration efforts.</p>
<h2>In Your Code</h2>
<p>The message I hope to get across with this post is that the concept of design by contract or coding to an interface is broader than the literal implications. Using supplemental contracts for your projects will make your projects better if only for that day in the future when you wonder why you made the decision you did.</p>
<div class="acc_license"><a href="http://creativecommons.org/licenses/by/3.0/"><img src="http://i.creativecommons.org/l/by/3.0/88x31.png" alt="by" /></a></div><!--<rdf:RDF xmlns="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><Work rdf:about=""><license rdf:resource="http://creativecommons.org/licenses/by/3.0/" /></Work><License rdf:about="http://creativecommons.org/licenses/by/3.0/"><requires rdf:resource="http://creativecommons.org/ns#Attribution" /><permits rdf:resource="http://creativecommons.org/ns#Reproduction" /><permits rdf:resource="http://creativecommons.org/ns#Distribution" /><permits rdf:resource="http://creativecommons.org/ns#DerivativeWorks" /><requires rdf:resource="http://creativecommons.org/ns#Notice" /></License></rdf:RDF>-->


Share:


	<a rel="nofollow"  target="_blank" href="http://www.printfriendly.com/print?url=http%3A%2F%2Fcarouth.com%2F2010%2F01%2F13%2Fcoding-to-an-interface%2F&amp;partner=sociable" title="Print"><img src="http://carouth.com/wp-content/plugins/sociable/images/printfriendly.png" title="Print" alt="Print" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fcarouth.com%2F2010%2F01%2F13%2Fcoding-to-an-interface%2F&amp;title=Coding%20to%20an%20Interface&amp;bodytext=In%20a%20recent%20user%20group%20presentation%20the%20topic%20of%20using%20interfaces%20to%20enforce%20coding%20standards%2C%20ensure%20component%20compatibility%2C%20etc.%20was%20touched%20upon.%20The%20inevitable%20discussion%20about%20the%20definition%20of%20coding%20to%20an%20interface%20commenced.%0D%0AThe%20Literal%20Def" title="Digg"><img src="http://carouth.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fcarouth.com%2F2010%2F01%2F13%2Fcoding-to-an-interface%2F&amp;title=Coding%20to%20an%20Interface&amp;notes=In%20a%20recent%20user%20group%20presentation%20the%20topic%20of%20using%20interfaces%20to%20enforce%20coding%20standards%2C%20ensure%20component%20compatibility%2C%20etc.%20was%20touched%20upon.%20The%20inevitable%20discussion%20about%20the%20definition%20of%20coding%20to%20an%20interface%20commenced.%0D%0AThe%20Literal%20Def" title="del.icio.us"><img src="http://carouth.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fcarouth.com%2F2010%2F01%2F13%2Fcoding-to-an-interface%2F&amp;t=Coding%20to%20an%20Interface" title="Facebook"><img src="http://carouth.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fcarouth.com%2F2010%2F01%2F13%2Fcoding-to-an-interface%2F&amp;title=Coding%20to%20an%20Interface&amp;annotation=In%20a%20recent%20user%20group%20presentation%20the%20topic%20of%20using%20interfaces%20to%20enforce%20coding%20standards%2C%20ensure%20component%20compatibility%2C%20etc.%20was%20touched%20upon.%20The%20inevitable%20discussion%20about%20the%20definition%20of%20coding%20to%20an%20interface%20commenced.%0D%0AThe%20Literal%20Def" title="Google Bookmarks"><img src="http://carouth.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://reddit.com/submit?url=http%3A%2F%2Fcarouth.com%2F2010%2F01%2F13%2Fcoding-to-an-interface%2F&amp;title=Coding%20to%20an%20Interface" title="Reddit"><img src="http://carouth.com/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fcarouth.com%2F2010%2F01%2F13%2Fcoding-to-an-interface%2F&amp;title=Coding%20to%20an%20Interface" title="StumbleUpon"><img src="http://carouth.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://twitter.com/home?status=Coding%20to%20an%20Interface%20-%20http%3A%2F%2Fcarouth.com%2F2010%2F01%2F13%2Fcoding-to-an-interface%2F" title="Twitter"><img src="http://carouth.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a>


<br/><br/>]]></content:encoded>
			<wfw:commentRss>http://carouth.com/2010/01/13/coding-to-an-interface/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Working Outside Your Comfort Zone</title>
		<link>http://carouth.com/2010/01/08/working-outside-your-comfort-zone/</link>
		<comments>http://carouth.com/2010/01/08/working-outside-your-comfort-zone/#comments</comments>
		<pubDate>Fri, 08 Jan 2010 21:53:05 +0000</pubDate>
		<dc:creator>jcarouth</dc:creator>
				<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Improvement]]></category>

		<guid isPermaLink="false">http://carouth.com/?p=150</guid>
		<description><![CDATA[No, I'm not going to inundate you with quotes of famous and not-so-famous people about how stepping out of your comfort zone will revolutionize your life. Instead, I'd like to simply encourage you to step out of your box every once in a while if for no other reason than the potential to learn something.
What [...]]]></description>
			<content:encoded><![CDATA[<p>No, I'm not going to inundate you with quotes of famous and not-so-famous people about how stepping out of your comfort zone will revolutionize your life. Instead, I'd like to simply encourage you to step out of your box every once in a while if for no other reason than the potential to learn something.</p>
<h2>What is My Comfort Zone?</h2>
<p>The absolute first step in this technique for improvement is to figure out where you comfort zone is. For a lot of the people the knee-jerk answer is in whatever language they are currently using. This is not a bad answer but it will most likely lead to a shallow experience. For example, my obvious comfort zone is in PHP development. To step outside my comfort zone, then, I'd merely need to read through someone else's project written in Python or even Ruby and then pat myself on the back for each concept or technique I can extract from such projects. However, doing so doesn't really answer the question what is my comfort zone and doesn't force me to get outside of it.</p>
<p>My real comfort zone could be working with a relational database or even using scripting languages. I could easily follow the noSQL revolution for a sample project or work on a project written in, e.g., .NET using C#. These technologies are so different from my normal tools that I'd be forced to think about problems and solutions in a different light.</p>
<h2>Different Technologies, Different Approaches</h2>
<p>Working with differing technologies is not guaranteed to help at all. In fact the experience can be extremely frustrating because you will come across innovative solutions that simply won't be possible in your "home" environment because of language or technology barriers. This is natural and should be expected. If this weren't the case we wouldn't have such a deep pool of languages to chose from.</p>
<p>Instead of focusing on the negative, keep digging into the project. Given enough time you should be able to find a few concepts from the new environment that you can either adopt or at least adapt into projects in your preferred languages and tools. In my case I inherited a few projects that are written in .NET. Instead of immediately grumbling about how awful it is to work in that environment, I've embraced it and gone on some bug hunting/fixing expeditions through the code. As a result I've learned quite a bit about how another developer uses a different technology to accomplish some of the same tasks.</p>
<h2>Read Other Developers' Code</h2>
<p>This leads me to the final benefit of stepping out of your personal playground: you get to read other developer's code. I don't remember where but I recently read a comment in which the author stated that it's silly for a developer to assume he or she can continue to expand his or her knowledge without reading peer code. He or she went on to say that this is like a person deciding to become an author without ever reading other works.</p>
<p>At first I resisted the notion that an author must read other's work before becoming a talented author. After all, it's quite possible that a person can be naturally gifted. However, the underlying meaning became apparent. We all must learn ways that work and some ways that do not. Without seeing a variety of approaches there will be no growth. This does not mean that you must immediately adopt what you read. You should look for similarities to your own work as much as you find differences.</p>
<h2>A Real-life Example</h2>
<p>Like a lot of other web developers I've always held contempt for JavaScript. It's a language that was once far outside my comfort zone. However, the Dojo framework came along and converted me. Using and reading through the code led me to appreciate all the nuances I once despised about the JavaScript language. I listened to talks on the language's history, I learned some of the advanced techniques and concepts presented by <a href="http://www.crockford.com/">Douglas Crockford</a>, <a href="http://ejohn.org/">John Resig</a>, et cetera, and then I read the specs for upcoming versions of PHP. I had unknowingly adopted some of the functional programming techniques and concepts prevalent in JavaScript and now I could apply them to my PHP projects.</p>
<p>Stepping out of my comfort zone was one of the most influential decisions I've made. I hope you will take some time to do the same.</p>
<div class="acc_license"><a href="http://creativecommons.org/licenses/by/3.0/"><img src="http://i.creativecommons.org/l/by/3.0/88x31.png" alt="by" /></a></div><!--<rdf:RDF xmlns="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><Work rdf:about=""><license rdf:resource="http://creativecommons.org/licenses/by/3.0/" /></Work><License rdf:about="http://creativecommons.org/licenses/by/3.0/"><requires rdf:resource="http://creativecommons.org/ns#Attribution" /><permits rdf:resource="http://creativecommons.org/ns#Reproduction" /><permits rdf:resource="http://creativecommons.org/ns#Distribution" /><permits rdf:resource="http://creativecommons.org/ns#DerivativeWorks" /><requires rdf:resource="http://creativecommons.org/ns#Notice" /></License></rdf:RDF>-->


Share:


	<a rel="nofollow"  target="_blank" href="http://www.printfriendly.com/print?url=http%3A%2F%2Fcarouth.com%2F2010%2F01%2F08%2Fworking-outside-your-comfort-zone%2F&amp;partner=sociable" title="Print"><img src="http://carouth.com/wp-content/plugins/sociable/images/printfriendly.png" title="Print" alt="Print" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fcarouth.com%2F2010%2F01%2F08%2Fworking-outside-your-comfort-zone%2F&amp;title=Working%20Outside%20Your%20Comfort%20Zone&amp;bodytext=No%2C%20I%27m%20not%20going%20to%20inundate%20you%20with%20quotes%20of%20famous%20and%20not-so-famous%20people%20about%20how%20stepping%20out%20of%20your%20comfort%20zone%20will%20revolutionize%20your%20life.%20Instead%2C%20I%27d%20like%20to%20simply%20encourage%20you%20to%20step%20out%20of%20your%20box%20every%20once%20in%20a%20while%20if%20for%20" title="Digg"><img src="http://carouth.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fcarouth.com%2F2010%2F01%2F08%2Fworking-outside-your-comfort-zone%2F&amp;title=Working%20Outside%20Your%20Comfort%20Zone&amp;notes=No%2C%20I%27m%20not%20going%20to%20inundate%20you%20with%20quotes%20of%20famous%20and%20not-so-famous%20people%20about%20how%20stepping%20out%20of%20your%20comfort%20zone%20will%20revolutionize%20your%20life.%20Instead%2C%20I%27d%20like%20to%20simply%20encourage%20you%20to%20step%20out%20of%20your%20box%20every%20once%20in%20a%20while%20if%20for%20" title="del.icio.us"><img src="http://carouth.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fcarouth.com%2F2010%2F01%2F08%2Fworking-outside-your-comfort-zone%2F&amp;t=Working%20Outside%20Your%20Comfort%20Zone" title="Facebook"><img src="http://carouth.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fcarouth.com%2F2010%2F01%2F08%2Fworking-outside-your-comfort-zone%2F&amp;title=Working%20Outside%20Your%20Comfort%20Zone&amp;annotation=No%2C%20I%27m%20not%20going%20to%20inundate%20you%20with%20quotes%20of%20famous%20and%20not-so-famous%20people%20about%20how%20stepping%20out%20of%20your%20comfort%20zone%20will%20revolutionize%20your%20life.%20Instead%2C%20I%27d%20like%20to%20simply%20encourage%20you%20to%20step%20out%20of%20your%20box%20every%20once%20in%20a%20while%20if%20for%20" title="Google Bookmarks"><img src="http://carouth.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://reddit.com/submit?url=http%3A%2F%2Fcarouth.com%2F2010%2F01%2F08%2Fworking-outside-your-comfort-zone%2F&amp;title=Working%20Outside%20Your%20Comfort%20Zone" title="Reddit"><img src="http://carouth.com/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fcarouth.com%2F2010%2F01%2F08%2Fworking-outside-your-comfort-zone%2F&amp;title=Working%20Outside%20Your%20Comfort%20Zone" title="StumbleUpon"><img src="http://carouth.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://twitter.com/home?status=Working%20Outside%20Your%20Comfort%20Zone%20-%20http%3A%2F%2Fcarouth.com%2F2010%2F01%2F08%2Fworking-outside-your-comfort-zone%2F" title="Twitter"><img src="http://carouth.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a>


<br/><br/>]]></content:encoded>
			<wfw:commentRss>http://carouth.com/2010/01/08/working-outside-your-comfort-zone/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>The 2009 Wrap Up</title>
		<link>http://carouth.com/2009/12/24/the-2009-wrap-up/</link>
		<comments>http://carouth.com/2009/12/24/the-2009-wrap-up/#comments</comments>
		<pubDate>Thu, 24 Dec 2009 17:53:32 +0000</pubDate>
		<dc:creator>jcarouth</dc:creator>
				<category><![CDATA[Personal]]></category>
		<category><![CDATA[2009]]></category>
		<category><![CDATA[Yearly Wrap Up]]></category>

		<guid isPermaLink="false">http://carouth.com/?p=146</guid>
		<description><![CDATA[A lot happened in 2009. I don't really believe in new year resolutions, but I do develop a list of goals for the future and set a target period in which I'd like to accomplish each goal. I usually end up with 2–3 goals per quarter in the year and then a list of 5–10 [...]]]></description>
			<content:encoded><![CDATA[<p>A lot happened in 2009. I don't really believe in new year resolutions, but I do develop a list of goals for the future and set a target period in which I'd like to accomplish each goal. I usually end up with 2–3 goals per quarter in the year and then a list of 5–10 five-year goals. This modest list helps me accomplish some of them and not feel like a slacker for only hitting a few items on a list of hundreds.</p>
<p>I'd like to discuss some of the highlights for this past year and, for the first time ever, publicize some of my goals for 2010 and beyond.</p>
<h2>In 2009 I</h2>
<ol>
<li>transitioned to a new position at Texas A&amp;M University;</li>
<li>authored another article for php|architect;</li>
<li>participated in the LIVESTRONG Challenge charity bike ride in Austin, TX;</li>
<li>proposed to Lisa and we are planning our wedding for July 2010; and</li>
<li>started negotiations for a book I will author in 2010.</li>
</ol>
<p>I <a href="http://carouth.com/2009/08/21/new-position-at-texas-a-and-m/">blogged about it</a> earlier this year, but back in August a friend of mine let me know that he was moving to a new position and this his current position would be vacant. I eagerly took the opportunity to apply for and be hired into that position effective September 1, 2009. Since moving in I've done some work on several projects including working on the so-called mobile web site for Texas A&amp;M University. We have an iPhone and Blackberry application, but we saw a need for a more universally-accessible version of the site.</p>
<p>In October, I participated in Lance Armstrong's LIVESTRONG Challenge charity bike ride in Austin, TX. That is also when I proposed to my fiancé, Lisa, and she accepted. We are working diligently on coordinating all the details for a wedding ceremony — or celebration as the church calls it — on July 3, 2010. So far it's been an experience I will not soon forget.</p>
<p>In late 2008 I <a href="http://twitter.com/jcarouth/status/1046235254">stated</a> that I'd like to successfully pitch a book idea to a publisher in 2009. Well I was correct that it would be scary. I pitched several ideas, actually, but only one of them was accepted. I'm currently communicating with the acquisitions editor on the specifics, so I will refrain from disclosing any further information until it's appropriate. I'm glad I was able to scratch this item off my goals for 2009 list even if it's just a strike-through in pencil.</p>
<h2>In 2010 I hope to</h2>
<ul>
<li>Author and publish my first book;</li>
<li>move into an more "adult" apartment complex;</li>
<li>run my first half marathon;</li>
<li>lose at least 80 pounds;</li>
<li>take a photo a day — the 365 project — for the whole year; and</li>
<li>author a useful blog post per week.</li>
</ul>
<p>Obviously the book goal is sort of a carry-over from 2009, but since I'll actually be writing the book in 2010 it's a fine goal. After all, I've heard that the process is quite involved and stressful at times. Given the speed of the proposed delivery schedule I believe the friends that have already gone through this about the stress.</p>
<p>After we get married, Lisa and I plan to get out of the student-focused apartment complex we currently live in and move into a more "adult" complex. We are most excited about the size of the kitchen as we are both foodies and love to cook but our current galley-style kitchen leaves a lot to be desired in terms of usability — especially for more than one cook. We also hope that a garage will be available in the complex as we could definitely use the storage space. With two bicycles and the transition from two apartments into one, we'll need all the room we can get.</p>
<p>At one point in my life — believe it or not — I was an avid runner capable of hitting the roads for a nice 8-mile run in the wee hours of the morning before heading to class or work. These days I'm lucky to make it two miles before I need a walk break. In 2010 I want to change that. With my sister's new interest in running I thought now would be the perfect time to work up to a half marathon, and chose the Big-D Marathon in Dallas, TX on April 11. It's a somewhat realistic goal as we will both go into the race knowing that we aren't shooting for a podium spot, just a finish.</p>
<p>Along with the running goals I need to lose weight. I've started several times but always found excuses to put it off. Well, no more. It's time.</p>
<p>The 365 project is an interesting concept and I need to get back behind the lens. I've probably lost what few skills I had so I hope this endeavor will bring them back.</p>
<p>Finally I hope to be a better citizen by blogging more. This has always been an issue for me and I am taking inspiration from Brandon Savage's dedication to posting at least once a week. I can only hope to be able to find topics to write about and the time to crank the posts out on top of writing the book.</p>
<h2>In the next five years I hope to</h2>
<ul>
<li>become a parent with Lisa;</li>
<li>purchase our first home;</li>
<li>find two German Shepherd companions to enhance and protect our growing family; and</li>
<li>kill my 1990 Acura Integra and get behind the wheel of my dream car, whatever it is.</li>
</ul>
<p>The first two five-year goals are self explanatory. We've already talked about kids and we are in agreement of our preferences for family size and hopefully we will be able to realize those dreams. The home idea is a three-year goal. We will most likely live in the apartment we move into after marriage for two or three years before taking the plunge into home ownership. This will give us time to build up savings for the necessary investment and improvements.</p>
<p>I have always loved the German Shepherd breed, but, given the size of the dogs, we will need ample space for them to be happy. We know we have to wait until we purchase a home to add them to our family, but I hope to be in a position to find them within four years.</p>
<p>My car, as much as a love it sometimes, is on the downward spiral. Truthfully I've wanted to ditch it so many times, but it is a strong Honda car and refuses to die. The plan now is to begin looking for alternate transportation as the odometer continues to creep towards 200,000 miles. I'm thinking that for the immediate future I'll settle on either a new car or something like a Chevrolet Blazer, GMC Equinox, Ford Escape, or similar vehicle until I'm in a better position to get the four-door Jeep with enhancements I have my eye on.</p>
<h2>Merry Christmas and Happy New Year</h2>
<p>That about sums up my major accomplishments for 2009 and a glimpse into my planned future. Have a great two holidays!</p>
<div class="acc_license"><a href="http://creativecommons.org/licenses/by/3.0/"><img src="http://i.creativecommons.org/l/by/3.0/88x31.png" alt="by" /></a></div><!--<rdf:RDF xmlns="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><Work rdf:about=""><license rdf:resource="http://creativecommons.org/licenses/by/3.0/" /></Work><License rdf:about="http://creativecommons.org/licenses/by/3.0/"><requires rdf:resource="http://creativecommons.org/ns#Attribution" /><permits rdf:resource="http://creativecommons.org/ns#Reproduction" /><permits rdf:resource="http://creativecommons.org/ns#Distribution" /><permits rdf:resource="http://creativecommons.org/ns#DerivativeWorks" /><requires rdf:resource="http://creativecommons.org/ns#Notice" /></License></rdf:RDF>-->


Share:


	<a rel="nofollow"  target="_blank" href="http://www.printfriendly.com/print?url=http%3A%2F%2Fcarouth.com%2F2009%2F12%2F24%2Fthe-2009-wrap-up%2F&amp;partner=sociable" title="Print"><img src="http://carouth.com/wp-content/plugins/sociable/images/printfriendly.png" title="Print" alt="Print" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fcarouth.com%2F2009%2F12%2F24%2Fthe-2009-wrap-up%2F&amp;title=The%202009%20Wrap%20Up&amp;bodytext=A%20lot%20happened%20in%202009.%20I%20don%27t%20really%20believe%20in%20new%20year%20resolutions%2C%20but%20I%20do%20develop%20a%20list%20of%20goals%20for%20the%20future%20and%20set%20a%20target%20period%20in%20which%20I%27d%20like%20to%20accomplish%20each%20goal.%20I%20usually%20end%20up%20with%202%E2%80%933%20goals%20per%20quarter%20in%20the%20year%20and%20t" title="Digg"><img src="http://carouth.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fcarouth.com%2F2009%2F12%2F24%2Fthe-2009-wrap-up%2F&amp;title=The%202009%20Wrap%20Up&amp;notes=A%20lot%20happened%20in%202009.%20I%20don%27t%20really%20believe%20in%20new%20year%20resolutions%2C%20but%20I%20do%20develop%20a%20list%20of%20goals%20for%20the%20future%20and%20set%20a%20target%20period%20in%20which%20I%27d%20like%20to%20accomplish%20each%20goal.%20I%20usually%20end%20up%20with%202%E2%80%933%20goals%20per%20quarter%20in%20the%20year%20and%20t" title="del.icio.us"><img src="http://carouth.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fcarouth.com%2F2009%2F12%2F24%2Fthe-2009-wrap-up%2F&amp;t=The%202009%20Wrap%20Up" title="Facebook"><img src="http://carouth.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fcarouth.com%2F2009%2F12%2F24%2Fthe-2009-wrap-up%2F&amp;title=The%202009%20Wrap%20Up&amp;annotation=A%20lot%20happened%20in%202009.%20I%20don%27t%20really%20believe%20in%20new%20year%20resolutions%2C%20but%20I%20do%20develop%20a%20list%20of%20goals%20for%20the%20future%20and%20set%20a%20target%20period%20in%20which%20I%27d%20like%20to%20accomplish%20each%20goal.%20I%20usually%20end%20up%20with%202%E2%80%933%20goals%20per%20quarter%20in%20the%20year%20and%20t" title="Google Bookmarks"><img src="http://carouth.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://reddit.com/submit?url=http%3A%2F%2Fcarouth.com%2F2009%2F12%2F24%2Fthe-2009-wrap-up%2F&amp;title=The%202009%20Wrap%20Up" title="Reddit"><img src="http://carouth.com/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fcarouth.com%2F2009%2F12%2F24%2Fthe-2009-wrap-up%2F&amp;title=The%202009%20Wrap%20Up" title="StumbleUpon"><img src="http://carouth.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://twitter.com/home?status=The%202009%20Wrap%20Up%20-%20http%3A%2F%2Fcarouth.com%2F2009%2F12%2F24%2Fthe-2009-wrap-up%2F" title="Twitter"><img src="http://carouth.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a>


<br/><br/>]]></content:encoded>
			<wfw:commentRss>http://carouth.com/2009/12/24/the-2009-wrap-up/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Review of Keith Pope&#8217;s &#8220;Zend Framework 1.8: Web Application Development&#8221;</title>
		<link>http://carouth.com/2009/12/04/review-zend-framework-web-application-development/</link>
		<comments>http://carouth.com/2009/12/04/review-zend-framework-web-application-development/#comments</comments>
		<pubDate>Fri, 04 Dec 2009 17:35:15 +0000</pubDate>
		<dc:creator>jcarouth</dc:creator>
				<category><![CDATA[Book Reviews]]></category>

		<guid isPermaLink="false">http://carouth.com/?p=139</guid>
		<description><![CDATA[In this post Jeff reviews the book "Zend Framework 1.8: Web Application Development" by Keith Pope, September 2009.]]></description>
			<content:encoded><![CDATA[<p>In late October 2009 I was contacted by a marketing specialist at Packt Publishing to review a copy of <a href="http://www.packtpub.com/zend-framework-1-8-web-application-development/book"><span style="text-decoration: underline;">Zend Framework 1.8: Web Application Development</span></a> (Pope,  2009). As a developer that uses the <a href="http://framework.zend.com">Zend Framework</a> I am more than happy to be writing this review post. I was already familiar with Mr. Pope's work through his blog <a href="http://thepopeisdead.com/">The Pope Is Dead</a>. Overall he takes a well-executed, hands-on approach to guiding the reader through creating a real-world application using the framework.</p>
<h2>Target Audience</h2>
<p>As mentioned in the preface the primary audience for this book is the Zend Framework novice looking to learn about the framework and how to leverage the components to create web applications. He mentions that his secondary audience is developers that currently use the framework and would like to learn more about how to apply emerging best practices to his or her projects. In my opinion this book delivers appropriate content to provide value to both audiences.</p>
<h2>The Basic MVC Application</h2>
<p>The first chapter is a run through on getting a 'Hello World' application up and running. This approach can easily be so incredibly simple that it is useless or significantly complex that is leaves the novice feeling like he or she was punched in the gut. Pope did an outstanding job of combining explanation of the whys without overwhelming the reading as well as providing the simple hows to satisfy the impatient reader.</p>
<p>He takes careful time to walk the reader through design decision when discussing the model or domain layer which is essential to maintainable applications. I found his explanation of other approaches and the specific reason he chose a particular approach to be above what I expected from a "beginner" text, but not so theoretically-laden as to confuse or alienate the novice.</p>
<p>His use of some of the concepts used by more seasoned developers, such as using Front Controller Plugins and Actions Helpers, in his Storefront application is something a novice will find most valuable. While it might seem easy enough to avoid doing this by placing the code elsewhere his presentation of these elements will help curb the instinct to produce code that the developer will regret later.</p>
<h2>Key Areas Addressed</h2>
<p>As mentioned this book is fairly complete in the tutorial-based run through of the framework's features and how use them for a real-world application. I am particularly happy with his brief introduction to practices such as testing and some optimization hints. While it is definitely a bad idea to prematurely optimize his experience is apparent in these chapters.</p>
<h2>Overall Opinion</h2>
<p>Overall Keith Pope and <a href="http://www.packtpub.com/">Packt Publishing</a> produced a quality introductory text to developing with the Zend Framework. His work will be useful to not only the complete novice but to those developers that are familiar with the framework but wish to improve his or her practices to be more in line with emerging "best practices". The only criticism I would offer on the book is, by my own admission, <em>slightly</em> invalid because it is not something that could be easily addressed: I yearn for a more in-depth analysis of the model layer. The model layer, being the implementation of the domain of the project, is incredibly complex and entire volumes could be written to go through implementations. In fact, there are already books that do this in the theoretical sense. I think that <strong>Pope's introduction does suffice for the target audience</strong>.</p>
<div class="acc_license"><a href="http://creativecommons.org/licenses/by/3.0/"><img src="http://i.creativecommons.org/l/by/3.0/88x31.png" alt="by" /></a></div><!--<rdf:RDF xmlns="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><Work rdf:about=""><license rdf:resource="http://creativecommons.org/licenses/by/3.0/" /></Work><License rdf:about="http://creativecommons.org/licenses/by/3.0/"><requires rdf:resource="http://creativecommons.org/ns#Attribution" /><permits rdf:resource="http://creativecommons.org/ns#Reproduction" /><permits rdf:resource="http://creativecommons.org/ns#Distribution" /><permits rdf:resource="http://creativecommons.org/ns#DerivativeWorks" /><requires rdf:resource="http://creativecommons.org/ns#Notice" /></License></rdf:RDF>-->


Share:


	<a rel="nofollow"  target="_blank" href="http://www.printfriendly.com/print?url=http%3A%2F%2Fcarouth.com%2F2009%2F12%2F04%2Freview-zend-framework-web-application-development%2F&amp;partner=sociable" title="Print"><img src="http://carouth.com/wp-content/plugins/sociable/images/printfriendly.png" title="Print" alt="Print" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fcarouth.com%2F2009%2F12%2F04%2Freview-zend-framework-web-application-development%2F&amp;title=Review%20of%20Keith%20Pope%27s%20%22Zend%20Framework%201.8%3A%20Web%20Application%20Development%22&amp;bodytext=In%20this%20post%20Jeff%20reviews%20the%20book%20%22Zend%20Framework%201.8%3A%20Web%20Application%20Development%22%20by%20Keith%20Pope%2C%20September%202009." title="Digg"><img src="http://carouth.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fcarouth.com%2F2009%2F12%2F04%2Freview-zend-framework-web-application-development%2F&amp;title=Review%20of%20Keith%20Pope%27s%20%22Zend%20Framework%201.8%3A%20Web%20Application%20Development%22&amp;notes=In%20this%20post%20Jeff%20reviews%20the%20book%20%22Zend%20Framework%201.8%3A%20Web%20Application%20Development%22%20by%20Keith%20Pope%2C%20September%202009." title="del.icio.us"><img src="http://carouth.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fcarouth.com%2F2009%2F12%2F04%2Freview-zend-framework-web-application-development%2F&amp;t=Review%20of%20Keith%20Pope%27s%20%22Zend%20Framework%201.8%3A%20Web%20Application%20Development%22" title="Facebook"><img src="http://carouth.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fcarouth.com%2F2009%2F12%2F04%2Freview-zend-framework-web-application-development%2F&amp;title=Review%20of%20Keith%20Pope%27s%20%22Zend%20Framework%201.8%3A%20Web%20Application%20Development%22&amp;annotation=In%20this%20post%20Jeff%20reviews%20the%20book%20%22Zend%20Framework%201.8%3A%20Web%20Application%20Development%22%20by%20Keith%20Pope%2C%20September%202009." title="Google Bookmarks"><img src="http://carouth.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://reddit.com/submit?url=http%3A%2F%2Fcarouth.com%2F2009%2F12%2F04%2Freview-zend-framework-web-application-development%2F&amp;title=Review%20of%20Keith%20Pope%27s%20%22Zend%20Framework%201.8%3A%20Web%20Application%20Development%22" title="Reddit"><img src="http://carouth.com/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fcarouth.com%2F2009%2F12%2F04%2Freview-zend-framework-web-application-development%2F&amp;title=Review%20of%20Keith%20Pope%27s%20%22Zend%20Framework%201.8%3A%20Web%20Application%20Development%22" title="StumbleUpon"><img src="http://carouth.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://twitter.com/home?status=Review%20of%20Keith%20Pope%27s%20%22Zend%20Framework%201.8%3A%20Web%20Application%20Development%22%20-%20http%3A%2F%2Fcarouth.com%2F2009%2F12%2F04%2Freview-zend-framework-web-application-development%2F" title="Twitter"><img src="http://carouth.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a>


<br/><br/>]]></content:encoded>
			<wfw:commentRss>http://carouth.com/2009/12/04/review-zend-framework-web-application-development/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Stubbing an Interface</title>
		<link>http://carouth.com/2009/11/18/stubbing-an-interface/</link>
		<comments>http://carouth.com/2009/11/18/stubbing-an-interface/#comments</comments>
		<pubDate>Wed, 18 Nov 2009 17:41:33 +0000</pubDate>
		<dc:creator>jcarouth</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Data Sources]]></category>
		<category><![CDATA[Interfaces]]></category>
		<category><![CDATA[Unit Testing]]></category>

		<guid isPermaLink="false">http://carouth.com/?p=141</guid>
		<description><![CDATA[One of the topics I talk about frequently is coding to an interface. There is an abundance of evidence why one might choose to do so but today I'd like to talk about one benefit in terms of unit testing—another topic I love to talk about. To illustrate the benefit I will use an example [...]]]></description>
			<content:encoded><![CDATA[<p>One of the topics I talk about frequently is coding to an interface. There is an abundance of evidence why one might choose to do so but today I'd like to talk about one benefit in terms of unit testing—another topic I love to talk about. To illustrate the benefit I will use an example of having the data source coded against the interface thereby allowing the consumer of the data source to ignore the specifics behind how data is stored, e.g., in a relational database or in a key-value store, and concentrate solely on requesting the appropriate data. Before I get to the code, however, I think it's important that I define some of the scope of this post.</p>
<h2>Goals of a Unit Test Suite</h2>
<p>Other than exercising a substantial portion of your code a unit test suite must be capable of running quickly lest it be a burden on development. Having a burdensome, slow-running test suite will only encourage developers to ignore it and only run it when absolutely necessary. This, in turn, will make maintenance of the test suite more difficult and probably result in fragile or poor tests which ultimately will leave a bad taste in the developer's mouth about unit testing, and we wouldn't want that, now would we?</p>
<p>One sure-fire way to decrease the speed of a test suite is to make it rely on real-world data sources such as your relational database or even a web service. Imagine a test suite for an application that relies on Twitter's availability. I can assure you that I would not want to run that test suite. The fail whale is annoying enough on the web. But I digress. Being able to emulate a data storage source is paramount to the speed of a unit test. Stubbing is one technique employed to do such a thing.</p>
<h2>A Data Source Interface</h2>
<p>A basic data source needs the implement the standard <abbr title="Create, read, update, and delete">CRUD</abbr> methods and can be defined as follows:</p>
<pre class="brush: php;">interface ICrudDataSource
{
    public function create(array $data);

    public function read($id);

    public function update($id, array $data);

    public function delete($id);
}
</pre>
<p>If this were a real interface there would be PHPDoc blocks to indicate the behavior of the methods and parameter types, but for the sake of the example I omit them. Now we can implement this interface in our database table class and define the behavior for each of the methods in terms of how our chosen rdbms will understand them, e.g., create() is an INSERT statement, read() is a SELECT statement, so on and so forth.</p>
<p>We can then use this class in our unit tests and it will actually test that the database vendor correctly implemented the INSERT, SELECT, UPDATE, and DELETE statements and that we are calling them appropriately. While I do think the latter should be tested when we look at the database abstraction implementation, the former is not necessary and will only slow down tests that <em>use</em> the data source code but <em>don't directly depend on it</em> being a database, for example. In such a case a simple array-based storage mechanism will work.</p>
<h2>Array-based Stub for Unit Testing</h2>
<p>Thus, we implement the ICrudDataSource interface in a stub that is used for our unit tests that need to interact with the data storage but necessarily need to interact with the specific data storage used in production.</p>
<pre class="brush: php;">class UserDataStorageStub implements ICrudDataSource
{
    protected $_store;

    public function __construct()
    {
        $this-&gt;_store = array();
    }

    public function create(array $data)
    {
        if (!$this-&gt;exists($data['id'])) {
            $this-&gt;_store[$data['id']] = $data;
            return true;
        }

        return false;
    }

    public function read($id)
    {
        if ($this-&gt;exists($id)) {
            return $this-&gt;_store[$id];
        }

        return false;
    }

    public function update($id, array $data)
    {
        if (!$this-&gt;exists($id)) {
            return false;
        }

        $this-&gt;_store[$id] = $data;
    }

    public function delete($id)
    {
        unset($this-&gt;_store[$id]);
    }

    private function exists($id)
    {
        return array_key_exists($id, $this-&gt;_store);
    }
}</pre>
<p>With this array-based implementation the unit tests will be fast regardless of the availability of the actual data source or the load on that data source. This stub, or a stub that extends this one, can also be easily pre-populated with test data to allow for testing with fixed data (although this can lead to very brittle tests if done lackadaisically).</p>
<div class="acc_license"><a href="http://creativecommons.org/licenses/by/3.0/"><img src="http://i.creativecommons.org/l/by/3.0/88x31.png" alt="by" /></a></div><!--<rdf:RDF xmlns="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><Work rdf:about=""><license rdf:resource="http://creativecommons.org/licenses/by/3.0/" /></Work><License rdf:about="http://creativecommons.org/licenses/by/3.0/"><requires rdf:resource="http://creativecommons.org/ns#Attribution" /><permits rdf:resource="http://creativecommons.org/ns#Reproduction" /><permits rdf:resource="http://creativecommons.org/ns#Distribution" /><permits rdf:resource="http://creativecommons.org/ns#DerivativeWorks" /><requires rdf:resource="http://creativecommons.org/ns#Notice" /></License></rdf:RDF>-->


Share:


	<a rel="nofollow"  target="_blank" href="http://www.printfriendly.com/print?url=http%3A%2F%2Fcarouth.com%2F2009%2F11%2F18%2Fstubbing-an-interface%2F&amp;partner=sociable" title="Print"><img src="http://carouth.com/wp-content/plugins/sociable/images/printfriendly.png" title="Print" alt="Print" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fcarouth.com%2F2009%2F11%2F18%2Fstubbing-an-interface%2F&amp;title=Stubbing%20an%20Interface&amp;bodytext=One%20of%20the%20topics%20I%20talk%20about%20frequently%20is%20coding%20to%20an%20interface.%20There%20is%20an%20abundance%20of%20evidence%20why%20one%20might%20choose%20to%20do%20so%20but%20today%20I%27d%20like%20to%20talk%20about%20one%20benefit%20in%20terms%20of%20unit%20testing%E2%80%94another%20topic%20I%20love%20to%20talk%20about.%20To%20illust" title="Digg"><img src="http://carouth.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fcarouth.com%2F2009%2F11%2F18%2Fstubbing-an-interface%2F&amp;title=Stubbing%20an%20Interface&amp;notes=One%20of%20the%20topics%20I%20talk%20about%20frequently%20is%20coding%20to%20an%20interface.%20There%20is%20an%20abundance%20of%20evidence%20why%20one%20might%20choose%20to%20do%20so%20but%20today%20I%27d%20like%20to%20talk%20about%20one%20benefit%20in%20terms%20of%20unit%20testing%E2%80%94another%20topic%20I%20love%20to%20talk%20about.%20To%20illust" title="del.icio.us"><img src="http://carouth.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fcarouth.com%2F2009%2F11%2F18%2Fstubbing-an-interface%2F&amp;t=Stubbing%20an%20Interface" title="Facebook"><img src="http://carouth.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fcarouth.com%2F2009%2F11%2F18%2Fstubbing-an-interface%2F&amp;title=Stubbing%20an%20Interface&amp;annotation=One%20of%20the%20topics%20I%20talk%20about%20frequently%20is%20coding%20to%20an%20interface.%20There%20is%20an%20abundance%20of%20evidence%20why%20one%20might%20choose%20to%20do%20so%20but%20today%20I%27d%20like%20to%20talk%20about%20one%20benefit%20in%20terms%20of%20unit%20testing%E2%80%94another%20topic%20I%20love%20to%20talk%20about.%20To%20illust" title="Google Bookmarks"><img src="http://carouth.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://reddit.com/submit?url=http%3A%2F%2Fcarouth.com%2F2009%2F11%2F18%2Fstubbing-an-interface%2F&amp;title=Stubbing%20an%20Interface" title="Reddit"><img src="http://carouth.com/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fcarouth.com%2F2009%2F11%2F18%2Fstubbing-an-interface%2F&amp;title=Stubbing%20an%20Interface" title="StumbleUpon"><img src="http://carouth.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://twitter.com/home?status=Stubbing%20an%20Interface%20-%20http%3A%2F%2Fcarouth.com%2F2009%2F11%2F18%2Fstubbing-an-interface%2F" title="Twitter"><img src="http://carouth.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a>


<br/><br/>]]></content:encoded>
			<wfw:commentRss>http://carouth.com/2009/11/18/stubbing-an-interface/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Maintainable Unit Tests with PHPUnit Revised</title>
		<link>http://carouth.com/2009/11/05/maintainable-unit-tests-with-phpunit-revised/</link>
		<comments>http://carouth.com/2009/11/05/maintainable-unit-tests-with-phpunit-revised/#comments</comments>
		<pubDate>Fri, 06 Nov 2009 00:50:16 +0000</pubDate>
		<dc:creator>jcarouth</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[PHPUnit]]></category>
		<category><![CDATA[Unit Testing]]></category>

		<guid isPermaLink="false">http://carouth.com/?p=134</guid>
		<description><![CDATA[One Step Back
In my previous post I chose an example that did not illustrate my point. In this post I will address the issues with previous post, specifically those brought to light by Matthew Weier O'Phinney in his comment.
His first point is that changing the method signature on a constructor should and will break any [...]]]></description>
			<content:encoded><![CDATA[<h1>One Step Back</h1>
<p>In my previous post I chose an example that did not illustrate my point. In this post I will address the issues with previous post, specifically those brought to light by <a href="http://weierophinney.net/matthew">Matthew Weier O'Phinney</a> in his <a href="http://carouth.com/2009/11/05/maintainable-unit-tests-with-phpunit/#comment-76">comment</a>.</p>
<p>His first point is that changing the method signature on a constructor should and will break any client code, thus modifications will be necessary to the tests. I agree with this wholeheartedly and my choice of using a constructor was obviously flawed. Let's just chalk this one up to not having had my coffee as I typed that post…</p>
<p>His second point deals with using the tools available to you within the framework. Specifically he mentions the use of the setUp() method which executes prior to each test case and is normally used to establish required state, set up fixtures, etc. I already committed to the constructor example so I carried it through this segment of the code. It was, again, a bad decision.</p>
<p>So this post will serve as a replacement for the old post to better illustrate my point.</p>
<h1>Maintainable Tests</h1>
<p>Great unit testing is a learned skill. Unfortunately the motivation developers have for dabbling in writing unit tests for an application usually comes from someone else, e.g., his or her boss, a fellow team member, etc. This leads to writing tests just to have tests which, in my opinion at least, is no better than not having tests in the first place.</p>
<p>A non-maintainable code base is know to be a problem. The corollary, a non-maintainable test suite is a huge problem, is also true. If you cannot maintain your test suite, what is the point? Any time a unit test reaches beyond a single or violates the <abbr title="Don't Repeat Yourself">DRY</abbr> principle a development team could find that the test suite is verging on a non-maintainable state.</p>
<h2>Testing Units More Than Once</h2>
<p>If a requirement or business rule is tested more than once in the test suite, as is the case in the following example, any changes become difficult to manage. In this example the business requirement that changed is that all cars start with five gallons of gas before they arrive at your showroom. Thus a brand new car, i.e., the default constructed car, will not have an empty gas tank and should be able to start—unless something else is wrong, but I am a programmer not a mechanic.</p>
<pre class="brush: php;">class CarTest extends PHPUnit_Framework_TestCase
{
    protected $_car;

    public function setUp()
    {
        $this-&gt;_car = new Car();
    }

    public function testGasolinePresentBeforeStarting()
    {
        $this-&gt;setExpectedException('GasTankEmptyException');
        $this-&gt;_car-&gt;start();
    }

    public function testCarStartsAfterFillup()
    {
        $fuelVessel = $this-&gt;getMock(
            'GasolineContainer',
            array('dispense')
        );
        //set expectation on fuelContainer to give 10
        //gallons of fuel when dispense is called

        try {
            $this-&gt;_car-&gt;start();
            $this-&gt;fail(
                'Empty gas tank but no exception caught'
            );
        } catch(GasTankEmptyException $e) {
            $this-&gt;_car-&gt;addGasoline($fuelVessel);
        }

        $this-&gt;_car-&gt;start();
        $this-&gt;assertTrue($this-&gt;_car-&gt;isRunning());
    }
}</pre>
<p>This change is not necessarily a regression because code that used the Car object before should still work as intended the cars will just start from scratch with some gasoline. Since we changed this requirement both tests in the above code will fail. The first will fail because we assumed a brand new car object would have no gasoline in the tank. The same for the second test. The code repeats itself, and so does my explanation.</p>
<p>Avoiding the duplication in the second test by immediately filling up the car with gasoline solves the problem of having to dig through the unit test and makes the second test case a true unit test. As it stands above, it tests two units: 1) that a car with an empty tank throws a specific exception and 2) that after adding gasoline to the car it will start.</p>
<h2>Using the Tools Correctly</h2>
<p>I knew about setUp() and tearDown() but I was trying too hard to come up with a fancy solution to my problem. The problem, as it should have been explained previously, occurs when a test case has groups of tests that require different configurations of the UUT. For example, sticking with our Car class, we have several tests that require a stock instance of Car while a group of others needs a car with a special engine. We can accomplish this as follows:</p>
<pre class="brush: php;">class CarTest extends PHPUnit_Framework_TestCase
{
    protected $_car;

    public function setUp()
    {
        $this-&gt;_car = new Car();
    }

    public function testSomethingWithAStockCar()
    {
        //work
        $this-&gt;assert(…);
    }

    public function testSomethingElseWithStockCar()
    {
        //same as above
    }

    public function testCarWithDifferentEngine()
    {
        //mock/stub of engine: $engine
        $this-&gt;_car-&gt;setEngine($engine);
    }

    public function testCarWithDifferentEngineAgain()
    {
        //mock/stub of engine: $engine
        $this-&gt;_car-&gt;setEngine($engine);
    }
}</pre>
<p>Assuming I abstract the creation of the mock engine into a helper method, I still have a lot of duplicated code and I still have to call the setEngine() method in each test. That's absurd. One solution is to create a new test case for the different configuration; I'll call it CarWithEngineBTest.</p>
<pre class="brush: php;">class CarWithEngineBTest extends PHPUnit_Framework_TestCase
{
    protected $_car;

    public function setUp()
    {
        $engine = $this-&gt;getMock('EngineB');
        //…configure mock object…
        $this-&gt;_car = new Car();
        $this-&gt;_car-&gt;setEngine($engine);
    }

    //test cases that need this configuration
}</pre>
<p>And remove these specific tests from the previous test case. This probably isn't the only way to solve this issue, but it does seem better than my previous factory method "solution".</p>
<p>The example still isn't perfect, but I couldn't come up with a better one. You are more than welcomed to weigh in.</p>
<div class="acc_license"><a href="http://creativecommons.org/licenses/by/3.0/"><img src="http://i.creativecommons.org/l/by/3.0/88x31.png" alt="by" /></a></div><!--<rdf:RDF xmlns="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><Work rdf:about=""><license rdf:resource="http://creativecommons.org/licenses/by/3.0/" /></Work><License rdf:about="http://creativecommons.org/licenses/by/3.0/"><requires rdf:resource="http://creativecommons.org/ns#Attribution" /><permits rdf:resource="http://creativecommons.org/ns#Reproduction" /><permits rdf:resource="http://creativecommons.org/ns#Distribution" /><permits rdf:resource="http://creativecommons.org/ns#DerivativeWorks" /><requires rdf:resource="http://creativecommons.org/ns#Notice" /></License></rdf:RDF>-->


Share:


	<a rel="nofollow"  target="_blank" href="http://www.printfriendly.com/print?url=http%3A%2F%2Fcarouth.com%2F2009%2F11%2F05%2Fmaintainable-unit-tests-with-phpunit-revised%2F&amp;partner=sociable" title="Print"><img src="http://carouth.com/wp-content/plugins/sociable/images/printfriendly.png" title="Print" alt="Print" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fcarouth.com%2F2009%2F11%2F05%2Fmaintainable-unit-tests-with-phpunit-revised%2F&amp;title=Maintainable%20Unit%20Tests%20with%20PHPUnit%20Revised&amp;bodytext=One%20Step%20Back%0D%0AIn%20my%20previous%20post%20I%20chose%20an%20example%20that%20did%20not%20illustrate%20my%20point.%20In%20this%20post%20I%20will%20address%20the%20issues%20with%20previous%20post%2C%20specifically%20those%20brought%20to%20light%20by%20Matthew%20Weier%20O%27Phinney%20in%20his%20comment.%0D%0A%0D%0AHis%20first%20point%20is%20th" title="Digg"><img src="http://carouth.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fcarouth.com%2F2009%2F11%2F05%2Fmaintainable-unit-tests-with-phpunit-revised%2F&amp;title=Maintainable%20Unit%20Tests%20with%20PHPUnit%20Revised&amp;notes=One%20Step%20Back%0D%0AIn%20my%20previous%20post%20I%20chose%20an%20example%20that%20did%20not%20illustrate%20my%20point.%20In%20this%20post%20I%20will%20address%20the%20issues%20with%20previous%20post%2C%20specifically%20those%20brought%20to%20light%20by%20Matthew%20Weier%20O%27Phinney%20in%20his%20comment.%0D%0A%0D%0AHis%20first%20point%20is%20th" title="del.icio.us"><img src="http://carouth.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fcarouth.com%2F2009%2F11%2F05%2Fmaintainable-unit-tests-with-phpunit-revised%2F&amp;t=Maintainable%20Unit%20Tests%20with%20PHPUnit%20Revised" title="Facebook"><img src="http://carouth.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fcarouth.com%2F2009%2F11%2F05%2Fmaintainable-unit-tests-with-phpunit-revised%2F&amp;title=Maintainable%20Unit%20Tests%20with%20PHPUnit%20Revised&amp;annotation=One%20Step%20Back%0D%0AIn%20my%20previous%20post%20I%20chose%20an%20example%20that%20did%20not%20illustrate%20my%20point.%20In%20this%20post%20I%20will%20address%20the%20issues%20with%20previous%20post%2C%20specifically%20those%20brought%20to%20light%20by%20Matthew%20Weier%20O%27Phinney%20in%20his%20comment.%0D%0A%0D%0AHis%20first%20point%20is%20th" title="Google Bookmarks"><img src="http://carouth.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://reddit.com/submit?url=http%3A%2F%2Fcarouth.com%2F2009%2F11%2F05%2Fmaintainable-unit-tests-with-phpunit-revised%2F&amp;title=Maintainable%20Unit%20Tests%20with%20PHPUnit%20Revised" title="Reddit"><img src="http://carouth.com/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fcarouth.com%2F2009%2F11%2F05%2Fmaintainable-unit-tests-with-phpunit-revised%2F&amp;title=Maintainable%20Unit%20Tests%20with%20PHPUnit%20Revised" title="StumbleUpon"><img src="http://carouth.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://twitter.com/home?status=Maintainable%20Unit%20Tests%20with%20PHPUnit%20Revised%20-%20http%3A%2F%2Fcarouth.com%2F2009%2F11%2F05%2Fmaintainable-unit-tests-with-phpunit-revised%2F" title="Twitter"><img src="http://carouth.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a>


<br/><br/>]]></content:encoded>
			<wfw:commentRss>http://carouth.com/2009/11/05/maintainable-unit-tests-with-phpunit-revised/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Maintainable Unit Tests with PHPUnit</title>
		<link>http://carouth.com/2009/11/05/maintainable-unit-tests-with-phpunit/</link>
		<comments>http://carouth.com/2009/11/05/maintainable-unit-tests-with-phpunit/#comments</comments>
		<pubDate>Thu, 05 Nov 2009 16:45:14 +0000</pubDate>
		<dc:creator>jcarouth</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Maintainable Code]]></category>
		<category><![CDATA[PHPUnit]]></category>
		<category><![CDATA[Unit Testing]]></category>

		<guid isPermaLink="false">http://carouth.com/?p=126</guid>
		<description><![CDATA[Better version of this post coming. Thanks to Matthew Weier O'Phinney's comment I see that this post did not convey the point in the manner I wanted, and I thought of a better solution to the problem. Thus I am closing comments on this post pending the new version. Read the modified version.
Great unit testing [...]]]></description>
			<content:encoded><![CDATA[<p><div class="note"><div class="noteimportant">Better version of this post coming. Thanks to <a href="http://weierophinney.net/matthew">Matthew Weier O'Phinney's</a> comment I see that this post did not convey the point in the manner I wanted, and I thought of a better solution to the problem. Thus I am closing comments on this post pending the new version. <a href="http://carouth.com/2009/11/05/maintainable-unit-tests-with-phpunit-revised/">Read the modified version</a>.</div></div></p>
<p>Great unit testing is a learned skill.  Unfortunately the motivation developers have for dabbling in writing unit tests for an application usually comes from someone else, e.g., his or her boss, a fellow team member, etc. This leads to <strong>writing tests just to have tests</strong> which, in my opinion at least, is no better than not having tests in the first place.</p>
<p>A non-maintainable code base is know to be a problem. The corollary, a non-maintainable test suite is a huge problem, is also true. If you cannot maintain your test suite, what is the point?</p>
<p>Looking at an example, I frequently see test cases that have the <abbr title="Unit Under Test">UUT</abbr>'s constructor called at the beginning of each test. This works fine up until the requirements change and the constructor now requires an instance of IDataSource or an array instead of a string. Now each test must be touched, i.e., development time devoted to each test function, to implement this change.</p>
<pre class="brush: php;">class CarTest extends PHPUnit_Framework_TestCase
{
    public function testStartFailsIfGasTankEmpty()
    {
        $car = new Car();
        $this-&gt;setExpectedException('GasTankEmptyException');
        $car-&gt;start();
    }

    public function testSomethingElse()
    {
        $car = new Car();
        //assert something
    }

    //so on and so forth
}</pre>
<p>Instead, if a developer uses a factory method within the test suite to return a default instance of the UUT, the change to the tests is only necessary in cases where the initialized state of the instance must change via the constructor, as follows.</p>
<pre class="brush: php;">class CarTest extends PHPUnit_Framework_TestCase
{
    public function testStartFailsIfGasTankEmpty()
    {
        $car = $this-&gt;Factory_Car();
        //…snip…
    }

    //…snip…

    private function Factory_Car()
    {
        return new Car();
    }
}</pre>
<p>Okay, that works for a while. But what if in ninety-five percent of the tests you need to use the "default constructor"—in quotes because PHP classes can only have one constructor—but the other five percent need to pass in some configuration options. You have two choices:</p>
<ol>
<li>create a new factory method for each group of, e.g., <em>Factory_Car</em> and <em>Factory_SuperFastCar</em>, or</li>
<li>allow the existing factory method to take arguments and pass them on to the constructor.</li>
</ol>
<p>Which you choose depends on the unique situation of your test case. For this example I'll assume there are ten tests. Seven of the tests use a default <em>Car</em> object while the other three each need a unique Car instance, thus each passes a configuration argument to the constructor. To handle this situation the factory method will make use of the PHP functions <em>func_get_args()</em> and <em>call_user_func_array()</em>.</p>
<pre class="brush: php;">public function Factory_Car()
{

    $car = new Car();
    if (func_num_args() &gt; 0) {
        $args = func_get_args();
        call_user_func_array(array($car, '__construct'), $args);
    }

    return $car;
}</pre>
<p>This factory method allows each test to retrieve a properly-configured instance—where configuration is done via the constructor—of the <em>Car</em> class with which to work without sacrificing maintainability. One caveat: the three test methods in the example will need to be modified if the constructor's signature changes, but, last time I checked, three is less than ten.</p>
<div class="acc_license"><a href="http://creativecommons.org/licenses/by/3.0/"><img src="http://i.creativecommons.org/l/by/3.0/88x31.png" alt="by" /></a></div><!--<rdf:RDF xmlns="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><Work rdf:about=""><license rdf:resource="http://creativecommons.org/licenses/by/3.0/" /></Work><License rdf:about="http://creativecommons.org/licenses/by/3.0/"><requires rdf:resource="http://creativecommons.org/ns#Attribution" /><permits rdf:resource="http://creativecommons.org/ns#Reproduction" /><permits rdf:resource="http://creativecommons.org/ns#Distribution" /><permits rdf:resource="http://creativecommons.org/ns#DerivativeWorks" /><requires rdf:resource="http://creativecommons.org/ns#Notice" /></License></rdf:RDF>--><br/><br/>]]></content:encoded>
			<wfw:commentRss>http://carouth.com/2009/11/05/maintainable-unit-tests-with-phpunit/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Excepting with the SPL</title>
		<link>http://carouth.com/2009/11/02/excepting-with-the-spl/</link>
		<comments>http://carouth.com/2009/11/02/excepting-with-the-spl/#comments</comments>
		<pubDate>Mon, 02 Nov 2009 15:44:26 +0000</pubDate>
		<dc:creator>jcarouth</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Beginner]]></category>
		<category><![CDATA[Best Practice]]></category>
		<category><![CDATA[Input Validation]]></category>

		<guid isPermaLink="false">http://carouth.com/?p=117</guid>
		<description><![CDATA[In my opinion  proper use of error handling within an application is the mark of seasoned, professional developer. It is far too often that I see code that explodes on every error or, even worse, does not consider that errors will occur during runtime.
One area that I like to make use of exceptions is unexpected [...]]]></description>
			<content:encoded><![CDATA[<p>In my opinion  proper use of error handling within an application is the mark of seasoned, professional developer. It is far too often that I see code that explodes on every error or, even worse, does not consider that errors will occur during runtime.</p>
<p>One area that I like to make use of exceptions is unexpected input, especially in terms of function/method arguments. A lot of times the standard practice seems to be to return <em>FALSE</em> for invalid input, but the boolean value false should be reserved for boolean indication. Likewise, <em>NULL</em> should have a special connotation, semantically speaking.</p>
<p>In this first example, a repository (or mapper) is attempting to find a user with an id—let's assume it is a database id—that should be an integer. (<em>This code uses the Zend_Db_Table component to abstract queries, etc.</em>)</p>
<pre class="brush: php;">class UserRepository implements IRepository
{
 public function fetchById($id)
 {
     $data = $this-&gt;getDbTable()
                 -&gt;find($id)
                 -&gt;current();

     if (null === $data) {
         return null;
     }

     return new User($data-&gt;toArray());
 }
}</pre>
<p>Notice there is no validation performed on the <em>$id</em> parameter which is pushed directly into the database table query. Granted the <em>Zend_Db</em> component will handle this error with minimal pain, i.e., you should be fairly protected against a SQL injection attack, but you know that your database table uses an integer for the ID column thus your application should only respond positively to an  integer value for <em>$id</em>.</p>
<pre class="brush: php;">public function fetchById($id)
{
    if (!is_int($id)) {
        return false;
    }
    //…snip
}</pre>
<p>My first attempt (above) at validation uses the native <em>is_int()</em> validation function to check if the value supplied for <em>$id</em> is an integer. If it is not the function returns false. There is plenty of precedent behind using the value <em>FALSE</em> as the error state, but it is <strong>blatantly not semantic</strong>. <em>FALSE</em> is obviously not the user object I asked for, but it does not indicate what went wrong.</p>
<p>Finally, I decide to use the <em>Zend_Validate</em> component—for this trivial example it may be overkill, but it does the job nonetheless—to validate my input parameter for the user's ID property. Also notice that I am now throwing an exception object, specifically an <em>InvalidArgumentException</em>.</p>
<pre class="brush: php;">public function fetchById($id)
{
    $validator = new Zend_Validate_Int();
    if (!$validator-&gt;isValid($id)) {
        throw new InvalidArgumentException(
            'User ID must be an integer.
        );
    }
    //…snip
}</pre>
<p>The <em>InvalidArgumentException</em> exception is <a href="http://www.php.net/manual/en/spl.exceptions.php">one of many</a> defined in the <abbr title="Standard PHP Library">SPL</abbr> as an extension of a logic exception. The reason for using such an exception class would be to improve the readability and usefulness of client code. When I use the <em>UserRepository</em> object, my client code will look as follows. When an invalid argument, i.e., a non integer is given to the <em>fetchById()</em> method it is obvious which code path will execute.</p>
<pre class="brush: php;">try {
    $repository = new UserRepository();
    $user = $repository-&gt;fetchById(&quot;jcarouth&quot;);
} catch(InvalidArgumentException $e) {
    //we passed an invalid argument, i.e., a non-integer
} catch(Exception $e) {
    //some other
}</pre>
<div class="acc_license"><a href="http://creativecommons.org/licenses/by/3.0/"><img src="http://i.creativecommons.org/l/by/3.0/88x31.png" alt="by" /></a></div><!--<rdf:RDF xmlns="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><Work rdf:about=""><license rdf:resource="http://creativecommons.org/licenses/by/3.0/" /></Work><License rdf:about="http://creativecommons.org/licenses/by/3.0/"><requires rdf:resource="http://creativecommons.org/ns#Attribution" /><permits rdf:resource="http://creativecommons.org/ns#Reproduction" /><permits rdf:resource="http://creativecommons.org/ns#Distribution" /><permits rdf:resource="http://creativecommons.org/ns#DerivativeWorks" /><requires rdf:resource="http://creativecommons.org/ns#Notice" /></License></rdf:RDF>-->


Share:


	<a rel="nofollow"  target="_blank" href="http://www.printfriendly.com/print?url=http%3A%2F%2Fcarouth.com%2F2009%2F11%2F02%2Fexcepting-with-the-spl%2F&amp;partner=sociable" title="Print"><img src="http://carouth.com/wp-content/plugins/sociable/images/printfriendly.png" title="Print" alt="Print" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fcarouth.com%2F2009%2F11%2F02%2Fexcepting-with-the-spl%2F&amp;title=Excepting%20with%20the%20SPL&amp;bodytext=In%20my%20opinion%C2%A0%20proper%20use%20of%20error%20handling%20within%20an%20application%20is%20the%20mark%20of%20seasoned%2C%20professional%20developer.%20It%20is%20far%20too%20often%20that%20I%20see%20code%20that%20explodes%20on%20every%20error%20or%2C%20even%20worse%2C%20does%20not%20consider%20that%20errors%20will%20occur%20during%20runti" title="Digg"><img src="http://carouth.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fcarouth.com%2F2009%2F11%2F02%2Fexcepting-with-the-spl%2F&amp;title=Excepting%20with%20the%20SPL&amp;notes=In%20my%20opinion%C2%A0%20proper%20use%20of%20error%20handling%20within%20an%20application%20is%20the%20mark%20of%20seasoned%2C%20professional%20developer.%20It%20is%20far%20too%20often%20that%20I%20see%20code%20that%20explodes%20on%20every%20error%20or%2C%20even%20worse%2C%20does%20not%20consider%20that%20errors%20will%20occur%20during%20runti" title="del.icio.us"><img src="http://carouth.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fcarouth.com%2F2009%2F11%2F02%2Fexcepting-with-the-spl%2F&amp;t=Excepting%20with%20the%20SPL" title="Facebook"><img src="http://carouth.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fcarouth.com%2F2009%2F11%2F02%2Fexcepting-with-the-spl%2F&amp;title=Excepting%20with%20the%20SPL&amp;annotation=In%20my%20opinion%C2%A0%20proper%20use%20of%20error%20handling%20within%20an%20application%20is%20the%20mark%20of%20seasoned%2C%20professional%20developer.%20It%20is%20far%20too%20often%20that%20I%20see%20code%20that%20explodes%20on%20every%20error%20or%2C%20even%20worse%2C%20does%20not%20consider%20that%20errors%20will%20occur%20during%20runti" title="Google Bookmarks"><img src="http://carouth.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://reddit.com/submit?url=http%3A%2F%2Fcarouth.com%2F2009%2F11%2F02%2Fexcepting-with-the-spl%2F&amp;title=Excepting%20with%20the%20SPL" title="Reddit"><img src="http://carouth.com/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fcarouth.com%2F2009%2F11%2F02%2Fexcepting-with-the-spl%2F&amp;title=Excepting%20with%20the%20SPL" title="StumbleUpon"><img src="http://carouth.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://twitter.com/home?status=Excepting%20with%20the%20SPL%20-%20http%3A%2F%2Fcarouth.com%2F2009%2F11%2F02%2Fexcepting-with-the-spl%2F" title="Twitter"><img src="http://carouth.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a>


<br/><br/>]]></content:encoded>
			<wfw:commentRss>http://carouth.com/2009/11/02/excepting-with-the-spl/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
