<?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>22 idea street &#187; Testing</title>
	<atom:link href="http://22ideastreet.com/blog/tag/testing/feed/" rel="self" type="application/rss+xml" />
	<link>http://22ideastreet.com/blog</link>
	<description></description>
	<lastBuildDate>Thu, 19 Aug 2010 17:12:15 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=abc</generator>
		<item>
		<title>The Four Noble Truths of Coding</title>
		<link>http://22ideastreet.com/blog/2010/08/05/the-four-noble-truths-of-coding/</link>
		<comments>http://22ideastreet.com/blog/2010/08/05/the-four-noble-truths-of-coding/#comments</comments>
		<pubDate>Thu, 05 Aug 2010 19:00:39 +0000</pubDate>
		<dc:creator>Anthony Panozzo</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Philosophy]]></category>
		<category><![CDATA[Testing]]></category>

		<guid isPermaLink="false">http://22ideastreet.com/blog/?p=1015</guid>
		<description><![CDATA[The four noble truths in Buddhism are, approximately: Life is suffering. The origin of suffering is attachment, due to ignorance. The cessation of suffering is attainable. The eight-fold path leads to liberation. I was coding happily along, and realized in a flash of insight that this applied to what I was working on. In coding, [...]<p><br/><br/>Original article:  <a href="http://22ideastreet.com/blog/2010/08/05/the-four-noble-truths-of-coding/">The Four Noble Truths of Coding</a></p>
]]></description>
			<content:encoded><![CDATA[<p>The four noble truths in Buddhism are, approximately:</p>
<p>Life is suffering.<br />
The origin of suffering is attachment, due to ignorance.<br />
The cessation of suffering is attainable.<br />
The eight-fold path leads to liberation.</p>
<p>I was coding happily along, and realized in a flash of insight that this applied to what I was working on.</p>
<p>In coding, suffering comes from:</p>
<ul>
<li>not being comfortable making a change because you don&#8217;t quite understand how the system works</li>
<li>working hard but realizing your code is still buggy</li>
<li>a client being less than impressed by &#8220;a change that couldn&#8217;t break anything&#8221;, but did</li>
<li>not being able to refactor because you can&#8217;t see all of the implications</li>
<li>wondering if this ever really worked at all</li>
<li>having that bug pop up again, although we thought it was fixed</li>
<li>not delivering with quality and on time</li>
</ul>
<h4>The Four Noble Truths of Coding</h4>
<p>Coding is suffering.<br />
The origin of suffering is attachment, due to ignorance.<br />
The cessation of suffering is attainable.<br />
The path of executable specifications leads to liberation.</p>
<p>This is a bold statement to make.  By using automated means of capturing the assumptions present in code, one breaks the painful cycle that comes from ignorance about the code base.  Coding then becomes not suffering, nor not-not suffering, but just coding.  Instead of coding in fear, it again becomes a creative process that encourages working with others in harmony.  With automated tests of some sort, instead of having the law of cause and effect operating over the course of months, weeks, or days, feedback operates instead in terms of minutes.</p>
<p>However, there is a middle path to take here.  If one is entirely safe, one loses the creative edge that makes the project exciting and lessens nimbleness with too much process and boilerplate.  If one is too loose, one stands to let some quality slip.  Experience seems to be the best guide.</p>
<p>This thought probably emerged from reading philosophy and <i>Working Effectively With Legacy Code</i>.</p>
<p><br/><br/>Original article:  <a href="http://22ideastreet.com/blog/2010/08/05/the-four-noble-truths-of-coding/">The Four Noble Truths of Coding</a></p>
]]></content:encoded>
			<wfw:commentRss>http://22ideastreet.com/blog/2010/08/05/the-four-noble-truths-of-coding/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>So what have I been doing the past few months?</title>
		<link>http://22ideastreet.com/blog/2010/07/12/so-what-have-i-been-doing-the-past-few-months/</link>
		<comments>http://22ideastreet.com/blog/2010/07/12/so-what-have-i-been-doing-the-past-few-months/#comments</comments>
		<pubDate>Mon, 12 Jul 2010 18:00:41 +0000</pubDate>
		<dc:creator>Anthony Panozzo</dc:creator>
				<category><![CDATA[Meta]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[Code Jam]]></category>
		<category><![CDATA[PMBA]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Testing]]></category>
		<category><![CDATA[Ultimate]]></category>

		<guid isPermaLink="false">http://22ideastreet.com/blog/?p=998</guid>
		<description><![CDATA[Ultimate Website My biggest accomplishment of the year so far has been creating a new website for Ultimate (Frisbee) in the Indianapolis area. I got a basic concept going one Saturday morning, took feedback and talked to stakeholders, and then made a final version with the help of others in Indy. Notable improvements include: pictures [...]<p><br/><br/>Original article:  <a href="http://22ideastreet.com/blog/2010/07/12/so-what-have-i-been-doing-the-past-few-months/">So what <i>have</i> I been doing the past few months?</a></p>
]]></description>
			<content:encoded><![CDATA[<h4>Ultimate Website</h4>
<p>My biggest accomplishment of the year so far has been creating <a href="http://indyultimate.org">a new website for Ultimate (Frisbee) in the Indianapolis area</a>.  I got a basic concept going one Saturday morning, took feedback and talked to stakeholders, and then made a final version with the help of others in Indy.  Notable improvements include:</p>
<ul>
<li>pictures from <a href="http://www.zachdobson.com/">Zach Dobson</a>, an professional photographer in Indianapolis, on the front page
<li>maps of all the fields that are used for pickup games, with up-to-date information about when they are played
<li>integration with a league manager that has online signups, payments, and Google Maps support to show where fields are
<li>live streaming of the 2010 Indiana Ultimate high school championships on June 20th
</ul>
<p>For comparison, you can check out <a href="http://indyultimate.danconia.org">the old site</a>.  I&#8217;m really happy that people helped out and offered suggestions and improvements to the site.  This project is on autopilot now.</p>
<h4>Other projects</h4>
<p>A few months ago I created an eight-session <b>class about developer testing</b> that I taught to people at work.  I was surprised at how much work it was, but it seemed like the participants got a lot out of it, and I learned a ton putting it together.</p>
<p>I recently made a simple Rails <b>app that tracks personal events</b>.  I started this to keep track of soda consumption, but use it for many things now (showering, wake and sleep times, work transit times, standup lengths, etc.)  It&#8217;s handy to be able to do this from anywhere, so I created a bare-bones Android app that can send events.  I&#8217;d like to put together some neat graphs and histograms.  I plan on implementing some basic parsing to override the dates and times that things were submitted (think: &#8216;soda 12oz at 12:30&#8242; or &#8216;exercised yesterday afternoon&#8217;).  Right now the app would at least be useful for tracking how many days in a row I&#8217;ve flossed or exercised.</p>
<p>Lately I&#8217;ve been <b>reading</b> feverishly.  Recent books have mostly been from the Personal MBA program.  I have read 22 read out of 100 and expect to get to 30 within a few months.  I&#8217;ve found this undertaking to be helpful in understanding how businesses work.  I supplement this reading with blogs to ensure I&#8217;m not only consuming out of date material.  Reading marketing and sales books is useful because I do not believe that merely creating a superior product is enough to be successful.</p>
<p>Finally, I am organizing a <b>Code Jam</b> at my place of work on Saturday morning.  Basically it&#8217;s a time for people at work to come together and hack on whatever cool ideas they have or learn about interesting things.  If anything cool happens, I&#8217;ll post some pictures.</p>
<p><br/><br/>Original article:  <a href="http://22ideastreet.com/blog/2010/07/12/so-what-have-i-been-doing-the-past-few-months/">So what <i>have</i> I been doing the past few months?</a></p>
]]></content:encoded>
			<wfw:commentRss>http://22ideastreet.com/blog/2010/07/12/so-what-have-i-been-doing-the-past-few-months/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Exploratory Testing and Visual Browser Diff</title>
		<link>http://22ideastreet.com/blog/2009/01/21/exploratory-testing-and-visual-browser-diff/</link>
		<comments>http://22ideastreet.com/blog/2009/01/21/exploratory-testing-and-visual-browser-diff/#comments</comments>
		<pubDate>Wed, 21 Jan 2009 11:00:36 +0000</pubDate>
		<dc:creator>Anthony Panozzo</dc:creator>
				<category><![CDATA[Thoughts]]></category>
		<category><![CDATA[Browser]]></category>
		<category><![CDATA[Exploratory]]></category>
		<category><![CDATA[Testing]]></category>
		<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://22ideastreet.com/blog/?p=581</guid>
		<description><![CDATA[I&#8217;ve recently been doing some ad-hoc testing at work, and it seems like my process could be improved somewhat. I&#8217;m tasked with testing a web application that I&#8217;m not exceedingly familiar with. At first, I am just going through the application with IE6 and trying out various functions or details and making sure that things [...]<p><br/><br/>Original article:  <a href="http://22ideastreet.com/blog/2009/01/21/exploratory-testing-and-visual-browser-diff/">Exploratory Testing and Visual Browser Diff</a></p>
]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve recently been doing some ad-hoc testing at work, and it seems like my process could be improved somewhat.  I&#8217;m tasked with testing a web application that I&#8217;m not exceedingly familiar with.  At first, I am just going through the application with IE6 and trying out various functions or details and making sure that things look and behave appropriately with strange inputs.  When I see something anomalous or a particular page that looks complicated or strangely laid out, I dig a little deeper and try to see what I can break.  I figure that it&#8217;s these sections that are the most likely to contain bugs.  Taking screenshots of likely bugs has been helpful in entering them accurately into our bug tracking system and will hopefully avoid ambiguity in what I&#8217;m seeing for whoever tries to fix the bug, which will then require less communication overhead for me.</p>
<p>I heard Mike Kelly talk a bit about exploratory testing, and it seems like what I have recently been trying is similar to this technique.  Essentially, exploratory testing is ad-hoc testing&#8217;s bigger, more refined brother.  Instead of just willy-nilly testing things, you have a designated goal and you create a plan that you try to stick to.  When you see something interesting or have a clever thought on how to test that things are well done, you can venture off of the path for a bit and explore that idea.  In this way, you can use your intuition as well as having a way to document and hold yourself accountable for the testing that you are doing.</p>
<p>Of course, this doesn&#8217;t work for all applications, but it seems like it&#8217;s useful for my case.  I just realized that this is a pretty cool subject, something that gives ad-hoc testing more value and more credibility as a testing methodology.  This is vague and my understanding limited, so if you want more information, check out the <a href="http://en.wikipedia.org/wiki/Exploratory_testing">Wikipedia entry for exploratory testing</a> for starters, along with James Bach&#8217;s PDF that&#8217;s there.</p>
<h4>Image recognition</h4>
<p>It seems like we could improve on verifying the look in all of the browsers we are tasked with using (IE6 &#038; 7, FF 2 &#038; 3.)  It would be best if the site looks essentially the same on all browsers at the supported resolutions.  At this time, however, the CSS is not very well decoupled, so what happens is that someone changes the CSS on one page, and somewhere else something is misaligned on one of the browsers or something.  It&#8217;s time consuming to verify just one page on all browsers, let alone pages that you don&#8217;t think might have been modified.  This leads to mistakes because we are not getting feedback quickly enough.</p>
<p>To mitigate these mistakes, we might employ a technique mentioned at the September IWST.  You create a script that goes through the site for the supported browsers and takes screenshots of them at the supported resolutions for all of the pages on the site.  You have a baseline of some sort, which is how things looked when you last got latest from the repo.  Then, if you make any style changes, you run the script and look to see if anything changed.  If things look good, you check in.  If not, you know and fix them.  By making the right choice easier, we improve the quality of our product.</p>
<h4>Pop Quiz</h4>
<p>So, which one of these blogs is not like the others?</p>
<div id="attachment_587" class="wp-caption alignnone" style="width: 509px"><a href="http://22ideastreet.com/blog/wp-content/uploads/2009/01/which-one.png"><img src="http://22ideastreet.com/blog/wp-content/uploads/2009/01/which-one.png" alt="Which one of these is different?" title="which-one" width="499" height="621" class="size-full wp-image-587" /></a><p class="wp-caption-text">Which one of these is different?</p></div>
<p>&nbsp;<br />
&nbsp;<br />
&nbsp;</p>
<p>Well, it was kind of a silly quiz, you probably already knew that it was going to be IE that was going to be different.  <img src='http://22ideastreet.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  (RSS icon)  Kind of reminds you of those &#8220;find the six things that are different between these pictures&#8221; things in the Sunday comics?</p>
<p>The point here is that it&#8217;s pretty quick and painless to go through the site and see if there are any major differences between what the site used to look like and what it will look like after you check in.  It should ideally take less than ten minutes to go through the entire site if you didn&#8217;t mess anything up.  This is much better than using some fully automated system, because you can disregard changes that are irrelevant (for example, the changes that you presumably made for this check-in.)  I would envision the images being considerably larger so that you could see differences, but you get the idea.</p>
<p>It seems like this should be something someone has already solved.  Is there an open-source product that you know of that does something like this?  I don&#8217;t think that a solution where we allow an external service to view the pages is applicable.  Perhaps a Selenium solution of some sort, but this seems somewhat expensive to create.  One thing that would be very handy would be to be able to see the entire contents of the page (not just one vertical screen&#8217;s worth of information.)  This combats the problem where the top half of a long page looks correct but the bottom half is messed up.</p>
<p><br/><br/>Original article:  <a href="http://22ideastreet.com/blog/2009/01/21/exploratory-testing-and-visual-browser-diff/">Exploratory Testing and Visual Browser Diff</a></p>
]]></content:encoded>
			<wfw:commentRss>http://22ideastreet.com/blog/2009/01/21/exploratory-testing-and-visual-browser-diff/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Testing Seminars</title>
		<link>http://22ideastreet.com/blog/2009/01/18/testing-seminars/</link>
		<comments>http://22ideastreet.com/blog/2009/01/18/testing-seminars/#comments</comments>
		<pubDate>Mon, 19 Jan 2009 01:34:24 +0000</pubDate>
		<dc:creator>Anthony Panozzo</dc:creator>
				<category><![CDATA[External]]></category>
		<category><![CDATA[Conferences]]></category>
		<category><![CDATA[Testing]]></category>
		<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://22ideastreet.com/blog/?p=585</guid>
		<description><![CDATA[Passing along some information from Mike Kelly regarding the 2009 schedule for the Indianapolis Workshops on Software Testing (IWST.) It&#8217;s pretty short and dense, so I&#8217;ll just copy from here: We’ve posted the 2009 schedule for the Indianapolis Workshops on Software Testing. We’re looking for people willing to share experience reports and people who just [...]<p><br/><br/>Original article:  <a href="http://22ideastreet.com/blog/2009/01/18/testing-seminars/">Testing Seminars</a></p>
]]></description>
			<content:encoded><![CDATA[<p>Passing along some information from Mike Kelly regarding the 2009 schedule for the Indianapolis Workshops on Software Testing (IWST.)  It&#8217;s pretty short and dense, so I&#8217;ll just copy from <a href="http://www.michaeldkelly.com/blog/archives/248">here:</a></p>
<blockquote><p>
We’ve posted the 2009 schedule for the Indianapolis Workshops on Software Testing. We’re looking for people willing to share experience reports and people who just have a general interest in the various topics and would like to attend and ask questions.</p>
<p>Here’s a summary of the lineup:</p>
<li>February 26, 2009: Presenting test results</li>
<li>March 27, 2009: Test-driven development</li>
<li>June 27, 2009: Test design and development</li>
<li>August 28, 2009: Testing mobile devices</li>
<li>September 26, 2009: Automation and performance logging</li>
<li>October 29, 2009: Time management for testers</li>
<li>November 21, 2009: Managing your focus while doing exploratory testing</li>
<p>If you’re interested in attending any of the workshops, please drop me a line at mike@michaeldkelly.com.
</p></blockquote>
<p>I sent him an email saying that I would be interested in the March and October sessions.  Perhaps you have some interest in the same/other sessions?</p>
<p><br/><br/>Original article:  <a href="http://22ideastreet.com/blog/2009/01/18/testing-seminars/">Testing Seminars</a></p>
]]></content:encoded>
			<wfw:commentRss>http://22ideastreet.com/blog/2009/01/18/testing-seminars/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Indianapolis Conferences</title>
		<link>http://22ideastreet.com/blog/2008/12/16/indianapolis-conferences/</link>
		<comments>http://22ideastreet.com/blog/2008/12/16/indianapolis-conferences/#comments</comments>
		<pubDate>Tue, 16 Dec 2008 15:55:31 +0000</pubDate>
		<dc:creator>Anthony Panozzo</dc:creator>
				<category><![CDATA[External]]></category>
		<category><![CDATA[Conferences]]></category>
		<category><![CDATA[Performance]]></category>
		<category><![CDATA[Testing]]></category>
		<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://22ideastreet.com/blog/?p=501</guid>
		<description><![CDATA[Mike Kelly posted to the IWST news group about two upcoming group meetings that are taking place in Indianapolis. I listed them in order of perceived relevance. The first one is free, and is a day long, similar to the excellent IWST that I attended in September. The second one is not free, and lasts [...]<p><br/><br/>Original article:  <a href="http://22ideastreet.com/blog/2008/12/16/indianapolis-conferences/">Indianapolis Conferences</a></p>
]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.michaeldkelly.com/">Mike Kelly</a> posted to the IWST news group about two upcoming group meetings that are taking place in Indianapolis.  I listed them in order of perceived relevance.  The first one is free, and is a day long, similar to the excellent <a href="http://22ideastreet.com/blog/2008/10/03/iwst-summary/">IWST that I attended in September</a>.  The second one is not free, and lasts <strike>two</strike> three days.  The first one seems particularly useful, although the second might be as well.</p>
<p>I&#8217;ve edited liberally, so here goes&#8230;</p>
<h4>Workshop on Regulated Software Testing</h4>
<p><b>May 15, 2009</b></p>
<p>The WREST is coming to Indianapolis again in 2009. The topic for the workshop is &#8220;Beyond Scripted Testing.&#8221; You can learn more about the workshop <a href="http://www.wrestworkshop.com/CFP.html">here</a>.</p>
<p>&#8230;</p>
<p><b>Major Questions of Interest</b></p>
<p>How can we better test software in regulated environments while retaining processes and documentation that will pass regulatory audits?</p>
<p>How can we prove the value of implementing progressive test approaches within the context of the necessities of regulation (FDA, SOX, CMM, etc.)?</p>
<h4>Workshop on Performance and Reliability</h4>
<p><b>April <strike>16-17</strike>16-18, 2009</b></p>
<p>Through much arm twisting and whining, the WOPR 12 organizers are hosting WOPR next year here in Indianapolis. The theme for the workshop is &#8220;Resource Monitoring During Performance Testing.&#8221;</p>
<p>You can find more details <a href="http://www.performance-workshop.org/index.php?option=com_content&#038;task=view&#038;id=108&#038;Itemid=86">here</a>.</p>
<p>&#8230;</p>
<p>The ultimate goal of performance testing is identifying and fixing performance bottlenecks before production deployment.  While a large percentage of bottlenecks are ultimately traced to the application code, they may also occur in servers, system software, and network components.  Critical to identifying their source and diagnosing their root cause is monitoring the &#8220;bellwether metrics&#8221;.  Let us define &#8220;bellwether metrics&#8221; as the &#8220;key indicators of future developments or trends&#8221;, and thus the minimum set of system vitals that we should be measuring for each hardware and software component.</p>
<h4>Thoughts</h4>
<p>The process for applying to share an experience report was pretty easy.  Just have some relevant experience and know enough about it to share.  Come up with a presentation.  Kind of like a brown bag really.  If either of these two are similar in size to IWST, they are enjoyable because you get to know the people at the meeting.  If you&#8217;re jazzed about this kind of stuff, you should totally do it, for both the knowledge and the experience.</p>
<p><br/><br/>Original article:  <a href="http://22ideastreet.com/blog/2008/12/16/indianapolis-conferences/">Indianapolis Conferences</a></p>
]]></content:encoded>
			<wfw:commentRss>http://22ideastreet.com/blog/2008/12/16/indianapolis-conferences/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Introduction to Theories</title>
		<link>http://22ideastreet.com/blog/2008/10/20/introduction-to-theories/</link>
		<comments>http://22ideastreet.com/blog/2008/10/20/introduction-to-theories/#comments</comments>
		<pubDate>Mon, 20 Oct 2008 15:00:25 +0000</pubDate>
		<dc:creator>Anthony Panozzo</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Specification]]></category>
		<category><![CDATA[Testing]]></category>
		<category><![CDATA[Theories]]></category>
		<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://22ideastreet.com/blog/?p=107</guid>
		<description><![CDATA[It seems like the more I read about different development models, the more I see overlap between the different paradigms. Even if you aren&#8217;t using one of them for a given project, just knowing about all of them makes your code better because you realize how to make your code more testable. One thing that [...]<p><br/><br/>Original article:  <a href="http://22ideastreet.com/blog/2008/10/20/introduction-to-theories/">Introduction to Theories</a></p>
]]></description>
			<content:encoded><![CDATA[<p>It seems like the more I read about different development models, the more I see overlap between the different paradigms.  Even if you aren&#8217;t using one of them for a given project, just knowing about all of them makes your code better because you realize how to make your code more testable.</p>
<p>One thing that has piqued my interest of late is theories in <a href="http://junit.sourceforge.net/doc/ReleaseNotes4.4.html">JUnit 4.4+</a>.</p>
<h4>Overview</h4>
<p>In JUnit, the still experimental theory functionality is derived from the open-source <a href="http://popper.tigris.org/">Popper project</a>.  The name comes from <a href="http://en.wikipedia.org/wiki/Karl_Popper">Karl Popper&#8217;s</a> work on the philosophy of science.  He was a major proponent of saying that something isn&#8217;t scientific unless it is falsifiable, and that theories cannot be proven correct, merely shown to have exceptions.  If someone can provide an exception, it means that the theory does not match all of our observations.  Theories are models of the world, so while a model may not be correct, it can still be useful.</p>
<p>So what are theories in software good for?  When using test-driven development, the tests serve as a form of code documentation.  However, there are certain properties of code that are known or assumed by the developers that are difficult to codify as simple tests.  Theories provide a simple and expressive means for at least the following cases:</p>
<li>identities and data conversion</li>
<li>globally disallowed behavior</li>
<li>data that should be preserved after performing an operation or set of operations</li>
<p>For example, you might have a theory that data that is serialized into XML and then unserialized should always result in the original object.  This seems to make sense, but it might be time-consuming or error-prone to specify all of the different tests that you have to consider.  A single theory can codify this assumption.</p>
<p>In JUnit, theories are a special case of parameterized test.  So instead of using the standard test that has no parameters, you add parameters to make testing various combinations of values shorter and easier.  You can then take these parameterized tests further by specifying data points to test for by default in an expressive manner.</p>
<h4>Example</h4>
<p>Alright enough theory.  What does a JUnit theory actually look like?  Given that you have a theory about two methods on a Currency object that should be inverses of each other, one nice example is:</p>
<pre>
    @Theory public void multiplyIsInverseOfDivide(
            @TestedOn(ints={0, 5, 10}) int amount,
            @TestedOn(ints={1, 2, 3})  int multiplier) {
        assertThat(new Currency(amount).times(multiplier).divideBy(multiplier).getAmount(), is(amount));
    }
</pre>
<p>On the first line, we declare that we are going to postulate a theory, and give it a unique name.  This method would typically live in a test suite or test file of some sort.  The next two lines are the parameters to the test method.  The parameters are prefixed by annotations to put in sample test values.  All permutations of these values will be attempted when running the theory, and the values will be reported for any failures so we know what happened when the theory failed.  On the last line, we test that the functions are indeed inverses by invoking them and making sure that the original value is the same as the end value.</p>
<h4>Going further</h4>
<p>So big deal, we could easily just create a helper test method that does something similar and we could pass whatever values to the method that we wanted.  Well, hold on a second.  One thing I haven&#8217;t mentioned yet is that there are some nifty tools that support automatically inserting values in to test theories.  The tools automate searching the theory space for members that fit the theory assumptions but cause the theory to fail.  Something like this might be useful in detecting an off-by-one error or corner case that you hadn&#8217;t considered while implementing.  Typically for development you would just run the test cases presented with the method, and then would search the theory parameter space with spare cycles.  This enables you to have great power as well as having blazing unit tests, which is key for any test-driven development.</p>
<p>If we allow automated searching of the theory space, there is one small problem with the example theory listed above.  Can you see it?</p>
<p>The assert attempts to multiply by the multiplier and then divide by the multiplier, so a zero value for the multiplier will cause a divide by zero error.  When we use automated tools for searching the theory space, we want to say that this theory only holds when the multiplier is not zero.  We can easily do this:</p>
<pre>
    @Theory public void multiplyIsInverseOfDivide(
            @TestedOn(ints={0, 5, 10}) int amount,
            @TestedOn(ints={1, 2, 3})  int multiplier) {
        <b>assumeThat(multiplier, not(0));</b>
        assertThat(new Currency(amount).times(multiplier).divideBy(multiplier).getAmount(), is(amount));
    }
</pre>
<p>Similar expressions exist for ensuring the value is positive, and so forth.  You might create a different test or theory to show the expected behavior when the multiplier is zero.</p>
<p>I really liked the use of <a href="http://www.developer.com/java/other/article.php/3556176">Java annotations</a> to make this code considerably more readable.  You would probably need a runner of some sort to specify the values if you didn&#8217;t do it right there in the method signature.</p>
<p>It seems like there is some overlap between theories and contracts, but I won&#8217;t go into that at this time.  Theories exert positive design pressures like tests do, in that they tend to lead to leaner code that just does what the theory asks for.</p>
<h4>Extensions</h4>
<p>In Ruby on Rails, it would be nice to be able to easily test methods with multiple models that you have defined.  For example, you might have a theory:</p>
<pre>
  fixtures :users

  def test_admin_user_can_access_this_page
    login(users(:admin_user_1))
    get :this_page
    assert_response :success
  end

  # the previous test, but better
  def theory_that_admin_users_can_access_this_page(User user)
    assume(user.is_a? AdminUser)
    login(user)
    get :this_page
    assert_response :success
  end
</pre>
<p>So, instead of using just one user or manually going through a set of users, you could just specify a whole bunch of fixtures and go to town.  This might make fixtures less brittle by pointing out subtle interactions between parameters that would cause the theory to fail.  I&#8217;m not sure how the syntax would look, and I&#8217;m not sure how you could use something better than annotations in Ruby.</p>
<p>Another thing that might be nice would be to say:  I have a theory that any strings we put to the page from the database will always be escaped.  The automated theory explorer could step through the pages that you define and try once with some basic data and then start generating HTML and JavaScript garbage and ensure that nothing gets through to the users.  This might be a nice way of preventing cross-site scripting attacks (although I would imagine that there are tools that already exist for just this purpose.)</p>
<p>I looked, but could not find a Ruby plugin to handle theories.  Hmmm&#8230;  <img src='http://22ideastreet.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<h4>Further reading</h4>
<p>Some excellent resources are:<br />
<a href="http://popper.tigris.org/tutorial.html">The Popper tutorial</a><br />
<a href="http://shareandenjoy.saff.net/2006/12/new-paper-practice-of-theories.html">A great paper with examples of use and benefits</a> (see the pdf on that page)<br />
<a href="http://groups.csail.mit.edu/pag/pubs/test-theory-demo-oopsla2007.pdf">General overview of Theories in JUnit [pdf]</a></p>
<p><br/><br/>Original article:  <a href="http://22ideastreet.com/blog/2008/10/20/introduction-to-theories/">Introduction to Theories</a></p>
]]></content:encoded>
			<wfw:commentRss>http://22ideastreet.com/blog/2008/10/20/introduction-to-theories/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>IWST Summary</title>
		<link>http://22ideastreet.com/blog/2008/10/03/iwst-summary/</link>
		<comments>http://22ideastreet.com/blog/2008/10/03/iwst-summary/#comments</comments>
		<pubDate>Fri, 03 Oct 2008 15:00:05 +0000</pubDate>
		<dc:creator>Anthony Panozzo</dc:creator>
				<category><![CDATA[Notes]]></category>
		<category><![CDATA[Conferences]]></category>
		<category><![CDATA[Personal Improvement]]></category>
		<category><![CDATA[Testing]]></category>
		<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://22ideastreet.com/blog/?p=83</guid>
		<description><![CDATA[Last Friday I attended the full-day Indiana Workshops on Software Testing conference with Jen, Howard, Beth, Jeremy and about ten other people. This session was very helpful in understanding my personal knowledge of testing, learning new skills and about previously unknown technologies, and meeting people in the testing community in Indianapolis. I presented second, and [...]<p><br/><br/>Original article:  <a href="http://22ideastreet.com/blog/2008/10/03/iwst-summary/">IWST Summary</a></p>
]]></description>
			<content:encoded><![CDATA[<p>Last Friday I attended the full-day <a href="http://www.iwst2008.com/">Indiana Workshops on Software Testing</a> conference with Jen, Howard, Beth, Jeremy and about ten other people.  This session was very helpful in understanding my personal knowledge of testing, learning new skills and about previously unknown technologies, and meeting people in the testing community in Indianapolis.  I presented second, and discussed my experiences with Test-Driven Development on a recent Rails project that I worked on.</p>
<p>The first experience report probably had the most relevance to things that I have directly worked with.  In the production Rails project that I worked on, we used Selenium for automated integration testing as verification of the development process.  <a href="http://www.techdarkside.com/">Dave Christiansen</a> covered using Selenium to do automated integration testing on a Rails app.  However, what was noteworthy to me about the approach that he took was that instead of writing and executing these tests only in the test phase of the development process, they were written and executed throughout the development lifecycle.  He wrote a wrapper to <a href="http://www.techdarkside.com/generating-rspec-tests-with-selenium-ide">generate RSpec tests from the Selenium IDE</a>, refactored to DRY up the code, and then had the team write their own integration tests as they were developing.  Since the tests were written in RSpec, they would actually be run whenever code was checked in (continuous integration.)  After awhile, they built up enough helpers to stop really using Selenium at all except for replicating bugs.</p>
<p>This seems like a nice contrast to the approach that we took for two reasons.  First, integration tests would automatically keep up with the development process because the team could run these tests within their own environment.  If an integration test was broken, it would be immediately visible.  Contrast that to having to rewrite tests several days after the structure changes for no apparent reason.  Second, they ran a headless version of the Selenium Grid, which had the effect of getting their integration tests run in about five minutes.  I remember this process taking quite a bit longer for us.  Part of this was likely due to supporting IE6, IE7, and Firefox, but it seems like this still could have been sped up.</p>
<p>But overall, it&#8217;s nice to take the integration testing process and decentralize it.  This might not work with all types of projects.  Obviously having the developers in charge of their own integration tests seems like conflict of interest, but I suppose that solid reviews and other testing would reduce defects.  But depending on the project, I can see that allowing the development and test stages to work more closely together is a plus.</p>
<p>Lunch was a nice experience, it was fun hearing about some things that people have done in the past and how that affected their current views on software development and testing.</p>
<h3>Recurring themes</h3>
<p>It seemed like people liked using Ruby for data munging and actual testing.  Over half of the presentations given were using some form of Ruby for development, testing, or tools.  You could probably get away with using Perl or something for this, but you can also probably pick up most of Ruby in a couple of days if you have used Perl before.</p>
<p>There was emphasis on abstracting tests to the largest degree possible to facilitate agility of development.  This made a lot of sense to me, because one of the common pain points people expressed was having tests that were very brittle.  When the application changed, the tests had to be scrapped.   Considering testing to be a valuable software architecture practice in itself makes more sense than seeing testing as isolated.</p>
<h3>Ideas and technologies</h3>
<p>One interesting idea given in the &#8220;Open Season&#8221; part of each presentation was the idea of thumbnails for quick manual content tests.  Instead of specifying a test that used screenshots or some sort of brittle method, instead print out an expected screenshot of each of the screens and the current screenshot on a single sheet of paper.  Someone can then easily scan a whole page of these relatively quickly, as humans are naturally good at picking out differences between images and determining whether they are important or not.</p>
<p>Exploratory testing and pair testing were topics that were mentioned a few times, and I had never heard of them before.  James Bach was suggested as a resource for this and pair testing.  <a href="http://www.satisfice.com/articles.shtml">His site</a> contains some newer articles that deal with these subjects.</p>
<p>Technologies discussed included:<br />
<a href="http://www.ruby-lang.org/">Ruby</a> and <a href="http://www.rubyonrails.org/">Ruby on Rails</a><br />
<a href="http://selenium.openqa.org/">Selenium</a><br />
<a href="http://wtr.rubyforge.org/index.html">Watir</a><br />
<a href="http://rspec.info/">RSpec</a><br />
<a href="http://www.soapui.org/">soapUI</a><br />
<a href="http://groovy.codehaus.org/">Groovy</a><br />
Hammer/QTP</p>
<h3>Overall thoughts</h3>
<p>I really appreciated the constructive nature of the conference.  Everyone was very knowledgable and had something to contribute to the process.  All questions were asked kindly and there was a feeling of building on things others had said.  There was a perceptible energy in the room during the concluding processes.  People said that they were fired up to go to work on Monday and solve a problem that they had been facing using new approaches and technologies.</p>
<p>Something that stood out to me was the vast differences in terms that people had for testing practices.  Obviously I am not an expert at testing, so there were some word hangups that I had.  For example, the decision to call something a unit test versus an integration test was seemingly person-specific, if they used those terms at all.  I can see how having a good stream of communication with team members, especially new ones, is very important in testing.  Obviously this applies to software development in general.</p>
<p>While I have never been a dedicated tester before, I enjoyed the problems that people presented and their creative approaches to solving those problems.  I think that I walked out of the conference having a lot more respect for software testers because of the challenges they expressed, both technical and organizationally.</p>
<p>One <a href="http://en.wikipedia.org/wiki/Meme">meme</a> that I took away from this was the <a href="http://www.michaeldkelly.com/blog/archives/83">pirate heuristic</a>:  When you are out of ideas, steal someone else&#8217;s.  I was out of ideas, and hence stole this one myself.</p>
<p><br/><br/>Original article:  <a href="http://22ideastreet.com/blog/2008/10/03/iwst-summary/">IWST Summary</a></p>
]]></content:encoded>
			<wfw:commentRss>http://22ideastreet.com/blog/2008/10/03/iwst-summary/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
