<?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>Bit Motif &#187; development</title>
	<atom:link href="http://www.bitmotif.com/category/development/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.bitmotif.com</link>
	<description>A Zero Here, A One There</description>
	<lastBuildDate>Mon, 16 May 2011 22:38:49 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
		<item>
		<title>Maximized Functionality Vs.  Maximized Awesomeness</title>
		<link>http://www.bitmotif.com/development/maximized-functionality-vs-maximized-awesomeness/</link>
		<comments>http://www.bitmotif.com/development/maximized-functionality-vs-maximized-awesomeness/#comments</comments>
		<pubDate>Mon, 16 May 2011 22:38:49 +0000</pubDate>
		<dc:creator>pjberry</dc:creator>
				<category><![CDATA[development]]></category>

		<guid isPermaLink="false">http://www.bitmotif.com/?p=212</guid>
		<description><![CDATA[I used to believe that it was my job to get the customer the most functionality as quickly as possible. Rough edges didn&#8217;t matter. If the customer could live with the strange workflow, a quirky UI, or some other abnormality, so could I. It was more important to get the usable code out there. We&#8217;ll [...]]]></description>
			<content:encoded><![CDATA[<p>I used to believe that it was my job to get the customer the most functionality as quickly as possible.  Rough edges didn&#8217;t matter.  </p>
<p>If the customer could live with the strange workflow, a quirky UI, or some other abnormality, so could I.  It was more important to get the usable code out there.  <strong><em>We&#8217;ll smooth the edges out later.</em></strong> Which is fine if it actually happens.  But, it never really seems to work out that way.</p>
<p>So, nowadays I am not so sure.  Even if the customer wants the functionality, I wonder if we do them a disservice by giving it to them.  Perhaps it is a matter of who says it is &#8220;done-done&#8221;, but I am beginning to wonder if it is better to deliver the tiniest bit of functionality (iteratively of course) until it is freaking awesome.  No rough edges, no quirks.  Just awesomeness.  Then, we move on.</p>
<p>This entails finding out what the heart of the functionality is and only doing that.  Also, we need a customer that acknowledges the rough edges whether they face the user or are in the code.  Hmmmm.</p>
<p>Well, like I said, I am not so sure.  But I am beginning to wonder. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.bitmotif.com/development/maximized-functionality-vs-maximized-awesomeness/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Questions To Ask Potential Employers</title>
		<link>http://www.bitmotif.com/agile/questions-to-ask-potential-employers/</link>
		<comments>http://www.bitmotif.com/agile/questions-to-ask-potential-employers/#comments</comments>
		<pubDate>Sun, 15 May 2011 23:17:51 +0000</pubDate>
		<dc:creator>pjberry</dc:creator>
				<category><![CDATA[agile]]></category>
		<category><![CDATA[development]]></category>

		<guid isPermaLink="false">http://www.bitmotif.com/?p=337</guid>
		<description><![CDATA[As I&#8217;ve moved back into contracting/consulting, I&#8217;ve been drawing a list of questions to ask potential employers. I won&#8217;t discuss the answers I prefer to hear. But, I think if one knows what answers they&#8217;d like to hear, they are better prepared to evaluate if the employer is a fit for them. Does all of [...]]]></description>
			<content:encoded><![CDATA[<p>As I&#8217;ve moved back into contracting/consulting, I&#8217;ve been drawing a list of questions to ask potential employers.  I won&#8217;t discuss the answers I prefer to hear.  But, I think if one knows what answers they&#8217;d like to hear, they are better prepared to evaluate if the employer is a fit for them.</p>
<p><strong>Does all of the code compile?</strong></p>
<p><strong>Number of automated tests?</strong></p>
<p><strong>What is your code coverage?</strong> </p>
<p><strong>What is your branch coverage?</strong></p>
<p><strong>What is your average cyclomatic complexity?</strong></p>
<p><strong>If working with legacy code, how long has it been since it was modified?</strong></p>
<p><strong>If working with legacy code, who wrote it, an employee or contractor?</strong></p>
<p><strong>Are you familiar with the <a href="http://www.joelonsoftware.com/articles/fog0000000043.html">Joel Test</a> (or something like it)?  What&#8217;s your score?</strong></p>
<blockquote><p>
If you have the basic infrastructure:<br />
What type of source control do you use?<br />
What tool(s) do you use for continuous/daily builds?<br />
What tool(s) you use for bug tracking?<br />
What tool(s) do you use for deployment?
</p></blockquote>
<p><strong>How long does it take to get a user environment set up?</strong></p>
<p><strong>What type of machines (RAM, CPU, monitor(s) size)? </strong></p>
<p><strong>What type of phones?  Obvious how to hang up, redial, etc?</strong></p>
<p><strong>How easy is it to get conference area?</strong></p>
<p><strong>Do conference areas have projectors?</strong>  </p>
<p><strong>Do conference areas have whiteboards?</strong></p>
<p><strong>Do cubes have whiteboards?</strong></p>
<p><strong>How many managers have programming background?</strong></p>
<p><strong>How many managers to a person?</strong></p>
<p><strong>How are people organized?  Matrix, hierarchical, team?</strong></p>
<p><strong>Who makes the estimates?</strong></p>
<p><strong>What is the basic unit of measurement for estimates?  Hours, days, points, etc?</strong></p>
<p><strong>Type of browser?  Are daily tools dependent upon browser?</strong></p>
<p>And, of course, </p>
<p><strong>Is coffee provided?</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.bitmotif.com/agile/questions-to-ask-potential-employers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Leave It Better Than When You Got There &#8212; How To</title>
		<link>http://www.bitmotif.com/development/leave-it-better-than-when-you-got-there-how-to/</link>
		<comments>http://www.bitmotif.com/development/leave-it-better-than-when-you-got-there-how-to/#comments</comments>
		<pubDate>Sat, 07 May 2011 16:46:16 +0000</pubDate>
		<dc:creator>pjberry</dc:creator>
				<category><![CDATA[development]]></category>

		<guid isPermaLink="false">http://www.bitmotif.com/?p=210</guid>
		<description><![CDATA[Are you familiar with the Boy Scout Rule? Hopefully you are. In its simplest form, in any endeavor, we should leave things better than when we got there. In software, how do we do this? I think at a high level, we have some general problems and solutions: Problem Solution No Tests Create Tests Incomplete [...]]]></description>
			<content:encoded><![CDATA[<p>Are you familiar with the<a href="http://programmer.97things.oreilly.com/wiki/index.php/The_Boy_Scout_Rule"> Boy Scout Rule</a>?  Hopefully you are.  In its simplest form, in any endeavor, we should leave things better than when we got there.  In software, how do we do this?  I think at a high level, we have some general problems and solutions:</p>
<table>
<tr>
<td><strong>Problem</strong></td>
<td><strong>Solution</strong></td>
</tr>
<tr>
<td>No Tests</td>
<td>Create Tests</td>
</tr>
<tr>
<td>Incomplete Tests</td>
<td>Record Test Coverage And Add Tests Until All Paths Through The Code Are Covered</td>
</tr>
<tr>
<td>Hard To Understand Tests</td>
<td>Refactor Tests Into Chunks That Act As Developer Documentation</td>
</tr>
<tr>
<td>Hard To Understand Production Code</td>
<td>Perform Refactorings In Fowler&#8217;s Refactoring</td>
</tr>
</table>
<h3>Problems and Solutions Expanded</h3>
<p>Let&#8217;s expand a little on the table above.  First, the problems are in decreasing severity to a the long term success of project.  So, not having a set of tests is the biggest (technical) detriment to the project.  Without automated and continuously running tests, we essentially  have a black box.  We can&#8217;t easily make changes without being certain that we are not introducing bugs.  </p>
<p>Given the choice between some tests and no tests, I&#8217;ll take some tests.  If we have some tests, we have a lot of the hard stuff out of the way.  But, how do we make it better?  We add tests until we have <strong>all</strong> code paths covered.  There are number of tools out there for measuring code coverage.  Hook the coverage tool up with your tests.  Remember, it is not the percentage of code covered in a class that is important.  It is the branch coverage.  We want to know that we have tested all the paths through the code.  If you have good branch coverage, you&#8217;ll have good line coverage.  Good line coverage does not necessarily mean good branch coverage.    </p>
<p>If we have complete tests, the next issue is most likely that the tests are hard to understand.  To fix this, we keep in mind that not only prove that the code is working as expected, but also act as documentation.  Effective documentation means exposing only what is necessary important for a certain outcome.  We want enough context to understand what is going, but not so much information that the essentials are drowned out.  Achieving this is a difficult balancing act.  Refactoring test code (extracting methods and classes, using proper setup and tear down) and patterns like the <a href="http://www.natpryce.com/articles/000714.html">test data builder</a> help us achieve this goal.</p>
<p>Now I must come clean:  the assumption all along has been that by starting at the tests we have made changes to the production to make it testable.  This means that if we have all the other problems licked, we should be at a stage where the public API for the production code is settled.  We have all the code tested, and we know what the code is supposed to do.  So, if the production code is difficult to understand, it is a matter of <a href="http://refactoring.com/">refactoring</a> it.  </p>
]]></content:encoded>
			<wfw:commentRss>http://www.bitmotif.com/development/leave-it-better-than-when-you-got-there-how-to/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Don&#8217;t Make It Difficult To Do The Right Thing</title>
		<link>http://www.bitmotif.com/development/dont-make-it-difficult-to-do-the-right-thing/</link>
		<comments>http://www.bitmotif.com/development/dont-make-it-difficult-to-do-the-right-thing/#comments</comments>
		<pubDate>Wed, 20 Apr 2011 11:36:00 +0000</pubDate>
		<dc:creator>pjberry</dc:creator>
				<category><![CDATA[development]]></category>

		<guid isPermaLink="false">http://www.bitmotif.com/?p=214</guid>
		<description><![CDATA[Don&#8217;t make it difficult to do the Right Thing. Don&#8217;t make it easy to do the Wrong Thing. All to often, when dealing with software, we stop after something is working. But, as those in the know know, we ain&#8217;t done. We better have tests at this point, and we need to refactor. This is [...]]]></description>
			<content:encoded><![CDATA[<p>Don&#8217;t make it difficult to do the Right Thing.  Don&#8217;t make it easy to do the Wrong Thing.</p>
<p>All to often, when dealing with software, we stop after something is working.  But, as those in the know know, we ain&#8217;t done.  We better have tests at this point, and we need to refactor.  This is where we go beyond making something work.  This is where we reflect on its usage and how to make it better, how we make it easy to do the Right Thing and hard to do the Wrong Thing.</p>
<p>I don&#8217;t want this to become yet another &#8220;You Need To Have Tests&#8221; post.  But, our tests make sure the code still does what we want while we are making the code easy to work with.  We need to have a safety net if we are going make changes to the code that will allow us to move beyond &#8220;something that works&#8221;.</p>
<p>Think about code you&#8217;ve worked with.  Think about the code bases you liked and the ones you didn&#8217;t.  Strive to get your code like the ones you enjoyed, the ones you could intuit what you needed to do, the ones that guided you in the right direction.  Most likely, that code made made it difficult to do the Wrong Thing, but was so easy to work with that doing the Right Thing was effortless. </p>
<p>Don&#8217;t fall int the trap of just recreating code in the style that you were subjected to.  Rise above that crap and create something makes it easy to do the Right Thing!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bitmotif.com/development/dont-make-it-difficult-to-do-the-right-thing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Neatness Counts:  Beware Of The Nested Inline</title>
		<link>http://www.bitmotif.com/development/neatness-counts-beware-of-the-nested-inline/</link>
		<comments>http://www.bitmotif.com/development/neatness-counts-beware-of-the-nested-inline/#comments</comments>
		<pubDate>Thu, 31 Mar 2011 14:15:08 +0000</pubDate>
		<dc:creator>pjberry</dc:creator>
				<category><![CDATA[development]]></category>

		<guid isPermaLink="false">http://www.bitmotif.com/?p=177</guid>
		<description><![CDATA[I always tell my teams that neatness counts. Consider having to read a novel that is handwritten. The messier the handwriting, the harder it will be to read. That, in turn, can affect the time it takes to read the novel, enjoyment of the novel, and even understanding of what the novel is about! Thank [...]]]></description>
			<content:encoded><![CDATA[<p>I always tell my teams that neatness counts.  Consider having to read a novel that is handwritten.  The messier the handwriting, the harder it will be to read.  That, in turn, can affect the time it takes to read the novel, enjoyment of the novel, and even understanding of what the novel is about!  Thank goodness we don&#8217;t have to read handwritten books.  </p>
<p>The same can be said for code.  Messy (poorly formatted code) can increase the difficulty of understanding the intent and/or modifying the code. </p>
<p>Look at the code I recently came across.  The code has been changed to protect the innocent and not-so-innocent.  I had to make the font size really tiny to get everything on one line like it was originally.  But, the spirit remains intact.</p>
<blockquote><p>
<span style="font-size: 7pt">String string  = (CyberProvince.findByCountryId((CountryParameters.findCountry()).getCountryId())).getProvinceNumber().toString()<br />
</span>
</p></blockquote>
<p>So, image we have some objects that represent part of a hierarchy.  In this case, we have provinces which are part of a country.  And, to make things more interesting, we have the notion of a virtual province (CyberProvince).  Anyway, from the code above it is a really difficult to see what is going on and who the actors are.</p>
<p>So, let&#8217;s make this readable.  First, the parenthesis:</p>
<blockquote><p>
<span style="font-size: 7pt">String string = (CyberProvince.findByCountryId( ( CountryParameters.findCountry() ).getCountryId() )).getProvinceNumber().toString()<br />
</span>
</p></blockquote>
<p>In the very least, if you are using a buttload of parenthesis, then use some space to expose the &#8220;pieces&#8221;.  Next, let&#8217;s extract a variable:</p>
<blockquote><p>
<span style="font-size: 7pt">CountryParameters countryParameters = CountryParameters.findCountry();<br />
String string = (CyberProvince.findByCountryId( ( countryParameters ).getCountryId() )).getProvinceNumber().toString()<br />
</span>
</p></blockquote>
<p>A little better.  Now, lets clean up some of the parenthesis, and extract a variable.</p>
<blockquote><p>
<span style="font-size: 7pt">CountryParameters countryParameters = CountryParameters.findCountry();<br />
Integer countryId = countryParameters.getCountryId()<br />
String string = (CyberProvince.findByCountryId( countryId )).getProvinceNumber().toString()<br />
</span>
</p></blockquote>
<p>Let&#8217;s extract another variable.</p>
<blockquote><p>
<span style="font-size: 7pt">CountryParameters countryParameters = CountryParameters.findCountry();<br />
Integer countryId = countryParameters.getCountryId();<br />
CyberProvince cyberProvince = CyberProvince.findByCountryId( countryId );<br />
String string = (cyberProvince).getProvinceNumber().toString()<br />
</span>
</p></blockquote>
<p>Ok.  Let&#8217;s do another round of parenthesis fixing.</p>
<blockquote><p>
<span style="font-size: 7pt">CountryParameters countryParameters = CountryParameters.findCountry();<br />
Integer countryId = countryParameters.getCountryId();<br />
CyberProvince cyberProvince = CyberProvince.findByCountryId( countryId );<br />
String string = cyberProvince.getProvinceNumber().toString()<br />
</span>
</p></blockquote>
<p>Before the changes, understanding the code and considering modifications was much more difficult.  Now, we can actually understand the intent.  We can begin to analyze the code, to weigh the pros and cons of further refactoring of said code.  Plus, we have the added benefit of being able to more easily debug the code if needed.  </p>
<p>Once again:  neatness counts!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bitmotif.com/development/neatness-counts-beware-of-the-nested-inline/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Playing With Jetty And Selenium</title>
		<link>http://www.bitmotif.com/selenium/playing-with-jetty-and-selenium/</link>
		<comments>http://www.bitmotif.com/selenium/playing-with-jetty-and-selenium/#comments</comments>
		<pubDate>Sat, 26 Mar 2011 20:49:23 +0000</pubDate>
		<dc:creator>pjberry</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Selenium]]></category>

		<guid isPermaLink="false">http://www.bitmotif.com/?p=166</guid>
		<description><![CDATA[Now that we&#8217;ve seen how to get Jetty up and running, let&#8217;s integrate it with Selenium. We&#8217;ll be using Selenium 2 to check a simple JSP. So, in addition to the Jetty-related jars mentioned in the earlier post, we will need the following Selenium jars: selenium-java-[version].jar selenium-server-standalone-[version].jar They are available here. We have a JSP: [...]]]></description>
			<content:encoded><![CDATA[<p>Now that we&#8217;ve seen how to get Jetty up and running, let&#8217;s integrate it with Selenium. We&#8217;ll be using Selenium 2 to check a simple JSP.</p>
<p>So, in addition to the Jetty-related jars mentioned in <a href="http://www.bitmotif.com/java/playing-with-jetty-part-one/">the earlier post</a>, we will need the following Selenium jars:</p>
<blockquote><p>
selenium-java-[version].jar<br />
selenium-server-standalone-[version].jar
</p></blockquote>
<p>They are available <a href="http://seleniumhq.org/download/">here</a>.</p>
<p>We have a JSP:</p>
<blockquote>
<pre>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
&lt;html&gt;
&lt;body&gt;
&lt;h1&gt;From The JSP&lt;/h1&gt;

&lt;h2&gt;h2 text&lt;/h2&gt;

&lt;/body&gt;
&lt;/html&gt;
</pre>
</blockquote>
<p>This page is served when one tries to go to http://localhost:8080.</p>
<p>And, we also have a simple test class:</p>
<blockquote>
<pre>
package com.bitmotif.example;

import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.webapp.WebAppContext;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.server.SeleniumServer;

import static org.junit.Assert.assertEquals;

/**
 * User: pjberry
 * Date: 3/22/11
 * Time: 6:29 PM
 */
public class ExampleTest {

    private SeleniumServer seleniumServer;
    private Server applicationServer;
    private WebDriver driver;

    @Before
    public void setUp() throws Exception {
        startApplicationServer();
        startSeleniumServer();
        driver = new FirefoxDriver();
    }

    @After
    public void tearDown() throws Exception {
        driver.quit();
        seleniumServer.stop();
        applicationServer.stop();
    }

    @Test
    public void testPageContents() {
        driver.get("http://localhost:8080");

        WebElement element = driver.findElement(By.tagName("h2"));

        assertEquals("h2 text", element.getText());
    }

    private void startSeleniumServer() throws Exception {
        seleniumServer = new SeleniumServer();
        seleniumServer.start();
    }

    private void startApplicationServer() throws Exception {
        applicationServer = buildServer( buildWebAppContext() );
        applicationServer.start();
    }

    private Server buildServer(WebAppContext webApp) {
        Server server = new Server(8080);
        server.setHandler(webApp);
        return server;
    }

    private WebAppContext buildWebAppContext() {
        WebAppContext webApp = new WebAppContext();
        webApp.setContextPath("/");
        webApp.setResourceBase("./src/main/webapp");
        return webApp;
    }

}
</pre>
</blockquote>
<p>So, what do we have here?  Simply, we fire up Jetty, then fire up the Selenium server, and lastly, we fire up the WebDriver (client).  With our server running and proxy running, we use our client to load a page.  Next, we load a page and get the h2 tag.  Then we check the text in the h2 tag. </p>
<p>This is freaking awesome.  Basically, we have a way to test against a container without having to do a deployment!  Extending this idea, we can then do things like create tests for Javascript without leaving the IDE or automate acceptance tests for continuous integration without a bunch of tedious configuration.  That&#8217;s pretty powerful stuff.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bitmotif.com/selenium/playing-with-jetty-and-selenium/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dear Maven</title>
		<link>http://www.bitmotif.com/development/dear-maven/</link>
		<comments>http://www.bitmotif.com/development/dear-maven/#comments</comments>
		<pubDate>Fri, 25 Mar 2011 15:11:32 +0000</pubDate>
		<dc:creator>pjberry</dc:creator>
				<category><![CDATA[development]]></category>

		<guid isPermaLink="false">http://www.bitmotif.com/?p=161</guid>
		<description><![CDATA[I know we&#8217;ve always had a rocky relationship, but the fight we had yesterday was the last straw. Let&#8217;s face it, this just isn&#8217;t working. I wish I could say it&#8217;s me, but it&#8217;s really you. I&#8217;ve tried and tried to make you happy, but in the end, it has just made me unhappy. Look, [...]]]></description>
			<content:encoded><![CDATA[<p>I know we&#8217;ve always had a rocky relationship, but the fight we had  yesterday was the last straw.</p>
<p>Let&#8217;s face it, this just isn&#8217;t working.  I wish I could say it&#8217;s me, but it&#8217;s really you.  I&#8217;ve tried and tried to make you happy, but  in  the end, it has just made me unhappy.</p>
<p>Look, you really are amazing.  The things you know and the things you  can do&#8211;damn!  But, when we disagree, it is awful.  When it happens,  it makes me wonder why we are together.</p>
<p>So, we should break up.  I can use the space and time to catch up with  old friends, to do things that I used to do before I met  you.</p>
<p>Maybe we&#8217;ll cross paths again in the future, but for now, we should go our separate ways.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bitmotif.com/development/dear-maven/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ask</title>
		<link>http://www.bitmotif.com/development/ask/</link>
		<comments>http://www.bitmotif.com/development/ask/#comments</comments>
		<pubDate>Wed, 23 Mar 2011 21:20:11 +0000</pubDate>
		<dc:creator>pjberry</dc:creator>
				<category><![CDATA[development]]></category>

		<guid isPermaLink="false">http://www.bitmotif.com/?p=157</guid>
		<description><![CDATA[When I first started programming, I made it a point to investigate to the limit of my understanding before asking a question. Once I reached that limit, I&#8217;d go ask somebody. This served me well because I learned on my own, and didn&#8217;t feel guilty about &#8220;wasting&#8221; somebody else&#8217;s time. As I became more senior, [...]]]></description>
			<content:encoded><![CDATA[<p>When I first started programming, I made it a point to investigate to the limit of my understanding before asking a question.  Once I reached that limit, I&#8217;d go ask somebody.  This served me well because I learned on my own, and didn&#8217;t feel guilty about &#8220;wasting&#8221; somebody else&#8217;s time.</p>
<p>As I became more senior, the knowledge I acquired by investigation and asking meant that I became a person providing answers to questions.  In fact, there are times when that is all that I do&#8211;so much so that I sometimes I forget that I can ask questions.  Nowadays, (in the worst case) I&#8217;ll flail for a while making progress, but at too slow of a pace.  Then, I&#8217;ll either eventually figure it out or eventually realize I need to ask some questions.  Either way, it isn&#8217;t the most efficient use of my time.  </p>
<p>I need to remember as I progress, it is still OK to ask questions.  I can&#8217;t always know all of the answers and, in some cases, figuring out the answer does not have a good return on the time invested.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bitmotif.com/development/ask/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Engineering NOT Tool Selection</title>
		<link>http://www.bitmotif.com/development/engineering-not-tool-selection/</link>
		<comments>http://www.bitmotif.com/development/engineering-not-tool-selection/#comments</comments>
		<pubDate>Wed, 16 Mar 2011 01:54:36 +0000</pubDate>
		<dc:creator>pjberry</dc:creator>
				<category><![CDATA[development]]></category>

		<guid isPermaLink="false">http://www.bitmotif.com/?p=38</guid>
		<description><![CDATA[When I was in the the seventh grade, my industrial arts teacher, Mr. McQueen, gave his definition of engineering: Using what you have to get what you need That definition has always stuck with me. I find it to be the simplest, most straight-forward definition of what an engineer does. Admittedly, it is vague. But, [...]]]></description>
			<content:encoded><![CDATA[<p>When I was in the the seventh grade, my industrial arts teacher, Mr. McQueen, gave his definition of engineering:</p>
<blockquote><p>
Using what you have to get what you need
</p></blockquote>
<p>That definition has always stuck with me.  I find it to be the simplest, most straight-forward definition of what an engineer does.  Admittedly, it is vague.  But, I think it is vague in a good way.  It doesn&#8217;t overspecify, it just gives us a conceptual framework.</p>
<p>How does this tie into what we sometimes call software engineering?  Most of the time, we are trying to solve some problem (to get what we want) with software (which we already have or will have).</p>
<p>Ideally, we have an idea of what we want.  But, in reality, that&#8217;s rarely the case.  Much of software development is discovering what is actually needed.  An easy way to do this is to have some software, let the users work with it, get their feedback, make changes, and repeat.</p>
<p>This is where many organizations go astray.  Rather than doing software work (engineering) themselves, many organizations decide to buy a tool.  On the surface, this isn&#8217;t a bad a idea&#8211;why reinvent the wheel?  But, in order for a tool to solve a problem, we have to fully understand the problem.</p>
<p>And, this is where the title of the post comes from.  If there is a piece of software that solves the problem, it would be unprofessional to propose creating our own.  However, it is also unprofessional to propose using a tool when we do not know enough about the problem.  Without the engineering exercise, we are going to have a tougher time selecting a tool.</p>
<p>In the end, even if we think it is possible to use a tool to get what we want, it is worth while to do some engineering.  </p>
]]></content:encoded>
			<wfw:commentRss>http://www.bitmotif.com/development/engineering-not-tool-selection/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Unit Testing Guidlines</title>
		<link>http://www.bitmotif.com/development/unit-testing-guidlines/</link>
		<comments>http://www.bitmotif.com/development/unit-testing-guidlines/#comments</comments>
		<pubDate>Wed, 09 Mar 2011 17:54:26 +0000</pubDate>
		<dc:creator>pjberry</dc:creator>
				<category><![CDATA[development]]></category>

		<guid isPermaLink="false">http://www.bitmotif.com/?p=134</guid>
		<description><![CDATA[Recently I was asked to draw ups some guidelines regarding Unit Testing. I was hoping to find something that I could point people to, but I didn&#8217;t find any one listing that I liked. So, I&#8217;ve drawn up my own Unit Testing Guidelines / Commandments / Rules Of Thumb / Principles / Heuristics / Best [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I was asked to draw ups some guidelines regarding Unit Testing.  I was hoping to find something that I could point people to, but I didn&#8217;t find any one listing that I liked.  So, I&#8217;ve drawn up my own Unit Testing Guidelines / Commandments / Rules Of Thumb / Principles / Heuristics / Best Practices / Whathaveyous:</p>
<p><strong>Tests should be written first</strong></p>
<blockquote><p>
    Let the test help direct the design<br />
    Make the code easy to test
</p></blockquote>
<p><strong>Each test must be independent of other tests</strong></p>
<blockquote><p>
    Running tests in isolation provide faster feedback and makes testing easier<br />
    Junit assumes that tests can be run arbitrary order<br />
    Depending on other tests indicates tightly coupled code
</p></blockquote>
<p><strong>Tests should not be dependent upon upon production code to be tested</strong></p>
<blockquote><p>
    For example, don&#8217;t use your dao to insert data for testing<br />
    Failing to do so requires proving that the dao works, which then creates a dependency on another test
</p></blockquote>
<p><strong>Tests should demonstrate behavior for expected  and unexpected behavior</strong></p>
<blockquote><p>
    Tests serve as documentation for the happy path and the sad path
</p></blockquote>
<p><strong>Red, Green, Refactor</strong></p>
<blockquote><p>
    This is where we remove duplication, simplify, and in general make things better<br />
    Applies to the test code as well
</p></blockquote>
<p><strong>Each class merits its own test class</strong></p>
<blockquote><p>
    Applies to &#8220;simple&#8221; classes, too<br />
    Not only is it a test, it is documentation for the future
</p></blockquote>
<p><strong>Organize test methods in three chunks arrange, act, assert</strong></p>
<blockquote><p>
    This makes your intent much easier to understand
</p></blockquote>
<p><strong>Isolate layers</strong></p>
<blockquote><p>
    You shouldn&#8217;t need a database connection to test a class that doesn&#8217;t directly use the database<br />
    Mocks, Stubs, and Dependency Injection are your friends
</p></blockquote>
<p><strong>Each test method should test one thing</strong></p>
<blockquote><p>
    This makes your intent much easier to understand<br />
    This makes it easier to understand what is and isn&#8217;t working<br />
    Ideally it would have one assert
</p></blockquote>
<p><strong>Prefer naming conventions that describe the scenario and outcome</strong></p>
<blockquote><p>
    One example is methodName_Scenario_Outcome<br />
    Use the language of the domain
</p></blockquote>
<p><strong>Know what you are testing and how to test it</strong></p>
<blockquote><p>
    Prefer state-based testing for checking return values and outcomes<br />
    Prefer behavior-based testing for testing interactions
</p></blockquote>
<p><strong>Keep tests as quiet as possible</strong></p>
<blockquote><p>
    Avoid printing out statements, logging, etc.<br />
    Your tests should only be vocal when something interesting (usually bad) happens
</p></blockquote>
<p><strong>Tests should be as small and as fast as possible</strong></p>
<blockquote><p>
    Do one thing, do it fast<br />
    Fast feedback is the name of the game
</p></blockquote>
<p><strong>Tests should be run regularly</strong></p>
<blockquote><p>
    In the very least, every time there is a code change<br />
    Automate it<br />
    Get notifications if tests are failing
</p></blockquote>
<p><strong>Fix tests ASAP</strong></p>
<blockquote><p>
    Even if you aren&#8217;t the on who created the issue
</p></blockquote>
<p><strong>Write tests to reproduce bugs</strong></p>
<blockquote><p>
    Use this to guide fixing code.
</p></blockquote>
<p>Obviously, this isn&#8217;t the alpha and the omega of unit test practices, but I think it captures most of what&#8217;s critical.</p>
<p>The following links were influential (but not the only influence) for this list.<br />
<a href="http://exubero.com/junit/antipatterns.html">http://exubero.com/junit/antipatterns.html</a><br />
<a href="http://geosoft.no/development/unittesting.html">http://geosoft.no/development/unittesting.html</a><br />
<a href="http://stackoverflow.com/questions/106800/unit-testing-guidelines">http://stackoverflow.com/questions/106800/unit-testing-guidelines</a><br />
<a href="http://blog.jayfields.com/2005/11/unit-test-guidelines.html">http://blog.jayfields.com/2005/11/unit-test-guidelines.html</a><br />
<a href="#">http://developer.apple.com/library/mac/#documentation/DeveloperTools/Conceptual/UnitTesting/1-Articles/UTGuidelines.html</a> <strong><em>No Longer Valid</em></strong><br />
<a href="http://pragprog.com/the-pragmatic-programmer/extracts/software-entropy">http://pragprog.com/the-pragmatic-programmer/extracts/software-entropy</a><br />
<a href="http://www.robertbeal.com/145/thoughts-about-unit-testing-private-methods-and-100-coverage">http://www.robertbeal.com/145/thoughts-about-unit-testing-private-methods-and-100-coverage</a><br />
<a href="http://martinfowler.com/articles/mocksArentStubs.html">http://martinfowler.com/articles/mocksArentStubs.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.bitmotif.com/development/unit-testing-guidlines/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

