<?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>I.M. Testy &#187; Test Case</title>
	<atom:link href="http://www.testingmentor.com/imtesty/tag/test-case/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.testingmentor.com/imtesty</link>
	<description>Treatises on the practice of software testing</description>
	<lastBuildDate>Fri, 02 Dec 2011 01:48:41 +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>Adding Variability in Test Case Design</title>
		<link>http://www.testingmentor.com/imtesty/2009/11/18/adding-variability-in-test-case-design/</link>
		<comments>http://www.testingmentor.com/imtesty/2009/11/18/adding-variability-in-test-case-design/#comments</comments>
		<pubDate>Thu, 19 Nov 2009 06:37:42 +0000</pubDate>
		<dc:creator>Bj Rollison</dc:creator>
				<category><![CDATA[Testing Practices]]></category>
		<category><![CDATA[Test Case]]></category>

		<guid isPermaLink="false">http://testingmentor.com/imtesty/2009/11/18/adding-variability-in-test-case-design/</guid>
		<description><![CDATA[Published Tuesday, October 20, 2009 I love autumn! Yes, I am definitely a boy of summer and very much prefer warmer weather; however, there is something special about autumn. This past weekend my daughter, and my 2 friends Dongyi and her husband Yuning and I participated in the Rum Run sailboat fun race with an [...]]]></description>
			<content:encoded><![CDATA[<p> Published Tuesday, October 20, 2009 <a href="http://testingmentor.com/imtesty/wp-content/uploads/2009/11/IMG_5549.jpg"><img style="border-bottom: 0px; border-left: 0px; margin: 0px 0px 0px 10px; display: inline; border-top: 0px; border-right: 0px" title="IMG_5549" border="0" alt="IMG_5549" align="right" src="http://testingmentor.com/imtesty/wp-content/uploads/2009/11/IMG_5549_thumb.jpg" width="305" height="230" /></a></p>
<p>I love autumn! Yes, I am definitely a boy of summer and very much prefer warmer weather; however, there is something special about autumn. This past weekend my daughter, and my 2 friends Dongyi and her husband Yuning and I participated in the Rum Run sailboat fun race with an overnight raft up at Bainbridge Island’s Port Madison. Saturday morning was quite rainy, but the wind was blowing 15 knots with gusts to 25 knots and NOAA weather radio announcing gale force warnings in Puget Sound. Wow…what a ride! But, it was actually the rather relaxing sail back to my marina on Sunday morning that rekindled the beauty of autumn in my mind. The bright reds, golden yellows, and pastel browns of the foliage seemed to blend into a collage framed by the darkness of the waters of Puget Sound and the snow covered peaks of the Olympic mountains. The beauty of autumn reminds me about change. A sloughing of the old, the cleansing brought about by the pure white snows, eventually followed by the new and fresh growth that blossoms in spring. </p>
<p>Just as the earth goes through variable cycles of rejuvenation, we must also continually update our tests, and (more importantly) the test data we use in our test cases to prevent them from becoming stale. Trees shed their leaves in the autumn and new leaves emerge in the spring, but the tree is fundamentally still the same tree. Similarly, a well-designed test case has a unique fundamental purpose and by changing the variables we can grow the value of that test case. Of course, the cycle of change in test data should be dramatically shorter in duration as compared to the seasonal changes of mother earth. </p>
<p>Here is a simple example of how a well-designed test case using variable test data can increase the value of the information each&#160; test iteration provides through increased confidence and also potentially reduce overall risk. In my role at Microsoft I am in a unique position to not only conduct controlled studies, but I can also implement ideas into practice on enterprise level software projects. One experiment I started about 2 years ago involved multiple groups of testers (sessions) located around the world divided into 3 separate control groups. Each control group tested the identical web page that would display the stock price if the user input a valid stock ticker symbol into a single textbox on the page and pressed the OK button. The only difference in the control groups was the instructions to perform single positive test case with the specific purpose of “ensure any valid stock ticker symbol displays the current stock price for the publicly traded stock specified by its symbol.” The purpose of the study was to determine if different cultural and experiential backgrounds impacted the test data used in a test based on the instructions for a test case. The study collected demographic information on the participants as well as specific inputs applied to the web page. Information on the oracle used by the students was collected anecdotally. Step one in each test was identical because we were not interested in how the tester launched the browser. (Of course this assumes there are other tests that test the multitude of ways to launch a browser and navigate to a URL. Also, if the browser failed to launch the test case is blocked.) </p>
<p>Group 1 was given the most vague instructions for the test case. The instruction was simply: </p>
<ol>
<li>Launch browser and navigate to [url address] </li>
<li>Enter a valid stock ticker symbol and press the OK button and verify the accuracy of the returned stock price. </li>
</ol>
<p>The instructions in the test case given to Group 2 were also somewhat vague, but provided a little guidance both on input and oracle. </p>
<ol>
<li>Launch browser and navigate to [url address] </li>
<li>Enter a valid stock ticker symbol (e.g. “MSFT”) </li>
<li>Press the OK button </li>
<li>Verify the returned stock price is identical to the current stock price listed on the appropriate exchange      </li>
</ol>
<p>Group 3 had similar instructions to Group 2, but the group was given additional guidance as indicated below. </p>
<ol>
<li>Launch browser and navigate to [url address] </li>
<li>Enter a valid stock ticker symbol from a publicly traded stock listed on any public stock exchange      <br />Listings of valid stock ticker symbols are on stock exchange web sites such as:       <br /><a href="http://www.nyse.com">http://www.nyse.com</a>      <br /><a href="http://www.eoddata.com/Symbols.aspx">http://www.eoddata.com/Symbols.aspx</a>      <br /><a href="http://www.nasdaq.com">http://www.nasdaq.com</a>      <br /><a href="http://www.londonstockexchange.com">http://www.londonstockexchange.com</a></li>
<li>Press the OK Button </li>
<li>Verify the returned stock price is identical to the current stock price listed on the appropriate exchange </li>
</ol>
<h2><strong>Results </strong></h2>
<p>The results were mostly not surprising, but rather reinforcing. For example, we expected Group 1 to be rather random, but mostly aligned with ticker symbols they were familiar with. Of course, the majority (90%) of stock ticker symbols entered was MSFT and there was no significant difference in cultural background, locale, experience or educational background. (As this study was conducted at Microsoft I am sure there was some bias as to the symbol entered.) What was most interesting was that testers with no formal training (no previous courses in testing, no CS degree, and read less than one discipline specific book) and with more than 2 years of test experience were approximately more likely (25%) to violate the purpose of the test and enter random or completely invalid data as their first action. In other words, instead of executing the required test their initial reaction was to immediately go on a bug hunt. </p>
<p>In group 2 99% of the participants simply entered the stock ticker symbol “MSFT.” But, what was even more surprising was the fact that one the next day, the same people in that group were given the same exact test, and 95% of them simply reentered MSFT. Perhaps this is laziness, perhaps this is related to the superficial nature of the study, or perhaps this is due to individuals taking the path of least resistance. The percentage of people who entered identical stock ticker symbols on consecutive days was not significantly different between group 1 and group 2. </p>
<p>It should be no surprise that group 3 had the greatest distribution of variable test data applied to the web page. Demographics had no impact on any of the people who were in group 3. The majority of people in group 3 (78%) would select the first stock exchange listed (regardless of what link it was) but there was no significant overlap in the selected stock ticker symbols. When asked to repeat the test on the next day 83% of the participants selected a different link and and a different symbol. Of those who selected the same link 97% selected a different stock ticker symbol. On the down side, approximately 4% of the people simply took the path of least resistance and input MSFT as the test data on both days of the experiment. </p>
<h2><strong>Conclusion</strong> </h2>
<p>One of the most common problems I hear about ‘scripted,’ or pre-defined test cases is that they are too prescriptive and not flexible enough to allow the tester to try things. Of course, a well-designed test case is not simply a prescriptive set of steps inputting the same hard coded test data they run over and over. So, in this study we made the assumption that a scripted test case that specified “Enter MSFT in the textbox” would simply result in the tester entering “MSFT” without any thinking on the part of the tester. Hard-coding variable test data is often times the worse possible way to design a test case. </p>
<p>Vaguely written test cases added some level of variability, but also seemed to increase the probability of the tester executing context free tests outside the scope of the purpose of the test. In fact, what we found was some testers (approx 2%) simply went on a bug hunt and never actually input a valid stock ticker symbol at all during the session. </p>
<p>A test case that provided only one example that is representative of the type of test data required for the test case produced the least desirable results in this study. I am not sure this would be the case in practice. However, based on this study if I were to outsource execution of a test case similar to that used by group 2 the only thing I could guarantee is that MSFT would definitely be tested numerous times, and the variability of other test data would be extremely limited regardless of the number of testers executing that test or the number of iterations. </p>
<p>When faced with a virtually infinite number of possibilities for input variables as test data used in either positive or negative tests we need to test as many possibilities as possible given the available resources in order to increase test coverage and reduce overall risk. So, one way increase the coverage of test data while still achieving the specific purpose of the test case is to provide useful resources that help guide the tester while relying on the tester’s creative thinking skills and curiosity to expand the test coverage. </p>
<p>Of course, we can also increase variability of test data and capture the essence of the tester’s creativity using a similar approach in a well-designed automated test case as well. In fact, a similarly designed automated test case enables us to significantly increase the amount of variable test data that is exercised in order to expand test coverage and increase overall confidence. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.testingmentor.com/imtesty/2009/11/18/adding-variability-in-test-case-design/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Prescriptive vs. Descriptive &#8216;Scripted&#8217; Tests</title>
		<link>http://www.testingmentor.com/imtesty/2009/11/18/prescriptive-vs-descriptive-scripted-tests/</link>
		<comments>http://www.testingmentor.com/imtesty/2009/11/18/prescriptive-vs-descriptive-scripted-tests/#comments</comments>
		<pubDate>Thu, 19 Nov 2009 03:55:59 +0000</pubDate>
		<dc:creator>Bj Rollison</dc:creator>
				<category><![CDATA[Testing Practices]]></category>
		<category><![CDATA[Test Case]]></category>

		<guid isPermaLink="false">http://testingmentor.com/imtesty/2009/11/18/prescriptive-vs-descriptive-scripted-tests/</guid>
		<description><![CDATA[Originally Published Tuesday, December 16, 2008 Something that raises red flags in my brain is hard-coded strings or test data in either a manual test or an automated test. Yes, I know that sometimes there are times when a test must be very prescriptive and use specific data and follow specific procedures, but I am [...]]]></description>
			<content:encoded><![CDATA[<p>Originally Published Tuesday, December 16, 2008</p>
<p>Something that raises red flags in my brain is hard-coded strings or test data in either a manual test or an automated test. Yes, I know that sometimes there are times when a test must be very prescriptive and use specific data and follow specific procedures, but I am absolutely amazed how often I see examples of test cases that are so prescriptive in the detail of execution that it completely takes any thought out of executing that test. While it can well be argued that the execution of that test might very well be a brain-dead activity, I would also argue that the person who wrote such a test also lacks creativity and generally has no clue of how to actually design a test. </p>
<p>We did a simple experiment on test design and execution. The purpose was to see if we could design a &#8216;scripted test&#8217; that provided the tester with greater freedom, cognitive engagement, and deductive reasoning. </p>
<p>The simulation in this experiment was a simple web page in which the user entered a stock ticker symbol (test data), pressed the &quot;Get Quote&quot; button, and compared the displayed result against the expected price at that time (using a real-time 3rd party stock quote monitoring system). The test was a positive test, but was written 3 different ways as illustrated below.</p>
<p>The first test was very prescriptive and was written as follows:</p>
<blockquote><p>Purpose: Verify the web page displays the most recent quote for a valid stock ticker symbol registered on a major stock exchange</p>
</blockquote>
<blockquote><p>Steps:</p>
</blockquote>
<ol>
<ol>
<li>Enter &quot;MSFT&quot; in the Stock symbol text box </li>
<li>Press the &quot;Get Quote&quot; button on the web page </li>
</ol>
</ol>
<blockquote><p>Verify: The displayed quote matches the real-time quote.</p>
</blockquote>
<p>Given this test over 95% of the subjects simply entered MSFT and looked for a result. Some did not even appear to compare the result against the real-time quote.</p>
<p>We modified the steps in the test as follows and used a second study group.</p>
<blockquote><p>Steps:</p>
<ol>
<li>Enter a valid stock ticker symbol in the Stock symbol text box (e.g. &quot;MSFT&quot;) </li>
<li>Press the &quot;Get Quote&quot; button on the web page </li>
</ol>
</blockquote>
<p>In this second session more than 75% of the the test subjects still only entered MSFT and looked for a result. On a later day in the week, we asked the same group to run the test again. Once again over 75% entered MSFT as the test data.</p>
<p>So, we modified the steps in the test once more as follows and used a third group in the experiment.</p>
<blockquote><p>Steps</p>
<ol>
<li>Enter a valid stock ticker symbol in the Stock symbol text box from a list of available stock ticker symbols at        <br />&lt;Link to NYSE&gt;         <br />&lt;Link to NASDAQ&gt;         <br />&lt;Link to S&amp;P&gt;         <br />&lt;Link to London stock exchange&gt;         <br />&lt;<em>additional links</em>&gt; </li>
<li>Press the &quot;Get Quote&quot; button or press the Enter key </li>
</ol>
</blockquote>
<p>In the third part of the experiment over 95% of the third group clicked the links and selected a stock ticker symbol at random. Some testers copied and pasted the ticker symbols from the linked web pages into the Stock symbol text box, but the majority simply entered the symbol via the keyboard. Some (less than 5%) of the participants simply entered MSFT. (Which is not really surprising since they work there!) What was more interesting was that when the same groups were given this test at a later time over 95% of the testers selected a different link and 99% selected a different stock ticker symbol. </p>
<p>This third part of the experiment essentially is the same test (proves the same hypothesis) but uses a <em>descriptive</em> &#8216;scripted&#8217; test approach. A more descriptive test can still achieve the stated purpose and provides 2 more important benefits.</p>
<ul>
<li>The purpose of the positive test (verify the web page displays the most recent quote for a valid stock ticker symbol registered on a major stock exchange) is achieved without hard-coding specific test data or specific results to check against. This means the tester has to use basic deductive reasoning in order to validate the results of the test. </li>
<li>The breadth of test data used in the test significantly increased (even if the test was executed by the same person), thus increasing the variability of each successive test and provides the tester with great freedom in selecting the data to use in each test and how to interact with the system under test. </li>
</ul>
<p>Whether or not the &quot;Get Quote&quot; button is pressed or the Enter key is pressed is tangential to the purpose of the test, so in this case it is not important what action the tester takes to send the request to the web service to get the stock quote; he or she has to trigger that event.</p>
<p>I suspect that one reason why many &#8216;scripted&#8217; tests are very prescriptive in nature is because they are written from the &quot;watch me&quot; perspective. In other words, the test is crafted from &quot;this is what I did, so that is how I will write my test&#8230;word for word.&quot; I also suspect that in many of these cases the tester really doesn&#8217;t have a clear purpose of what he or she is trying to prove or disprove, that tester is simply writing a script or developing an automated test to satisfy some thoughtless process or increase some magic number. </p>
<p>Watching a tester perform a set of steps and then recording that same set of steps in either a manual or an automated test does not constitute test design; it is a brain-dead activity. Test design is not simply watching a person perform a set of actions and &#8216;scripting&#8217; that into a &#8216;test.&#8217; And test design doesn&#8217;t mean reacting to the results of one test and thinking of another test &#8216;on-the-fly.&#8217; Designing robust tests is a separate activity from test execution. Designing a robust, <em>descriptive</em> scripted test that enhances the effectiveness of the testing effort requires incredible creativity in order to achieve its desired objective.</p>
<p>So, the next time someone tells you that scripted tests are too restrictive, impede the freedom of the tester, or limits your creativity I would suggest to you that that perspective is rather narrow-minded and limited to a vision in which &#8216;scripted&#8217; tests are all highly prescriptive in nature and result in a set of brain-dead steps. Conversely, any professional tester realizes that test design is a very creative process involving the application of your cognitive and analytical skills to help you design a test that aids you in proving or disproving your deduced hypothesis from pluralistic perspectives within the context of the situation, and to ultimately enhance the effectiveness of your testing effort.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.testingmentor.com/imtesty/2009/11/18/prescriptive-vs-descriptive-scripted-tests/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>The Purpose of a Good Test Case</title>
		<link>http://www.testingmentor.com/imtesty/2009/11/11/the-purpose-of-a-good-test-case/</link>
		<comments>http://www.testingmentor.com/imtesty/2009/11/11/the-purpose-of-a-good-test-case/#comments</comments>
		<pubDate>Wed, 11 Nov 2009 19:06:04 +0000</pubDate>
		<dc:creator>Bj Rollison</dc:creator>
				<category><![CDATA[General Testing Topics]]></category>
		<category><![CDATA[Test Case]]></category>
		<category><![CDATA[Testing]]></category>

		<guid isPermaLink="false">http://testingmentor.com/imtesty/2009/11/11/the-purpose-of-a-good-test-case/</guid>
		<description><![CDATA[Originally Published Friday, September 15, 2006 Many experts have written articles and devoted chapters of books on the attributes of what constitutes a ‘good’ test case. Unfortunately, most books repeat a common (yet limited) perspective that a good test case has a high probability of finding bugs, and Kaner goes to the extreme by stating [...]]]></description>
			<content:encoded><![CDATA[<p>Originally Published Friday, September 15, 2006</p>
<p>Many experts have written articles and devoted chapters of books on the attributes of what constitutes a ‘good’ test case. Unfortunately, most books repeat a common (yet limited) perspective that a good test case has a high probability of finding bugs, and Kaner goes to the extreme by stating “A test that did not reveal a problem was a waste of time.” I pondered this for a while and thought, if I run a test to prove that a feature functions as expected is that really a waste of time? Isn’t it a good thing that testers actually spend some time executing tests that demonstrates the product does what the customer expects it to do? Or do we simply want to restrict the value of testing and reduce our testers to keyboard monkeys who bang away at the keyboard in search of bugs? (I believe limiting the perspective of the purpose of a test in testing literature has only perpetuated the faulty assumption that the purpose of testing is to simply find bugs; <a href="http://blogs.msdn.com/imtesty/archive/2006/07/13/664118.aspx">a point I previously dismissed</a>). So, what is the purpose of a test?</p>
<p>Jorgensen states in his book,<i> Software Testing: A Craftsman’s Approach</i> that<b> </b>“a test case has two purposes: either to expose an error, or to demonstrate correct execution.” This explanation broadens the purpose of a test case to include both verifying the product meets the requirements, and revealing potential errors or defects. I tend to agree more with Jorgensen in this matter, but also think the purpose of a test case involves even more.</p>
<p>There are several objectives of any effective test whether manually executed or automated. The rationale for test case usually falls into one of seven categories. Each category provides value to the organization in different ways, but they all essentially function to reduce risk and qualify the testing effort. So, a good test provides some measurable value to the organization with the explicit purpose of:</p>
<ul>
<li>Verifying conformance to applicable standards and guidelines and customer requirements</li>
<li>Validating expectations and customer needs</li>
<li>Increasing control flow coverage</li>
<li>Increasing logic flow coverage </li>
<li>Increasing data flow coverage</li>
<li>Simulating &#8216;real&#8217; end user scenarios</li>
<li>Exposing errors or defects</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.testingmentor.com/imtesty/2009/11/11/the-purpose-of-a-good-test-case/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>

