<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>I. M. Testy : Testing</title><link>http://blogs.msdn.com/imtesty/archive/tags/Testing/default.aspx</link><description>Tags: Testing</description><dc:language>en</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Localization Testing Part IV</title><link>http://blogs.msdn.com/imtesty/archive/2009/11/12/localization-testing-part-iv.aspx</link><pubDate>Thu, 12 Nov 2009 09:53:52 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9921268</guid><dc:creator>I.M.Testy</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/imtesty/comments/9921268.aspx</comments><wfw:commentRss>http://blogs.msdn.com/imtesty/commentrss.aspx?PostID=9921268</wfw:commentRss><wfw:comment>http://blogs.msdn.com/imtesty/rsscomments.aspx?PostID=9921268</wfw:comment><description>&lt;p&gt;The past series of posts have focused on one of localization testing which describes the largest category of localization class issues reported by testers performing localization testing, and what we categorize as usability/behavioral type issues because they adversely impact the usability of the software or how end users interact with the product. This is the last post in this series, but I do intend to publish a more complete paper covering localization testing in the near future….stay tuned. This final post in this series will discuss issues that affect the layout of controls on a dialog or window and are generally referred to as clipping or truncation.&lt;/p&gt;  &lt;h3&gt;Clipping&lt;/h3&gt;  &lt;p&gt;Clipping occurs when the top or bottom portion of a control (including label controls that contain static text) is cut off and does not display the control or the control’s contents completely as illustrated below. Clipping and truncation is quite common on East Asian language versions because the default font size used in Japanese, Korean, and Chinese language versions is a 9 point font instead of the 8 point font used in English and other language versions. Clipping often occurs because developers fail to size controls adequately for larger fonts (especially common in East Asian language versions), or for display resolutions set to custom font sizes. Clipping also occurs because many localization tools are incapable of displaying a true WYSIWYG or runtime view of dialogs, requiring localizers to ‘guess’ when resizing control on dialog layouts.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/imtesty/WindowsLiveWriter/LocalizationTestingPartIV_A388/clipping_2.jpg"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="clipping" border="0" alt="clipping" src="http://blogs.msdn.com/blogfiles/imtesty/WindowsLiveWriter/LocalizationTestingPartIV_A388/clipping_thumb.jpg" width="663" height="408" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;It is possible to test for potential clipping and truncation problem areas without a localized application. English language version should function and display properly on all localized language versions of the Windows operating system. So, one way to check for potential clipping or truncation issues is to install the English language version of the application under test on an East Asian language version of the Windows operating system. Another testing method to test for potential clipping and truncation issues is to change the Windows display appearance or the custom font size via the Display Properties control panel applet.&lt;/p&gt;  &lt;p&gt;However, due to the limitations of most current localization tools inability to dynamically resized controls and dialogs, and inability to display dialogs at runtime or present a true WYSIWYG view during the localization process, the localized language versions must also be tested for clipping and truncations caused by improper sizing and layout of controls.&lt;/p&gt;  &lt;h3&gt;Truncation&lt;/h3&gt;  &lt;p&gt;Truncation is similar to clipping, but typically occurs when the right side of controls are cut off (or the left side of the controls in bi-directional displays used in Hebrew and Arabic languages) and do not completely display the entire control or the control’s contents.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/imtesty/WindowsLiveWriter/LocalizationTestingPartIV_A388/truncation_2.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="truncation" border="0" alt="truncation" src="http://blogs.msdn.com/blogfiles/imtesty/WindowsLiveWriter/LocalizationTestingPartIV_A388/truncation_thumb.png" width="671" height="443" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;h3&gt;Other Layout Issues&lt;/h3&gt;  &lt;p&gt;Because some localization tools may not provide a true ‘WYSIWYG’ display of what a dialog or property sheet will look like at runtime, occasionally resizing may cause several controls to overlap. This is especially true when dialogs contain dynamic controls that are dependent on certain configurations or machine states.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/imtesty/WindowsLiveWriter/LocalizationTestingPartIV_A388/image_2.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/imtesty/WindowsLiveWriter/LocalizationTestingPartIV_A388/image_thumb.png" width="675" height="348" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;In East Asian cultures it is common for an individual’s surname to precede the given (first) name. (It is also uncommon to have a middle name, so this field should never be required.) Therefore, the controls for name type data may need to be repositioned on dialogs in East Asian language versions. The localization team will reposition the last name label and textbox controls and the given name controls. This means that the logical tab order be reset. Also, the surname textbox control should have focus when the dialog is displayed instead of the first given name field.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/imtesty/WindowsLiveWriter/LocalizationTestingPartIV_A388/clip_image002_2.jpg"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image002" border="0" alt="clip_image002" src="http://blogs.msdn.com/blogfiles/imtesty/WindowsLiveWriter/LocalizationTestingPartIV_A388/clip_image002_thumb.jpg" width="682" height="325" /&gt;&lt;/a&gt;&lt;a href="http://blogs.msdn.com/blogfiles/imtesty/WindowsLiveWriter/LocalizationTestingPartIV_A388/clip_image002%5B5%5D.jpg"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image002[5]" border="0" alt="clip_image002[5]" src="http://blogs.msdn.com/blogfiles/imtesty/WindowsLiveWriter/LocalizationTestingPartIV_A388/clip_image002%5B5%5D_thumb.jpg" width="689" height="319" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;The tab order of controls should allow for easy, intuitive navigation of a dialog. Design guidelines suggest a tab order that changes the focus of controls from left to right and top to bottom. Focus should change between each control in a logical order, and dialogs should never have loss of tab focus’ where no control on the dialog appears to have focus.&lt;/p&gt;  &lt;p&gt;Tab order is typically problematic even in English language versions in the early lifecycle of many projects when the user interface is in flux. There is also a high probability of introducing tab order problems any time the controls on a dialog change. &lt;/p&gt;  &lt;h3&gt;All localization testing doesn’t have to be manual&lt;/h3&gt;  &lt;p&gt;In the past much of the localization testing has been repetitive manual testing. Testers would manually step through every menu item and other link to instantiate every dialog and property sheet in the program and inspect it visually and test the behavior of such things as tab order, access keys, etc. for errors. This painstaking process would be repeated multiple times during the project lifecycle on every localized language version. Unfortunately, not only was this boringly repetitive, but because the manual testers were looking at so many dialogs during the workday their eyes simply tired out leading to missed bugs. So, there must be a better way.&lt;/p&gt;  &lt;p&gt;We know that each dialog has a 2-dimensional size usually measured in pixels. Once we know the height and width of the dialog or property sheet we can measure the distance from the left most edge of the dialog to the leading edge of the first control. Using control properties such as size and location that are stored in the form’s resource file we can measure the size and position of each control on a dialog or property sheet. Once all controls are identified the distance and position of the controls can then be measured in relation to the dialog or property sheet and other controls. &lt;/p&gt;  &lt;p&gt;Using a simple example, let’s consider 1 dimension of a dialog as 250 pixels wide. The dialog contains a label control that is 15 pixels to the right of the left most edge of the dialog, and that label is 45 pixels in length. The textbox control next to the label starts at position 70, so there are 10 pixels between the right edge of the label control and the left edge of the textbox control. Now, let’s say that textbox control is 150 pixels wide. By calculating the width of the 2 controls plus the distance between the controls we can see that truncation will occur on this dialog. Similarly, we can also evaluate the relative position of controls on a dialog and detect alignment both horizontally and vertically more accurately than the human eye.&lt;/p&gt;  &lt;p&gt;Of course this is not a simple solution, but if you have thousands of dialogs and property sheets, and multiple language versions investing in an automated solution may be invaluable. One internal case study testing efficiency increased and significantly reduced manual testing and overall direct costs, and the effectiveness/accuracy of reported issues also increased. Perhaps not for everyone, but it is possible!&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9921268" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/imtesty/archive/tags/Testing/default.aspx">Testing</category><category domain="http://blogs.msdn.com/imtesty/archive/tags/Localization+Testing/default.aspx">Localization Testing</category></item><item><title>Localization Testing Part III</title><link>http://blogs.msdn.com/imtesty/archive/2009/11/03/localization-testing-part-iii.aspx</link><pubDate>Tue, 03 Nov 2009 19:36:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9916926</guid><dc:creator>I.M.Testy</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/imtesty/comments/9916926.aspx</comments><wfw:commentRss>http://blogs.msdn.com/imtesty/commentrss.aspx?PostID=9916926</wfw:commentRss><wfw:comment>http://blogs.msdn.com/imtesty/rsscomments.aspx?PostID=9916926</wfw:comment><description>&lt;P&gt;Part 1 provided an overview of localization class issues, and Part II discussed issues with non-translated strings in a localized product and gave some helpful hints to manage that problem during the software development lifecycle. In Part III I will cover various issues with access key mnemonics. An access key mnemonic is the underlined letter on a menu or control that corresponds to a key on the native keyboard layout for a particular language. &lt;/P&gt;
&lt;H2&gt;&lt;STRONG&gt;Missing &amp;amp; duplicate access key mnemonics&lt;/STRONG&gt; &lt;/H2&gt;
&lt;P&gt;Interestingly enough, most localization tools have built in tools to test for duplicate key mnemonics; however, missing or duplicate access key mnemonics is another significant issue in localization testing, and also affects the English language version as well. Duplicate or missing key mnemonics can adversely affect the usability of software because it impacts the ability of the user to easily access or invoke commonly repeated functions using the keyboard. Duplicate or missing duplicate key mnemonics can also negatively impact the software’s ability to meet certain accessibility requirements. &lt;/P&gt;
&lt;P&gt;Although missing or duplicate access key mnemonics are sometimes caused by poorly designed dialogs with an overabundance of controls, there are other factors that can cause duplicate key mnemonics. For example, some controls may dynamically appear in some dialogs in specific machine states. These dynamically generated controls may also come from a file that is different than the file which generated the dialog. Another reason for duplicate key mnemonics could also be dynamically generated key mnemonic assignments, which are especially problematic in situations where a dialog contains a mixture of statically assigned key mnemonics and dynamically generated key mnemonics.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/imtesty/WindowsLiveWriter/LocalizationTestingPartIII_6ACD/dup%20keys_2.jpg" mce_href="http://blogs.msdn.com/blogfiles/imtesty/WindowsLiveWriter/LocalizationTestingPartIII_6ACD/dup%20keys_2.jpg"&gt;&lt;IMG style="BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; WIDTH: 313px; DISPLAY: inline; HEIGHT: 369px; BORDER-TOP: 0px; BORDER-RIGHT: 0px" title="dup keys" border=0 alt="dup keys" src="http://blogs.msdn.com/blogfiles/imtesty/WindowsLiveWriter/LocalizationTestingPartIII_6ACD/dup%20keys_thumb.jpg" width=480 height=502 mce_src="http://blogs.msdn.com/blogfiles/imtesty/WindowsLiveWriter/LocalizationTestingPartIII_6ACD/dup%20keys_thumb.jpg"&gt;&lt;/A&gt; &lt;A href="http://blogs.msdn.com/blogfiles/imtesty/WindowsLiveWriter/LocalizationTestingPartIII_6ACD/missing_2.jpg" mce_href="http://blogs.msdn.com/blogfiles/imtesty/WindowsLiveWriter/LocalizationTestingPartIII_6ACD/missing_2.jpg"&gt;&lt;IMG style="BORDER-RIGHT-WIDTH: 0px; MARGIN: 5px; WIDTH: 237px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; HEIGHT: 366px; BORDER-LEFT-WIDTH: 0px" title="Missing access key mnemonics" border=0 alt="Missing access key mnemonics" src="http://blogs.msdn.com/blogfiles/imtesty/WindowsLiveWriter/LocalizationTestingPartIII_6ACD/missing_thumb.jpg" width=495 height=496 mce_src="http://blogs.msdn.com/blogfiles/imtesty/WindowsLiveWriter/LocalizationTestingPartIII_6ACD/missing_thumb.jpg"&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Manual testing for missing or duplicate key mnemonics is especially labor intensive, and finding ways to automate this testing will save countless hours of time sitting in front of a computer checking menus and dialogs. There is also a large probability of missing duplicate key mnemonic assignment problems using manual testing methods because eyes get tired, people get bored, and some keys are grayed out (as in the illustration below) or may not be present in certain machine states. Fortunately, there are several automation tools that detect duplicate key mnemonic problems and automated detection is more effective than manual test approaches. For example, &lt;A href="http://msdn.microsoft.com/en-us/library/system.windows.automation.automationelement.accesskeyproperty.aspx" target=_blank mce_href="http://msdn.microsoft.com/en-us/library/system.windows.automation.automationelement.accesskeyproperty.aspx"&gt;Automation.Element.AccessKeyProperty&lt;/A&gt; in the UIAutomation class library in C# is one approach to more efficiently test access key mnemonics.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;H2&gt;Access key mnemonic assignments&lt;/H2&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;A href="http://blogs.msdn.com/blogfiles/imtesty/WindowsLiveWriter/LocalizationTestingPartIII_6ACD/key1_2.jpg" mce_href="http://blogs.msdn.com/blogfiles/imtesty/WindowsLiveWriter/LocalizationTestingPartIII_6ACD/key1_2.jpg"&gt;&lt;IMG style="BORDER-RIGHT-WIDTH: 0px; MARGIN: 5px; WIDTH: 192px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; HEIGHT: 315px; BORDER-LEFT-WIDTH: 0px" title="Inappropriate key assignments" border=0 alt="Inappropriate key assignments" align=right src="http://blogs.msdn.com/blogfiles/imtesty/WindowsLiveWriter/LocalizationTestingPartIII_6ACD/key1_thumb.jpg" width=294 height=407 mce_src="http://blogs.msdn.com/blogfiles/imtesty/WindowsLiveWriter/LocalizationTestingPartIII_6ACD/key1_thumb.jpg"&gt;&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/imtesty/WindowsLiveWriter/LocalizationTestingPartIII_6ACD/key_2.jpg" mce_href="http://blogs.msdn.com/blogfiles/imtesty/WindowsLiveWriter/LocalizationTestingPartIII_6ACD/key_2.jpg"&gt;&lt;IMG style="BORDER-RIGHT-WIDTH: 0px; MARGIN: 5px; WIDTH: 300px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; HEIGHT: 295px; BORDER-LEFT-WIDTH: 0px" title="Inappropriate key assignments" border=0 alt="Inappropriate key assignments" align=left src="http://blogs.msdn.com/blogfiles/imtesty/WindowsLiveWriter/LocalizationTestingPartIII_6ACD/key_thumb.jpg" width=461 height=400 mce_src="http://blogs.msdn.com/blogfiles/imtesty/WindowsLiveWriter/LocalizationTestingPartIII_6ACD/key_thumb.jpg"&gt;&lt;/A&gt; As a general rule of thumb (heuristic), key mnemonics should be assigned to characters mapped to the default state of the keyboard for each particular language. For the Latin 1 family of languages, access key mnemonics should generally not be assigned to non-ASCII characters; even if that particular character is accessible on the default state keyboard layout for a particular language. Certain, access key mnemonics should never be assigned to a character glyph that is formed through combining characters used in languages such as Thai and Arabic. Also, punctuation characters should never be assigned as access key mnemonics.&lt;/P&gt;
&lt;P&gt;Of course, the default keyboard layout for many non-Latin 1 languages only contain characters in the native script for that language, and assigning non-ASCII characters as access key mnemonics may be the only choice. However, &lt;/P&gt;
&lt;P&gt;Japanese hiragana and katakana glyphs, Korean Hangeul glyphs, and all East Asian ideographic glyphs are invalid character assignments for access key mnemonics. The default keyboard layout for most East Asian languages (Japanese, Korean, Simplified Chinese, and Traditional Chinese) is the standard keyboard layout similar to the US English keyboard. In the above example, their is no way for a Japanese user to access the ‘My Computer’ (マイ コンピユータ）menu item because it is using a katakana character as an access key mnemonic (which violates several guidelines for access key mnemonic assignment). Also, the standard key mnemonic guidelines described below should be used for all East Asian language versions for consistency and backwards compatibility. &lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/imtesty/WindowsLiveWriter/LocalizationTestingPartIII_6ACD/key%202_6.jpg" mce_href="http://blogs.msdn.com/blogfiles/imtesty/WindowsLiveWriter/LocalizationTestingPartIII_6ACD/key%202_6.jpg"&gt;&lt;IMG style="BORDER-RIGHT-WIDTH: 0px; MARGIN: 5px; WIDTH: 287px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; HEIGHT: 362px; BORDER-LEFT-WIDTH: 0px" title="Inappropriate key assignments" border=0 alt="Inappropriate key assignments" align=left src="http://blogs.msdn.com/blogfiles/imtesty/WindowsLiveWriter/LocalizationTestingPartIII_6ACD/key%202_thumb_2.jpg" width=459 height=431 mce_src="http://blogs.msdn.com/blogfiles/imtesty/WindowsLiveWriter/LocalizationTestingPartIII_6ACD/key%202_thumb_2.jpg"&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/imtesty/WindowsLiveWriter/LocalizationTestingPartIII_6ACD/keys_2.jpg" mce_href="http://blogs.msdn.com/blogfiles/imtesty/WindowsLiveWriter/LocalizationTestingPartIII_6ACD/keys_2.jpg"&gt;&lt;IMG style="BORDER-RIGHT-WIDTH: 0px; MARGIN: 5px; WIDTH: 444px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; HEIGHT: 378px; BORDER-LEFT-WIDTH: 0px" title="Inappropriate key assignments in East Asian languages" border=0 alt="Inappropriate key assignments in East Asian languages" align=right src="http://blogs.msdn.com/blogfiles/imtesty/WindowsLiveWriter/LocalizationTestingPartIII_6ACD/keys_thumb.jpg" width=595 height=460 mce_src="http://blogs.msdn.com/blogfiles/imtesty/WindowsLiveWriter/LocalizationTestingPartIII_6ACD/keys_thumb.jpg"&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Another general guideline to follow for access key mnemonic assignments is to avoid the lower case Latin letters ‘g’ ‘y’ ‘p’ ‘q’ and ‘j’ because there is a high probability of confusion especially with high display resolutions especially with the letters i and l, and q and g. These letters could also be hard to discern on high resolution desktop settings as well. If the number of controls on a single dialog or in a menu list require usage of inappropriate key mnemonics, then perhaps the problem is the design of the dialog.&lt;/P&gt;
&lt;P mce_keep="true"&gt;East Asian language versions should use the identical key mnemonics as the English language version. The characters assigned as key mnemonics in the East Asian language are capitalized, enclosed within parenthesis, and positioned at the end of the translated string. Even when a key mnemonic appears within words or acronyms which are not translated or transliterated into the target the key mnemonic should be relocated to the end of the string and enclosed within parenthesis for consistency.&lt;/P&gt;
&lt;P&gt;The character assigned as the key mnemonic should be capitalized because many East Asian computer users use an English key keyboard, and for users whose native language does not frequently employ Latin characters it is much easier for those users to visually identify key mnemonics which are capitalized with keys on the keyboard which are also capital case characters.&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;H2&gt;&lt;STRONG&gt;Accelerator&amp;nbsp;Keys&lt;/STRONG&gt;&lt;/H2&gt;
&lt;P&gt;&amp;nbsp;Accelerator keys are commonly refered to as shortcut keys.&amp;nbsp; Accelerator&amp;nbsp;&lt;SPAN style="FONT-FAMILY: Tahoma; COLOR: black; FONT-SIZE: 10pt; language: en-US; mso-ascii-font-family: Tahoma; mso-fareast-font-family: +mn-ea; mso-bidi-font-family: +mn-cs; mso-color-index: 1; mso-font-kerning: 12.0pt"&gt;keys are keys (such as F1 - F12 and Esc) or key combinations (Ctrl + Shift + B, or Ctrl C)&amp;nbsp;that allow users to evoke certain functions without navigating the software menus via access keys or using the mouse to click button controls on a toolbar.&amp;nbsp;&lt;A href="http://www.roboxpress.com/technology/tips-and-tricks/windows-7-keyboard-shortcuts-accelerator-keys-hotkeys/" mce_href="http://www.roboxpress.com/technology/tips-and-tricks/windows-7-keyboard-shortcuts-accelerator-keys-hotkeys/"&gt;Here&lt;/A&gt; is&amp;nbsp;good source for common Windows accelerator keys, and &lt;A href="https://blogs.msdn.com/jensenh/archive/2006/02/14/531801.aspx" mce_href="https://blogs.msdn.com/jensenh/archive/2006/02/14/531801.aspx"&gt;here&lt;/A&gt; is one for common accelerator keys for Office products.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-FAMILY: Tahoma; COLOR: black; FONT-SIZE: 10pt; language: en-US; mso-ascii-font-family: Tahoma; mso-fareast-font-family: +mn-ea; mso-bidi-font-family: +mn-cs; mso-color-index: 1; mso-font-kerning: 12.0pt"&gt;Shortcut key combinations are common throughout all language versions. Contrary to the Wikipedia entry on the subject&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: Tahoma; COLOR: black; FONT-SIZE: 10pt; language: en-US; mso-ascii-font-family: Tahoma; mso-fareast-font-family: +mn-ea; mso-bidi-font-family: +mn-cs; mso-color-index: 1; mso-font-kerning: 12.0pt"&gt;some language versions localize the&amp;nbsp;letter key (not a mnemonic...it is not underlined). For example,&amp;nbsp; in German the Ctrl key is localized as "Strg" and, dispite it is generally frowned upon to change the&amp;nbsp;ASCII upper case letter assigned to an accelerator key combination&amp;nbsp;the Spanish versions of Office use Ctrl+G (&lt;EM&gt;Guardar&lt;/EM&gt;) for Save instead of Ctrl+S, and Ctrl+N (&lt;EM&gt;Negrita&lt;/EM&gt;) for Bold instead of Ctrl+B. Also,&amp;nbsp;letter keys&amp;nbsp;used as&amp;nbsp;part&amp;nbsp;of&amp;nbsp;an accelerator key&amp;nbsp;combination are capitalized. East Asian language versions use Ctrl to designate the Control key. Also, accelerator key combinations do&amp;nbsp;include an elipsis after the letter.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-FAMILY: Tahoma; COLOR: black; FONT-SIZE: 10pt; language: en-US; mso-ascii-font-family: Tahoma; mso-fareast-font-family: +mn-ea; mso-bidi-font-family: +mn-cs; mso-color-index: 1; mso-font-kerning: 12.0pt"&gt;&lt;IMG style="WIDTH: 244px; HEIGHT: 186px" src="http://blogs.msdn.com/photos/imtesty/images/9917775/secondarythumb.aspx" width=106 height=140 mce_src="http://blogs.msdn.com/photos/imtesty/images/9917775/secondarythumb.aspx"&gt;&amp;nbsp; &lt;IMG style="WIDTH: 284px; HEIGHT: 181px" src="http://blogs.msdn.com/photos/imtesty/images/9917774/500x282.aspx" width=284 height=181 mce_src="http://blogs.msdn.com/photos/imtesty/images/9917774/500x282.aspx"&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;In Part IV I will discuss common layout issues such as clipping and truncation.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9916926" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/imtesty/archive/tags/The+Professional+Tester/default.aspx">The Professional Tester</category><category domain="http://blogs.msdn.com/imtesty/archive/tags/Testing/default.aspx">Testing</category><category domain="http://blogs.msdn.com/imtesty/archive/tags/Localization+Testing/default.aspx">Localization Testing</category><category domain="http://blogs.msdn.com/imtesty/archive/tags/Internationalization+Testing/default.aspx">Internationalization Testing</category></item><item><title>Localization Testing – Part II</title><link>http://blogs.msdn.com/imtesty/archive/2009/10/30/localization-testing-part-ii.aspx</link><pubDate>Fri, 30 Oct 2009 19:34:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9915422</guid><dc:creator>I.M.Testy</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/imtesty/comments/9915422.aspx</comments><wfw:commentRss>http://blogs.msdn.com/imtesty/commentrss.aspx?PostID=9915422</wfw:commentRss><wfw:comment>http://blogs.msdn.com/imtesty/rsscomments.aspx?PostID=9915422</wfw:comment><description>&lt;P&gt;I should be of no surprise to anyone that localization testing generally focuses on changes in the user interface, although as mentioned in the &lt;A href="http://blogs.msdn.com/imtesty/archive/2009/10/27/localization-testing-part-1.aspx" target=_blank mce_href="http://blogs.msdn.com/imtesty/archive/2009/10/27/localization-testing-part-1.aspx"&gt;previous post&lt;/A&gt; these are not the only changes necessary to adapt a product to a specific target market. But, the most common category of localization class bug are usability or behavioral type issues that do involve the user interface. Bugs in this category generally include un-localized or un-translated text, key mnemonics, clipped or truncated text labels and other user interface controls, incorrect tab order, and layout issues. Fortunately, the majority of problems in this category do not require a fix in the software’s functional or business layer. Also, the majority of problems in this category do not require any special linguistic skills in order to identify, and in some cases, an automated approach can be even more effective than the human eye (more on that later).&lt;/P&gt;
&lt;P&gt;Perhaps the most commonly reported issue in this category is “un-localized” or un-translated textual string. Unfortunately, in many cases un-translated strings is also an over-reported problem that only serves to flood the the defect tracking database with unnecessary bugs. Translating textual strings is a demanding task, and made even more difficult when there are constant changes in the user interface or contextual meaning of messages early in the product life cycle. Over-reporting of un-translated text too early in the product cycle only serves to artificially inflate the bug count, and causes undue pressure and creates extra work for the localization team.&lt;/P&gt;
&lt;P&gt;Identifying this type of bugs is actually pretty easy. Here’s a simple heuristic; if you are testing a non-English language version in a language you are not familiar with and you can clearly read the textual string in English it is probably not localized or translated into the target language. The illustration below provides a pretty good example of this general rule of thumb. A tester doesn’t have to read German to realize that the text in the label control under the first radio button is not German.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/imtesty/WindowsLiveWriter/LocalizationTestingPartII_7C2D/1_2.jpg" mce_href="http://blogs.msdn.com/blogfiles/imtesty/WindowsLiveWriter/LocalizationTestingPartII_7C2D/1_2.jpg"&gt;&lt;IMG style="BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; WIDTH: 612px; DISPLAY: inline; HEIGHT: 392px; BORDER-TOP: 0px; BORDER-RIGHT: 0px" title=1 border=0 alt=1 src="http://blogs.msdn.com/blogfiles/imtesty/WindowsLiveWriter/LocalizationTestingPartII_7C2D/1_thumb.jpg" width=790 height=479 mce_src="http://blogs.msdn.com/blogfiles/imtesty/WindowsLiveWriter/LocalizationTestingPartII_7C2D/1_thumb.jpg"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;There are several causes of un-localized text strings to appear in dialogs and other areas of the user interface. For example:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Worse case scenario is that the string is hard-coded into the source files&lt;/LI&gt;
&lt;LI&gt;Perhaps localizers did not have enough time to completely process all strings in a particular file&lt;/LI&gt;
&lt;LI&gt;Perhaps this is a new string in a file localizers thought was 100% localized&lt;/LI&gt;
&lt;LI&gt;Strings displayed in some dialogs come from files other than the file that generates the dialog, and the localization team has not process that file&lt;/LI&gt;
&lt;LI&gt;And, sometimes (usually not often), a string may simply be overlooked during the localization process&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;Testing for un-localized text is often a manually intensive process of enumerating menus, dialogs, and other user interface dialogs, message boxes and form, and form elements.&amp;nbsp; But, if the textual strings are located in a separate resource file (as they should be), a quick scan of resource files might more quickly reveal un-translated textual strings. Of course, there is little context in the resource file, and I also hope the localization team is reviewing their own work as well prior to handing it over to test.&lt;/P&gt;
&lt;P&gt;Also, here are a few suggestions that might help focus localization testing efforts early in the project milestone and reduce the number of ‘known’ or false-positive un-translated text bugs being reported:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Ask the localization team to report the percentage of translation completion by file or module for each test build. Early in the development lifecycle only modules that are reported to be 100% complete which appear to have un-translated text should be reported as valid bugs. Of course, sometimes some strings are used in multiple modules, or may be coming from external resources. But, especially early in the development lifecycle reporting a gaggle of un-translated text bugs is simply “make work.” As the life cycle starts winding down…all strings are fair game for bug hunters!&lt;/LI&gt;
&lt;LI&gt;Testers should use tools such a Spy++ or Reflector to help identify the module or other resources, and the unique resource ID for the problematic string or resource. This is much better then than simply attaching an image of the offending dialog to a defect report. Identifying the module and the specific resource ID number allows the localization team to affect a quick fix instead of having to search for the dialog through repro steps and track down the problem.&lt;/LI&gt;
&lt;LI&gt;Also remember that not all textual strings are translated into a specific target language. Registered or trademarked product names are often not translated into different languages. In case of doubt, ask the localization team if a string that appears un-localized is a ‘true’ problem or not.&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;Unlocalized strings&amp;nbsp;usually due to hard coded strings also&amp;nbsp;tend to&amp;nbsp;occur in&amp;nbsp;menu items. This is especially true in the Windows Start menu or sub-menu items&amp;nbsp;hard-coded&amp;nbsp;in the&amp;nbsp;INF or&amp;nbsp;other installation/setup files. For example,&amp;nbsp;the image on the right&amp;nbsp;shows a common problem on European versions of Windows.&amp;nbsp;Many European language versions &amp;nbsp;localize the name of the Program Files folder, and&amp;nbsp;the menu item in the start menu. But, often times when we install an English language version of software to Windows it creates a new "Programs" menu item (and even a new Program Files directory, rather than detecting the default folder to install to.&amp;nbsp;In the&amp;nbsp;example on the left, the string Accessories is a hard-coded folder name. But, there is another issue as well. This illustrates not only a problem with&amp;nbsp;the non-translated string "Accesssories," but also shows one full-width Katakana string for 'Accessories' and another half-width string. &lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;IMG src="http://blogs.msdn.com/photos/imtesty/images/9919409/500x282.aspx" mce_src="http://blogs.msdn.com/photos/imtesty/images/9919409/500x282.aspx"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;IMG src="http://blogs.msdn.com/photos/imtesty/images/9919410/500x282.aspx" mce_src="http://blogs.msdn.com/photos/imtesty/images/9919410/500x282.aspx"&gt;&lt;/P&gt;
&lt;P&gt;In part 3 I will discuss another often problematic area in localization….key mnemonics.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9915422" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/imtesty/archive/tags/The+Professional+Tester/default.aspx">The Professional Tester</category><category domain="http://blogs.msdn.com/imtesty/archive/tags/Testing/default.aspx">Testing</category></item><item><title>Localization Testing: Part 1</title><link>http://blogs.msdn.com/imtesty/archive/2009/10/27/localization-testing-part-1.aspx</link><pubDate>Tue, 27 Oct 2009 06:00:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9913347</guid><dc:creator>I.M.Testy</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/imtesty/comments/9913347.aspx</comments><wfw:commentRss>http://blogs.msdn.com/imtesty/commentrss.aspx?PostID=9913347</wfw:commentRss><wfw:comment>http://blogs.msdn.com/imtesty/rsscomments.aspx?PostID=9913347</wfw:comment><description>&lt;P&gt;When I first joined Microsoft 15 years ago I was on the Windows 95 International team. Our team was responsible for reducing the delta between the release of the English version and the Japanese version to 90 days, and I am very proud to say that we achieved that goal and Windows 95 took Japan by storm. It was so amazing that even people without computers were lined up outside of sales outlets waiting to purchase a copy of Windows 95. The growth of personal computers in Japan shot through the roof over the next few years. Today the Chinese market is exploding, and eastern European nations are experiencing unprecedented growth as well.&amp;nbsp; While the demand for the English language versions of our software still remains high, many of our customers are demanding software that is ‘localized’ to accommodate the customers national conventions, language, and even locally available hardware. Although much of the Internets content is in English, non-English sites on the web are growing, and even &lt;A href="http://icann.org/en/announcements/announcement-2-30sep09-en.htm" target=_blank mce_href="http://icann.org/en/announcements/announcement-2-30sep09-en.htm"&gt;ICANN is considering allowing international domain names&lt;/A&gt; that contain non-ASCII characters this week in Seoul, Korea.&lt;/P&gt;
&lt;P&gt;But, a lot has changed in how we develop software to support international markets. International versions of Windows 95 were developed on a forked code base. Basically, this means the source code contained #ifdefs to instruct the compiler to compile different parts of the source code depending on the language family. From a testing perspective this is a nightmare, because if the underlying code base of a localized version is fundamentally different than the base (US English) version then the testing problem is magnified because there is a lot of functionality that must be retested. Fortunately today, much software being produced is based on a single-worldwide binary model. (I briefly explained the single world wide binary concept at a &lt;A href="http://www.sasqag.org/pastmeetings/LocalizabilityTesting.ppt" target=_blank&gt;talk&lt;/A&gt; in 1991, and Michael Kaplan talks about the advantages &lt;A href="http://blogs.msdn.com/michkap/archive/2006/05/01/587340.aspx" target=_blank mce_href="http://blogs.msdn.com/michkap/archive/2006/05/01/587340.aspx"&gt;here&lt;/A&gt;.) In a nutshell, a single worldwide binary model is a development approach in which any functionality any user anywhere in the world might need is codified in the core source code so we don’t need to modify the core code once it is compiled to include some language/locale specific functionality.&amp;nbsp; For example, it was impossible to input Japanese text into Notepad on an English version of Windows 95 using an Input Method Editor (IME); I needed the localized Japanese version. But, on the English version of Windows Xp, Vista, or Windows 7 all I have to do is install the appropriate keyboard drivers and font files and expose the IME functionality. In fact, these days I can map my keyboard to over 150 different layouts and install fonts for all defined Unicode characters on any language version of the Windows operating system. &lt;/P&gt;
&lt;P&gt;The big advantage of the single worldwide binary development model is that it allows us to differentiate between globalization testing and localization testing.&amp;nbsp; At Microsoft we define globalization as “&lt;EM&gt;the process of designing and implementing a product and/or content (including text and non-text elements) so that it can accommodate any locale market (locale).&lt;/EM&gt;” And, we define localization as “&lt;EM&gt;the process of adapting a product and/or content to meet the language, cultural and political expectations and/or requirements of a specific target market&lt;/EM&gt;.” This means we can better focus on the specific types of issues that each testing approach is most effective at identifying. For localization testing, this means we can focus on the specific things that change in the software during the “adaptation processes” to localize a product for each specific target market. &lt;/P&gt;
&lt;P&gt;The most obvious adaptation process is the ‘localization’ or actually the translation of the user interface textual elements such as menu labels, text in label controls, and other string resources that are commonly exposed to the end user. However, the translation of string resources is not the only thing that occurs during the localization process. The localization processes that are required to adapt a software product to a specific local may also include other changes such as font files and drivers installed by default, registry keys set differently, drivers to support locale specific hardware devices, etc. &lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;3 Categories of Localization Class Bugs&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;I am a big fan of developing a bug taxonomic hierarchy as part of my defect tracking database as a best practice because it better enables me to analyze bug data more efficiently. If I see a particular category of bug or a type of bug in a category that is being reported a lot, then perhaps we should find ways to prevent or at least minimize the problem from occurring later in the development lifecycle. After years of analyzing different bugs, I classified all localization class bugs into 3 categories; functionality, behavioral/usability, and linguistic quality. &lt;/P&gt;
&lt;P&gt;Functionality type bugs exposed in localized software affect the functionality of the software and require a fix in the core source code. Fortunately, with a single worldwide binary development model where the core functionality is separated from the user interface the number of bugs in this category of localization class bugs is relatively small.&amp;nbsp; Checking the appropriate registry keys are set and files are installed in a new build is reasonably straight forward and should be built into the build verification test (BVT) suite. Other types of things that should be checked include application and hardware compatibility. It is important to identify these types of problems early because they are quite costly to correct, and can have a pretty large ripple effect on the testing effort.&lt;/P&gt;
&lt;P&gt;Behavioral and usability issues primarily impact the usefulness or aesthetic quality of the user interface elements. Many of the problems in this category do not require a fix in the core functional layer of the source code. The types of bugs in this category include layout issues, un-translated text,&amp;nbsp; key mnemonic issues, and other problems that are often fixed in the user interface form design, form class, or form element properties. This category of problems often accounts for more than 90% of all localization class bugs. Fortunately, the majority of problems in this category do not require any special linguistic skills; a careful eye for detail is all that is required to expose even the most discrete bugs in this category.&lt;/P&gt;
&lt;P&gt;The final category of localization class bug is linguistic quality. This category of bugs are primarily mis-translations. Obviously, the ability to read the language being tested is required to identify most problems in this category of errors. We found testers spent a lot of time looking for this type of bug, but later found the majority of linguistic quality type issues reported were resolved as won’t fix. There are many reasons for this, but here is my position on this type of testing….Stop wasting the time of your test team to validate the linguistic quality of the product. If this is a problem then hire a new localizer, hire a team of ‘editors’ to review the work of the localizer, or hire a professional linguistic specialist from the target locale as an auditor. Certainly, if testers see an obvious gaff in a translation then we must report it; however, testers are generally not linguistic experts (even in their native tongue), and I would never advocate hiring testers simply based on linguistic skills nor as a manager would I want to dedicate my valuable testing resources on validating linguistic quality…that’s usually not where their expertise lies, and it probably shouldn’t be.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;What’s Next&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Since behavioral /usability category issues are the most prevalent type of localization class bug this series of posts will focus on localization testing designed to evaluate user interface elements and resources. The next post will expose the often single most reported bug in this category.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9913347" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/imtesty/archive/tags/The+Professional+Tester/default.aspx">The Professional Tester</category><category domain="http://blogs.msdn.com/imtesty/archive/tags/Testing/default.aspx">Testing</category></item><item><title>Adding Variability in Test Case Design</title><link>http://blogs.msdn.com/imtesty/archive/2009/10/20/adding-variability-in-test-case-design.aspx</link><pubDate>Tue, 20 Oct 2009 02:03:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9909603</guid><dc:creator>I.M.Testy</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/imtesty/comments/9909603.aspx</comments><wfw:commentRss>http://blogs.msdn.com/imtesty/commentrss.aspx?PostID=9909603</wfw:commentRss><wfw:comment>http://blogs.msdn.com/imtesty/rsscomments.aspx?PostID=9909603</wfw:comment><description>&lt;P&gt;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 &lt;A href="http://www.duckdodge.org/index.php" target=_blank mce_href="http://www.duckdodge.org/index.php"&gt;Rum Run&lt;/A&gt; 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.&lt;/P&gt;
&lt;P&gt;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.&lt;/P&gt;
&lt;P&gt;Here is a simple example of how a well-designed test case using variable test data can increase the value of the information each&amp;nbsp; 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.)&lt;/P&gt;
&lt;P&gt;Group 1 was given the most vague instructions for the test case. The instruction was simply:&lt;/P&gt;
&lt;OL&gt;
&lt;OL&gt;
&lt;LI&gt;Launch browser and navigate to [url address]&lt;/LI&gt;
&lt;LI&gt;Enter a valid stock ticker symbol and press the OK button and verify the accuracy of the returned stock price. &lt;/LI&gt;&lt;/OL&gt;&lt;/OL&gt;
&lt;P&gt;The instructions in the test case given to Group 2 were also somewhat vague, but provided a little guidance both on input and oracle.&lt;/P&gt;
&lt;OL&gt;
&lt;OL&gt;
&lt;LI&gt;Launch browser and navigate to [url address]&lt;/LI&gt;
&lt;LI&gt;Enter a valid stock ticker symbol (e.g. “MSFT”) &lt;/LI&gt;
&lt;LI&gt;Press the OK button &lt;/LI&gt;
&lt;LI&gt;Verify the returned stock price is identical to the current stock price listed on the appropriate exchange &lt;/LI&gt;&lt;/OL&gt;&lt;/OL&gt;
&lt;P&gt;Group 3 had similar instructions to Group 2, but the group was given additional guidance as indicated below.&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;OL&gt;
&lt;LI&gt;Launch browser and navigate to [url address]&lt;/LI&gt;
&lt;LI&gt;Enter a valid stock ticker symbol from a publicly traded stock listed on any public stock exchange &lt;BR&gt;&lt;BR&gt;Listings of valid stock ticker symbols are on stock exchange web sites such as: &lt;BR&gt;&lt;A href="http://www.nyse.com/" mce_href="http://www.nyse.com"&gt;http://www.nyse.com&lt;/A&gt; &lt;BR&gt;&lt;A title=http://www.eoddata.com/Symbols.aspx href="http://www.eoddata.com/Symbols.aspx" mce_href="http://www.eoddata.com/Symbols.aspx"&gt;http://www.eoddata.com/Symbols.aspx&lt;/A&gt; &lt;BR&gt;&lt;A href="http://www.nasdaq.com/" mce_href="http://www.nasdaq.com"&gt;http://www.nasdaq.com&lt;/A&gt; &lt;BR&gt;&lt;A href="http://www.londonstockexchange.com/" mce_href="http://www.londonstockexchange.com"&gt;http://www.londonstockexchange.com&lt;/A&gt; &lt;BR&gt;&lt;/LI&gt;
&lt;LI&gt;Press the OK Button &lt;/LI&gt;
&lt;LI&gt;Verify the returned stock price is identical to the current stock price listed on the appropriate exchange &lt;/LI&gt;&lt;/OL&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;STRONG&gt;Results&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;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&amp;nbsp;experience were approximately&amp;nbsp;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. &lt;/P&gt;
&lt;P&gt;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.&lt;/P&gt;
&lt;P&gt;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. &lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Conclusion&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;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. &lt;/P&gt;
&lt;P&gt;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.&lt;/P&gt;
&lt;P&gt;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.&lt;/P&gt;
&lt;P&gt;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. &lt;/P&gt;
&lt;P&gt;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.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9909603" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/imtesty/archive/tags/The+Professional+Tester/default.aspx">The Professional Tester</category><category domain="http://blogs.msdn.com/imtesty/archive/tags/Testing/default.aspx">Testing</category></item><item><title>Testing is Sampling</title><link>http://blogs.msdn.com/imtesty/archive/2009/07/16/testing-is-sampling.aspx</link><pubDate>Thu, 16 Jul 2009 09:11:21 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9835160</guid><dc:creator>I.M.Testy</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/imtesty/comments/9835160.aspx</comments><wfw:commentRss>http://blogs.msdn.com/imtesty/commentrss.aspx?PostID=9835160</wfw:commentRss><wfw:comment>http://blogs.msdn.com/imtesty/rsscomments.aspx?PostID=9835160</wfw:comment><description>&lt;p&gt;It seems it is about this time of year that I need to detach a bit from the world to reflect back on the past year and reevaluate my personal and professional goals moving forward. Perhaps I am just getting older or perhaps just a bit wiser (that is synonymous with 'sapient' for the C-D crowd), but I find it refreshing to break away this time of year to tend to my gardens, work on my boat, read some novels, and contemplate life's joys. Now, the major work projects are (almost) finished on my boat, the garden is planted and we are harvesting the early produce, and I reset both personal and professional development objectives for the next year and beyond. So, let me get back to sharing some of my ideas about testing.&lt;/p&gt;  &lt;p&gt;Many of you who read this blog also know of my website &lt;a href="http://www.TestingMentor.com"&gt;Testing Mentor&lt;/a&gt; where I post a few job aids and random test data generation tools I've created. I am a big proponent of random test data using an approach I refer to as &lt;em&gt;&lt;strong&gt;probabilistic stochastic test data&lt;/strong&gt;&lt;/em&gt;.&amp;#160; In May I was in Dusseldorf, Germany at the Software &amp;amp; Systems Quality Conference to present a talk on my approach. I especially enjoy these &lt;a href="http://www.sqs-conferences.com/index.htm" target="_blank"&gt;SQS conferences&lt;/a&gt; (now igniteQ) because the attendees are a mix of industry experts and academia, and I was looking for feedback on my approach. I call my approach probabilistic stochastic test generation because the process is a bit more complex than simple random data generation. Similar to random data generation we cannot absolutely predict a &lt;em&gt;probabilistic&lt;/em&gt; system, but we can control the feasibility of specified behaviors. And the adjective &lt;em&gt;stochastic&lt;/em&gt; simply means &amp;quot;pertaining to a process involving a randomly determined sequence of observations each of which is considered as a sample of one element from a probability distribution.&amp;quot; In a nutshell, my approach involves segregating the population into equivalence partitions, then randomly selects elements from specified parameterized equivalence partitions (which is how we know the probability of specific behaviors), finally the data may be mutated until the test data satisfies the defined fitness criteria. By combining equivalence partitioning and basic evolutionary computation (EA) concepts it is possible to generate large amounts of random test data that is representative from a virtually infinite population of possible data.&lt;/p&gt;  &lt;p&gt;One of the questions that came up during the presentation was how many random samples are required for confidence in any given test case; in other words how to we determine the number of tests using randomly generated test data? This is not an easy question to answer because the sample size of any given population depends on several factors such as:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;variability of data &lt;/li&gt;    &lt;li&gt;precision of measurement &lt;/li&gt;    &lt;li&gt;population size &lt;/li&gt;    &lt;li&gt;risk factors &lt;/li&gt;    &lt;li&gt;allowable sampling error &lt;/li&gt;    &lt;li&gt;purpose of experiment or test &lt;/li&gt;    &lt;li&gt;probability of selecting &amp;quot;bad&amp;quot; or uninteresting data &lt;/li&gt; &lt;/ul&gt;  &lt;h4&gt;&lt;strong&gt;Using sampling for equivalence class partition testing&lt;/strong&gt;&lt;/h4&gt;  &lt;p&gt;But, the question also brought to mind a parallel discussion regarding how we go about selecting elements from equivalence class partition subsets. I am adamantly opposed to hard-coding test data in a test case (automated or manual), but a colleague challenged me and said that since any element in an equivalent partition is representative of all elements in that partition then why can't we simple choose a few values from that equivalence subset. I realize this approach is done all the time by many testers; which is perhaps why we sometimes miss problems. But, hard-coding some small subset of values from a relatively large population of possible values is rarely a good idea, and is generally not the most effective approach for robust test design. One problem with hard-coding a variable is that the hard-coded value becomes static, and we know that static test data loses its effectiveness over time in subsequent tests using the same exact test data. Also, by hard-coding specific values in range of values means that we have absolutely 0% probability of including any other values in that range that are not specified. Another problem with hard-coded values stems from the selection criteria used to choose the values from a set of possible values. Typically we select values from a set based on based historical failure indicators, customer data, and our own biased judgment or intuition of ‘interesting’ values. &lt;/p&gt;  &lt;p&gt;However, the problem is that any equivalence class partition is a hypothesis that all elements are equal. Of course, the only way to validate or affirm that hypothesis is to test the entire population of the given equivalence class partition. Using customer-like values, or values based on failure indicators, and especially values we select based on our intuition are biased samples of the population, and may only represent a small portion of the entire population. Also, the number of values selected from any given equivalence partition set is usually fewer than the number required for some reasonable level of statistical confidence. So, while we definitely want to include values representative of our customers, values derived from historical failure indicators, and even our own intuition, we should also apply scientific sampling methods and include unbiased, randomly sampled values or elements from our set of values or population to help reduce uncertainty and increase confidence.&lt;/p&gt;  &lt;p&gt;For example, lets say that we are testing font size in Microsoft Word. Most font sizes range from 1pt through 1638pt and include half-sized fonts as well within that range. That is a population size of 3273 possible values. If we suspected that any value in the population had an equal probability of causing an error the standard deviation would be 50%. In this example, we would need a sample size of 343 statistically unbiased randomly selected values from the population to assert a 95% confidence level with a sampling error or precision of ±5%. Even in this situation, the number of values may appear to be quite large if the tests are manually executed which is perhaps one reason why extremely small subsets of hard-coded values fail to find problems that are exposed by other values within that equivalent partition (all too often after the software is released). Fortunately, statistical sampling is much easier and less costly with automated test cases and probabilistic random test data generation.&lt;/p&gt;  &lt;h4&gt;&lt;strong&gt;Testing is Sampling&lt;/strong&gt;&lt;/h4&gt;  &lt;p&gt;Statistical sampling is commonly used for experimentation in natural sciences as well as studies in social sciences (where I first learned it while studying sociology an anthropology). And, if we really stop to think about it; any testing effort is simply a sample of tests of the virtually impossible infinite population of possible tests. Of course, there is always the probability that sampling misses or overlooks something interesting. But, this is true of any approach to testing and explained by B. Beizer's Pesticide Paradox. The question we must ask ourselves is will statistical sampling of values in equivalence partitions or other test data help improve my confidence when used in conjunction with customer representative data, historical data, and data we intuit based on experience and knowledge?&amp;#160; Will scientifically quantified empirical evidence help increase the confidence of the decision makers?&lt;/p&gt;  &lt;p&gt;In my opinion anything that helps improve confidence and provides empirical evidence is valuable, and statistical sampling is a tool we should understand put into our professional testing toolbox. There are several well established formulas for calculating sample size that can help us establish a baseline for a desired confidence level. But, rather than belabor you with formulas, I decided to whip together a Statistical Sample Size Calculator that I posted to &lt;a href="http://ssscalculator.codeplex.com/" target="_blank"&gt;CodePlex&lt;/a&gt; and also on my &lt;a href="http://www.TestingMentor.com" target="_blank"&gt;Testing Mentor&lt;/a&gt; site to help testers determine the minimum number of samples of statistically unbiased randomly generated test data from a given equivalence partition to use in a test case to help establish a statistically reliable level of confidence. &lt;/p&gt;  &lt;p&gt;&lt;em&gt;&lt;strong&gt;Cockamamie chaos causes confusion; controlled chaos cultivates confidence!&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9835160" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/imtesty/archive/tags/The+Professional+Tester/default.aspx">The Professional Tester</category><category domain="http://blogs.msdn.com/imtesty/archive/tags/Testing/default.aspx">Testing</category><category domain="http://blogs.msdn.com/imtesty/archive/tags/Test+Tools/default.aspx">Test Tools</category></item><item><title>Better Bug Reports</title><link>http://blogs.msdn.com/imtesty/archive/2009/05/20/better-bug-reports.aspx</link><pubDate>Wed, 20 May 2009 20:58:52 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9632607</guid><dc:creator>I.M.Testy</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/imtesty/comments/9632607.aspx</comments><wfw:commentRss>http://blogs.msdn.com/imtesty/commentrss.aspx?PostID=9632607</wfw:commentRss><wfw:comment>http://blogs.msdn.com/imtesty/rsscomments.aspx?PostID=9632607</wfw:comment><description>&lt;p&gt;When we report a bug our hope is that bug is fixed. But, of course we know that isn’t always the case which is why there are usually several alternative resolutions developers, project managers, or managers may choose for resolving a bug such as postponed, won’t fix, and by design. It is unfortunately quite common to see a tester metaphorically explode into passionate fits of outrage when one of their bugs is resolved as postponed, won’t fix, or by design. It is unfortunate because these tantrums often involve the tester hurling personal insults (e.g. “How can the developer be so stupid not to fix this bug&amp;quot;?”), decrying product quality (e.g. “If we don’t fix this bug this product will totally suck!”), and playing the whiny customer card (e.g. “We will loose customers if we don’t fix this bug.”). Yes, in my early years I was also guilty of these sorts of irrational outbursts of hyperbole when a bug that I thought was important was resolved not fixed. But, of course, I quickly learned that such sophistical speculations rarely resulted in the bug being fixed, and mostly lessened my credibility with developers and managers.&lt;/p&gt;  &lt;p&gt;The other day I was speaking with a tester who was a bit miffed because the developer had resolved a few of her bugs as by design and won’t fix and she asked how she could ‘fight’ these resolutions. “Well,” I began, “Getting people to change their minds usually involves negotiation and the logical presentation of facts in a non-judgmental approach. Sometimes you will succeed, and sometimes you will not succeed. As testers surely we want all our bugs to be fixed; however, from a practical standpoint that may not always be the case especially if the bug is subjective.” I previously wrote about &lt;a href="http://blogs.msdn.com/imtesty/archive/2006/06/28/649862.aspx" target="_blank"&gt;10 common problems with bug reporting&lt;/a&gt;, but, in this case I proceeded to discuss a few strategies I use to advocate bugs.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Make it easy for the developer to fix the bug&lt;/strong&gt;&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;As a minimum a tester must provide a description of the problem, the environmental conditions in which the problem occurred (if localized to a specific environment), the shortest number of exact steps to reproduce the bug, and the actual results versus the expected results. Occasionally a screen shot may be beneficial, but mostly if there is a contrasting example. But, I will also point the developer to my test; especially if it is automated. Providing the developer an automated mechanism to reproduce a problem reduces a lot of overhead. Of course, in this case I am talking about an automated test case that runs in a few seconds, or an automated script that even assists the developer reproduce the problem quickly.&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&lt;strong&gt;Provide specific contradictions to specified and/or implied requirements or standards&lt;/strong&gt;&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;Of course, if the product design or functionality deviates from stated requirements pointing this out in a non-confrontational way is a no-brainer. The key here is our argument must be non-confrontational because sometimes we may misinterpret the requirements, and sometimes the requirements may change without us being aware of those changes. There are also occasionally deviations from implied requirements such a UI design guidelines as a result of the introduction of new technologies, or changes in how customers use the product based on usability studies. Other implied standards include competing products or previous versions of the product. In any case, when arguing for a bug fix based on specified or implied requirements I recommend using a compare and contrast type of approach to better illustrate the problem as I perceive it.&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&lt;strong&gt;Provide concrete examples of customer impact&lt;/strong&gt;&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;This is really important! Providing a real world scenario that clearly illustrates not only how this bug will manifest itself to the customer, but also providing corroborating evidence from customers presents a strong case in favor of a bug fix. There are several useful repositories of customer feedback testers can use to bolster their point of view such as newsgroups, popular blogs, trade journal reviews of past or similar products, at Microsoft we also have Watson and SQM data, and product support reports. Using ‘real-world’ constructive feedback is often more meaningful than an internal mutiny by a portion of the test team.&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&lt;strong&gt;Know your primary target customer profile&lt;/strong&gt;&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;Testers often like to think we are representative of our customers. However, this may not always be the case. (It has always puzzled me as to why testers seem to think they have some greater affinity to the end user customer as compared to others on the product team.) Yes, it is important that testers understand who the primary target customer is for the current project or release and that is why many teams have detailed personas of primary, secondary, and sometimes even tertiary customer audiences. Of course, if we are in the commercial software business we want our customer base to be as large as possible. But, as the number of customers increase so does the diversity of value, and as they say…you can never please everyone! So, when defending your position to fix a particular bug it is always better to frame the discussion from the point of view of the primary customer persona as compared to your own personal bias.&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&lt;strong&gt;Use your brain, not your emotions&lt;/strong&gt;&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;Passion has long been an admired trait in software testers. However, unbridled passion fraught with antagonistic accusations can be detrimental to a successful bug resolution (and sometimes even a career). Some bugs obviously need to be fixed, while others may be more dependent on several mitigating (and competing) factors such as where you are in the software lifecycle, business impact, primary customer impact, risk, etc. I think it is largely agreed that perhaps the primary role of testers is to provide information, but that means we must also gather the pertinent information and represent that information logically within the relevant context to the management team (or decision makers). Remember…reckless rants rarely render reasonable results! &lt;/p&gt;&lt;/blockquote&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9632607" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/imtesty/archive/tags/The+Professional+Tester/default.aspx">The Professional Tester</category><category domain="http://blogs.msdn.com/imtesty/archive/tags/Testing/default.aspx">Testing</category></item><item><title>Exploratory testing inside the box</title><link>http://blogs.msdn.com/imtesty/archive/2009/03/20/exploratory-testing-inside-the-box.aspx</link><pubDate>Fri, 20 Mar 2009 11:24:39 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9492020</guid><dc:creator>I.M.Testy</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/imtesty/comments/9492020.aspx</comments><wfw:commentRss>http://blogs.msdn.com/imtesty/commentrss.aspx?PostID=9492020</wfw:commentRss><wfw:comment>http://blogs.msdn.com/imtesty/rsscomments.aspx?PostID=9492020</wfw:comment><description>&lt;p&gt;Much of the information about exploratory testing focuses on testing from an end-user perspective. Pundits of exploratory testing claim the approach is also useful from a white box test design approach, but I have yet to see any practical discussion or examples. But, professional testers use exploratory testing approaches all the time from a white box perspective to explore the code for untested paths. Professional testers learn about areas of the code that are at risk, and reactively design effective tests to evaluate previously untested or under-tested areas of the code.&lt;/p&gt;  &lt;p&gt;Let's use a simple example to get started. Suppose we had to drive from Lynnwood, Washington to Puyallup, Washington without a map or (GPS auto navigation system). Just as we have 'clues' to point us in the various directions while performing exploratory testing at the user interface we have the numerous highway signs to help us navigate various routes to complete our journey. And, it is up to us to decide which route to take. The shortest route is I-405 south to SR-167. But, I-405 is always at a stand-still, so another popular route is I-5 to SR-18 east then SR-167 south. Of course, after traversing those routes a couple of times the scenery (and crawling in traffic) gets a bit boring, so we might find additional less travelled routes. But, regardless of how many times we make the journey or how many different drivers we choose to complete this journey it is highly unlikely that we will traverse every possible route in any reasonable amount of time. Some routes may not be obvious such as I-5 south to Seattle, then taking the ferry from Seattle to Bremerton and continuing to SR-310 south to SR-16, then I-5 north to SR-167. And, of course some routes are impossible (or at least so convoluted they would be improbable).&lt;/p&gt;  &lt;p&gt;&lt;img title="map" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="782" alt="map" src="http://blogs.msdn.com/blogfiles/imtesty/WindowsLiveWriter/StructuralExploration_143D6/map_thumb.jpg" width="635" border="0" /&gt; &lt;/p&gt;  &lt;p&gt;Fortunately, control flow through even complex algorithms is not as labyrinthine as the state roadways in western Washington. And, just as the department of transportation uses various tools to measure traffic volumes testers can use path profiling tools to measure frequently traversed paths through the code. We can also use code coverage tools to see what paths have or have not been traversed, and which decisions are made at branching statements. Using code coverage and profiling tools to map control flow through the algorithm we are able to more thoroughly explore the code. Using our 'map' we can learn what paths have not been traversed and even whether or not certain paths through the code are even possible. After we explore the 'map' we can more effectively design additional tests to traverse un-tested paths through an algorithm. Common structural test design techniques include&amp;#160; to evaluate code statements, code blocks, simple decisions or branches, or multiple Boolean conditional clauses in a single predicate statement. Then, using those test designs we can execute those tests either using stubs or mock objects at the unit or component level, or through the user interface to traverse those paths to reduce overall susceptibility to risk.&lt;/p&gt;  &lt;p&gt;I discuss the various techniques commonly used in structural testing in Chapter 6 of our book &lt;em&gt;&lt;a href="http://www.amazon.com/How-We-Test-Software-Microsoft/dp/0735624259" target="_blank"&gt;How We Test Software At Microsoft&lt;/a&gt;&lt;/em&gt;, and also address the subject &lt;a href="http://blogs.msdn.com/imtesty/archive/2007/08/14/code-coverage-is-inversely-proportional-to-the-critical-information-it-provides.aspx" target="_blank"&gt;here&lt;/a&gt;, and &lt;a href="http://blogs.msdn.com/imtesty/archive/2009/03/06/basic-blocks-aren-t-so-basic.aspx" target="_blank"&gt;here&lt;/a&gt;. Of course, the application of structural techniques is usually referred to as code coverage analysis. But, using this simple analogy hopefully other testers can begin to understand how exploratory testing approaches are used not only from the user interface, but also below the GUI at the code level. As Boris Beizer initially stated, &amp;quot;all testing is essentially exploratory in nature,&amp;quot; and code coverage analysis (analyzing code coverage results to learn about, design additional tests, then execute those tests) also makes great use of exploratory approaches inside the box.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9492020" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/imtesty/archive/tags/The+Professional+Tester/default.aspx">The Professional Tester</category><category domain="http://blogs.msdn.com/imtesty/archive/tags/Testing/default.aspx">Testing</category></item><item><title>Basic Blocks Aren't So Basic</title><link>http://blogs.msdn.com/imtesty/archive/2009/03/06/basic-blocks-aren-t-so-basic.aspx</link><pubDate>Fri, 06 Mar 2009 09:51:08 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9461895</guid><dc:creator>I.M.Testy</dc:creator><slash:comments>7</slash:comments><comments>http://blogs.msdn.com/imtesty/comments/9461895.aspx</comments><wfw:commentRss>http://blogs.msdn.com/imtesty/commentrss.aspx?PostID=9461895</wfw:commentRss><wfw:comment>http://blogs.msdn.com/imtesty/rsscomments.aspx?PostID=9461895</wfw:comment><description>&lt;p&gt;In the book &lt;a href="http://www.amazon.com/exec/obidos/ASIN/0735624259/compendiumdev-20" target="_blank"&gt;&lt;em&gt;How We Test Software at Microsoft&lt;/em&gt;&lt;/a&gt; I discuss structural testing techniques. Structural testing techniques are systematic procedures designed to analyze and evaluate control flow through a program. These are classic white box test design techniques, although my friend and respected colleague &lt;a href="http://www.eviltester.com/index.php/about/" target="_blank"&gt;Alan Richardson&lt;/a&gt; states in his review of the book that he also &lt;a href="http://www.compendiumdev.co.uk/blog/index.php/2009/02/04/book-review-how-we-test-software-at-microsoft/" target="_blank"&gt;employs similar techniques on models&lt;/a&gt; and I have to agree with him on that point.&lt;/p&gt;  &lt;p&gt;Also, Peter M. sent me mail pointing out a reasonably obvious bug in the code chunks on pages 118 and 119. Both functions are declared as static void, but each has a return statement. Somehow this oversight made it through the review process, but of course a return statement in a function declared as static void would cause a compiler error. (Thanks for discovering that bug Peter and letting us know so we can fix it for the 2nd edition!) &lt;/p&gt;  &lt;p&gt;Peter also asked for further clarification of how blocks are counted, and why a test that evaluated both conditional clauses in the compound expression as true in the below example (and on page 119) results in 85.71% coverage. Unfortunately, the answer for that is not simple. &lt;/p&gt;  &lt;h1&gt;Some surprising details…&lt;/h1&gt;  &lt;div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; background-color: #f4f4f4"&gt;   &lt;div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;     &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; BlockExample1(&lt;span style="color: #0000ff"&gt;bool&lt;/span&gt; cond_1, &lt;span style="color: #0000ff"&gt;bool&lt;/span&gt; cond_2)&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   2:&lt;/span&gt; {&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   3:&lt;/span&gt;   &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; x = 0, y = 0, z = 0;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   4:&lt;/span&gt;   &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (cond_1 &amp;amp;&amp;amp; cond_2)&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   5:&lt;/span&gt;   {&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   6:&lt;/span&gt;     x = 1;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   7:&lt;/span&gt;     y = 2;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   8:&lt;/span&gt;     z = 3;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   9:&lt;/span&gt;   }&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  10:&lt;/span&gt;   &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; x + y + z;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  11:&lt;/span&gt; }&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;The above code can be re-written as:&lt;/p&gt;

&lt;div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; height: 250px; background-color: #f4f4f4"&gt;
  &lt;div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;
    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; BlockExample2(&lt;span style="color: #0000ff"&gt;bool&lt;/span&gt; cond_1, &lt;span style="color: #0000ff"&gt;bool&lt;/span&gt; cond_2)&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   2:&lt;/span&gt; {&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   3:&lt;/span&gt;   &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; x = 0, y = 0, z = 0;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   4:&lt;/span&gt;   &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (cond_1)&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   5:&lt;/span&gt;   {&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   6:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (cond_2)&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   7:&lt;/span&gt;     {&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   8:&lt;/span&gt;       x = 1;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   9:&lt;/span&gt;       y = 2;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  10:&lt;/span&gt;       z = 3;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  11:&lt;/span&gt;     }&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  12:&lt;/span&gt;   }&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  13:&lt;/span&gt;   &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; x + y + z;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  14:&lt;/span&gt; }&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;First, a 'basic block' is defined as a set of contiguous executable statements with no logical branches which seems pretty straight forward. So, based on our definition of basic blocks it appears there are 4 blocks of contiguous statements. However, the conditional clauses on line 4 and line 6 in the BlockExample2 method introduce logical branches which theoretically introduce 2 implicit blocks (e.g. one block when control flow follows the true path, and another block when control flow follows the false path). So, that is essentially how the 6 blocks are determined. But, that's not the end of the story.&lt;/p&gt;

&lt;p&gt;If we pass a Boolean true to both cond_1 and cond_2 conditional clauses the block coverage measure in BlockExample1 results in 85.71% coverage; however, the block coverage measure for BlockExample2 actually results in 100% coverage as illustrated below.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/imtesty/WindowsLiveWriter/ed1c2ebc6677_79E3/coverage_2.jpg"&gt;&lt;img title="coverage" style="border-top-width: 0px; display: block; border-left-width: 0px; float: none; border-bottom-width: 0px; margin-left: auto; margin-right: auto; border-right-width: 0px" height="235" alt="coverage" src="http://blogs.msdn.com/blogfiles/imtesty/WindowsLiveWriter/ed1c2ebc6677_79E3/coverage_thumb.jpg" width="715" border="0" /&gt;&lt;/a&gt; What? How can this be? Both BlockExample1 and BlockExample2 are syntactically identical. Well, to understand this we would really need to dig deeper into compilers and coverage tools. That is well beyond the boundaries of this blog, but the IL does provide some insight.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/imtesty/WindowsLiveWriter/ed1c2ebc6677_79E3/msil_2.jpg"&gt;&lt;img title="msil" style="border-top-width: 0px; display: block; border-left-width: 0px; float: none; border-bottom-width: 0px; margin-left: auto; margin-right: auto; border-right-width: 0px" height="677" alt="msil" src="http://blogs.msdn.com/blogfiles/imtesty/WindowsLiveWriter/ed1c2ebc6677_79E3/msil_thumb.jpg" width="727" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;The MSIL for BlockExample1 is on the left and BlockExample2 is on the right. Now, I don't want to do a deep dive into MSIL, but&amp;#160; those who are really observant can see that for some reason the Visual Studio compiler evaluated a branch in BlockExample1 to false (instruction IL_0008), and then instruction IL_000c compares the 2 values for equality and instruction IL_0015 appears to evaluate the optimized compound conditional expression to true. Compare that to BlockExample2 MSIL which shows the first comparison of 2 values occurs at IL_0009 and the branch is evaluated as true (IL_000f) and the second comparison of 2 values occurs at IL_0014 and again evaluates to true at instruction IL_001a. &lt;/p&gt;

&lt;p&gt;But wait…it gets even more confusing. We typically measure structural coverage using the debug build. So, imagine my surprise when I recompiled the code using the retail build settings and again passed true arguments to the cond_1 and cond_2 parameters for BlockExample1 and BlockExample2 and the coverage tool in Visual Studio indicated these methods now only had 4 blocks, and the block coverage measure for both methods was 100% as illustrated below. &lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/imtesty/WindowsLiveWriter/ed1c2ebc6677_79E3/coverage2_2.jpg"&gt;&lt;img title="coverage2" style="border-right: 0px; border-top: 0px; display: block; float: none; margin-left: auto; border-left: 0px; margin-right: auto; border-bottom: 0px" height="207" alt="coverage2" src="http://blogs.msdn.com/blogfiles/imtesty/WindowsLiveWriter/ed1c2ebc6677_79E3/coverage2_thumb.jpg" width="694" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Also, interestingly enough the compiler optimized the code so both methods had identical MSIL op code instructions as illustrated below.&lt;a href="http://blogs.msdn.com/blogfiles/imtesty/WindowsLiveWriter/ed1c2ebc6677_79E3/be2_2.jpg"&gt;&lt;img title="be2" style="border-right: 0px; border-top: 0px; display: block; float: none; margin-left: auto; border-left: 0px; margin-right: auto; border-bottom: 0px" height="513" alt="be2" src="http://blogs.msdn.com/blogfiles/imtesty/WindowsLiveWriter/ed1c2ebc6677_79E3/be2_thumb.jpg" width="674" border="0" /&gt;&lt;/a&gt;Steve Carroll (a senior developer in Visual Studio) &lt;a href="http://blogs.msdn.com/scarroll/archive/2005/01/14/353427.aspx" target="_blank"&gt;wrote&lt;/a&gt; we &amp;quot;&lt;em&gt;shouldn't be too concerned if you can't exactly identify where all the blocks are.&amp;#160; When you turn the optimizer on your binary, block counts are fairly unpredictable&lt;/em&gt;. &lt;em&gt;Don't worry though, the source line coloring will almost always lead you to the parts of the code that you need to worry about targeting to get your coverage stats up.&lt;/em&gt;&amp;quot;&lt;/p&gt;

&lt;p&gt;I agree with Steve when he states block counts are unpredictable when the code is optimized (and different tools that measure block coverage may provide different results). However, I only partially with his statement that source line coloring leading us to parts of the code we need to test. Maybe it will, maybe it won't. But, professional testers performing an in-depth analysis of code coverage results will help us identify important parts of the code that require further investigation and testing.&lt;/p&gt;

&lt;h1&gt;&lt;strong&gt;So, what does it all mean?&lt;/strong&gt;&lt;/h1&gt;

&lt;p&gt;Block testing is useful for unit testing and designing white box tests for switch statements and exception handlers (based on how we can track control flow through source code using a debugger as opposed to through the IL Disassembler). But, as I stated in &lt;em&gt;&lt;a href="http://www.amazon.com/exec/obidos/ASIN/0735624259/compendiumdev-20" target="_blank"&gt;How We Test Software at Microsoft&lt;/a&gt;&lt;/em&gt; block testing is the weakest form of structural testing. But, it does provide a different perspective as compared to other structural approaches or techniques and is useful when used by a professional tester in the right context.&lt;/p&gt;

&lt;p&gt;But, the important point here is that just as we wouldn't rely on only one tool to tune the carburetor on an automobile, we certainly would rely on only one technique or approach for designing structural tests; and we certainly wouldn't only rely on structural testing as a single approach to testing. This example further reinforces another important point that I make in the book; code coverage is not directly related to quality. Any professional tester can clearly see that although we are able to achieve high levels of coverage with one test, these methods are not at all well tested. &lt;/p&gt;

&lt;p&gt;Only a fool would use code coverage metrics to derive some measure of quality, or suggest the implication that high coverage measures equal greater quality. In truth, the value of code coverage is in its ability to help professional testers identify areas of the code that have not been previously exercised and to design tests to evaluate those areas of the code more effectively to help reduce overall risk. &lt;/p&gt;

&lt;p&gt;If we don't execute an area of code then we have zero probability of exposing errors in that code if they exist. However, just because we do execute a code statement doesn't mean we expose all potential errors. But, it at least increases the probability from 0% and helps reduce risk.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9461895" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/imtesty/archive/tags/The+Professional+Tester/default.aspx">The Professional Tester</category><category domain="http://blogs.msdn.com/imtesty/archive/tags/Testing/default.aspx">Testing</category></item><item><title>Troubleshooting Test Data with String Decoder</title><link>http://blogs.msdn.com/imtesty/archive/2009/02/25/troubleshooting-test-data-with-string-decoder.aspx</link><pubDate>Wed, 25 Feb 2009 13:12:51 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9443867</guid><dc:creator>I.M.Testy</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/imtesty/comments/9443867.aspx</comments><wfw:commentRss>http://blogs.msdn.com/imtesty/commentrss.aspx?PostID=9443867</wfw:commentRss><wfw:comment>http://blogs.msdn.com/imtesty/rsscomments.aspx?PostID=9443867</wfw:comment><description>&lt;p&gt;I value static test data that is derived from historical failure indicators, or representative of typical end-users. But, of course a problem with static test data is that it only provides a limited set of all possible data, and becomes stale or provides little new information after multiple iterations of the test. So, I am a proponent of using random data in well-designed tests. Of course, recklessly generating random data is just plain dumb and potentially results in numerous false positives. But, when the data set is well defined and decomposed into equivalence class subsets then it is possible to generate random data that is representative of all possible data elements; probabilistic stochastic test data!&lt;/p&gt;  &lt;p&gt;Last week I released an update to the test tool &lt;a href="http://www.testingmentor.com/tools/tools_pages/babel.htm" target="_blank"&gt;Babel&lt;/a&gt; for generating random strings of Unicode characters. Babel is a useful tool for comprehensive positive or negative testing of a textbox and other edit controls, and API parameters that take string arguments. Using probabilistic stochastic test data significantly increases the breadth of data coverage during a test cycle which increases the probability of exposing anomalies in string parsing and other string manipulation algorithms. But, when using characters from across the Unicode spectrum anomalies are usually caused by a specific character code point (or code points for surrogate pair characters), or combinations of characters. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/imtesty/WindowsLiveWriter/DecodingTestStrings_E10C/image_2.png"&gt;&lt;img title="image" style="border-right: 0px; border-top: 0px; display: inline; margin-left: 0px; border-left: 0px; margin-right: 0px; border-bottom: 0px" height="469" alt="image" src="http://blogs.msdn.com/blogfiles/imtesty/WindowsLiveWriter/DecodingTestStrings_E10C/image_thumb.png" width="288" align="left" border="0" /&gt;&lt;/a&gt;Of course, telling a developer that a string composed of the characters ꁲᱚRבּ䍳㄁܁쭤࿦ኳ causes an unexpected error would most likely be met with that classic deer in headlights look followed by some muttering such as &amp;quot;That's not a real string&amp;quot; and &amp;quot;nobody would ever enter such a string.&amp;quot; Often times developers are likely to shun random strings as test data, and managers might claim it is not representative of 'real' customer scenarios. So, the professional tester knows that instead of simply arguing in favor of random string testing we must troubleshoot the string to identify the specific character code point or code point combination causing the error. Because while a 'real' customer may not likely enter a string of random characters from multiple language scripts, the problem is likely caused by a single character (and sometimes the combination of character code points), and there is some probability of a customer somewhere in the world entering that problematic character! So, as professional's we must find that specific problematic character.&lt;/p&gt;  &lt;p&gt;To help professional testers decode each character in a string to its code point value I recently completed a new tool called &lt;a href="http://www.testingmentor.com/tools/tools_pages/str2val.htm" target="_blank"&gt;String Decoder&lt;/a&gt;. This test tool is an updated version of my old Str2Val tool (which had some serious problems when converting strings with surrogate pair characters). &lt;a href="http://www.testingmentor.com/tools/tools_pages/str2val.htm" target="_blank"&gt;String Decoder&lt;/a&gt; will decode Unicode characters (including surrogate pairs) to their hexadecimal UTF-16 (Big or Little Endian), UTF-8, UTF-7 encoding values, or an integer value (UTF-32).&lt;/p&gt;  &lt;p&gt;For example the characters in the string んޏ᠘㎝Xᔲ뉞ဵ have UTF-16 Big Endian encoding values displayed in the Results list in the image.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt; Once the specific character code point or combination is identified, the tester can now tell the developer exactly what Unicode character or integer value is causing the anomaly. For example, it is much better to state a Unicode value of U+13BD is causing unexpected functionality as compared to trying to explain how to input the Cherokee letter MU or saying &amp;quot;just enter this character&amp;#160; Ꮍ.&amp;quot;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;String Decoder can also be used to compare different Unicode transformation format encodings, or convert between Unicode hex values and 32-bit integer values of characters.&lt;/p&gt;  &lt;p&gt;Let me know what you think!&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9443867" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/imtesty/archive/tags/The+Professional+Tester/default.aspx">The Professional Tester</category><category domain="http://blogs.msdn.com/imtesty/archive/tags/Testing/default.aspx">Testing</category><category domain="http://blogs.msdn.com/imtesty/archive/tags/Test+Tools/default.aspx">Test Tools</category></item><item><title>Random string generation…Update!</title><link>http://blogs.msdn.com/imtesty/archive/2009/02/17/random-string-generation-update.aspx</link><pubDate>Tue, 17 Feb 2009 09:58:49 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9427186</guid><dc:creator>I.M.Testy</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/imtesty/comments/9427186.aspx</comments><wfw:commentRss>http://blogs.msdn.com/imtesty/commentrss.aspx?PostID=9427186</wfw:commentRss><wfw:comment>http://blogs.msdn.com/imtesty/rsscomments.aspx?PostID=9427186</wfw:comment><description>&lt;p&gt;One of the biggest challenges in input testing is the sheer amount of potential characters and the virtually infinite number of permutations of those characters in different character positions in a string. Even if we know about the myriad of language scripts used throughout the world, manually generating characters from multiple language groups would be excruciatingly inefficient. &lt;/p&gt;  &lt;p&gt;Since any modern application should support Unicode character we can assert the strings “abcdefg” and “ڄƥ藖꼩昨”are equivalent for most input testing requiring a Unicode string. So, random string test data generation is useful for easily increasing the breadth of test data tested, and also for testing the robustness of the applications ability to process complex data streams. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.testingmentor.com/tools/tools_pages/babel.htm" target="_blank"&gt;Babel 2.0&lt;/a&gt; is a free test tool, and one of the few random string generators that can generate a string of character across the entire Unicode spectrum, since its initial release in 2006 it has been widely popular. So, I am happy to announce that an updated &lt;a href="http://www.testingmentor.com/tools/tools_pages/babel.htm" target="_blank"&gt;Babel 2.0&lt;/a&gt; is released! I know this constitutes a shameless plug…but, sometimes it helps to plug tools we’ve made that can benefit other testers or developers.&lt;/p&gt;  &lt;p&gt;Unlike many string generators that only produce a string of random ASCII characters, Babel can produce a string of random Unicode characters defined in the Unicode 5.1 specification, including surrogate pair characters (which often expose problems in various text boxes…hint, hint). Additional updates to Babel 2.0 include:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Updated to the Unicode 5.1 spec (including new script groups and character code points)&lt;/li&gt;    &lt;li&gt;Ability to include/exclude combining character code points &lt;/li&gt;    &lt;li&gt;Ability to include/exclude reserved NetBIOS characters&lt;/li&gt;    &lt;li&gt;Custom range allows character generation from 0x01 through 0xFFFF.&lt;/li&gt;    &lt;li&gt;Ability to generate strings with a max length of 100,000 characters&lt;/li&gt;    &lt;li&gt;Improved distribution of characters from the selected language script groups&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;The following illustration provides a basic flow diagram of how Babel generates random strings. Essentially, one script group is randomly selected from all selected script group nodes, and all code points assigned to that script group are put into a collection. Next, one character is randomly selected from that collection and is appended to a string. This process continues until the string length equals a specified number of characters.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/imtesty/WindowsLiveWriter/RandomstringgenerationUpdate_14310/Babel_4.jpg"&gt;&lt;img title="Babel" style="border-right: 0px; border-top: 0px; display: block; float: none; margin-left: auto; border-left: 0px; margin-right: auto; border-bottom: 0px" height="246" alt="Babel" src="http://blogs.msdn.com/blogfiles/imtesty/WindowsLiveWriter/RandomstringgenerationUpdate_14310/Babel_thumb_1.jpg" width="635" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Better distribution of character selection across multiple script groups occurs by preventing the same script group from being selected before at least ½ of the other specified groups are selected. This means that as long as more than one script group node is selected the selected group of characters will be removed from the random selection process until at least half of the other script groups are chosen. This provides a greater distribution as compared to simple random generation.&lt;/p&gt;  &lt;p&gt;The download also includes the Babel.DLL (and the dependent UnicodeData.DLL) for test automation. The older methods are deprecated and no longer supported. The new methods have been simplified and now include:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;public static string Polyglot (int, int, bool, bool, bool, bool, bool)     &lt;br /&gt;Returns a string of random Unicode characters in all Unicode script groups based on a specified seed value.&lt;/p&gt; &lt;/blockquote&gt;  &lt;blockquote&gt;   &lt;p&gt;public static string Polyglot (int, bool, bool, bool, bool, bool, out int)     &lt;br /&gt;Generates a random seed value and returns a string of random Unicode string of characters in all Unicode script groups, and passes a reference to the seed value.&lt;/p&gt; &lt;/blockquote&gt;  &lt;blockquote&gt;   &lt;p&gt;public static string Polyglot ( int, int, bool, bool, bool, bool, bool, char, char)     &lt;br /&gt;Returns a string of random Unicode string of characters in all Unicode script groups based on a specified seed value&lt;/p&gt; &lt;/blockquote&gt;  &lt;blockquote&gt;   &lt;p&gt;public static string Polyglot (int, bool, bool, bool, bool, bool, char, char, out int)     &lt;br /&gt;Generates a random seed value and returns a string of random Unicode string of characters in all Unicode script groups, and passes a reference to the seed value.&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Get the new release of &lt;a href="http://www.testingmentor.com/tools/tools_pages/babel.htm" target="_blank"&gt;Babel 2.0&lt;/a&gt; !&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9427186" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/imtesty/archive/tags/Test+Automation/default.aspx">Test Automation</category><category domain="http://blogs.msdn.com/imtesty/archive/tags/The+Professional+Tester/default.aspx">The Professional Tester</category><category domain="http://blogs.msdn.com/imtesty/archive/tags/Testing/default.aspx">Testing</category><category domain="http://blogs.msdn.com/imtesty/archive/tags/Test+Tools/default.aspx">Test Tools</category></item><item><title>The Minefield Myth (Part 1)</title><link>http://blogs.msdn.com/imtesty/archive/2009/01/19/the-minefield-myth-part-1.aspx</link><pubDate>Mon, 19 Jan 2009 22:04:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9340544</guid><dc:creator>I.M.Testy</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/imtesty/comments/9340544.aspx</comments><wfw:commentRss>http://blogs.msdn.com/imtesty/commentrss.aspx?PostID=9340544</wfw:commentRss><wfw:comment>http://blogs.msdn.com/imtesty/rsscomments.aspx?PostID=9340544</wfw:comment><description>&lt;P&gt;In my studies at university I studied anthropology. Several courses I took surveyed folklore and its relevance in modern society. Many people mistakenly believe that most folklore (folktales, legends, myths, ballads, etc.) are purely fictional and simply fanciful tales. However, folklore is usually based on some grain of truth, or is used to instill societal or religious mores and values. For example, social scientists have found that many ancient civilizations have folklore regarding a massive “flood” in the distant past which wiped out huge populations of people. Did this actually occur? Well, we don’t know for certain, but geological evidence does suggests is that at one time coastal waters did rise significantly. Was this caused by cyclical change in the earth’s temperatures or by a series of earthquakes causing tsunami’s to ravage coastal villages? We don’t know; but the folklore may indicate that at some point many societies suffered a devastating travesty caused by rising waters. Was the story embellished over time…certainly. Another example is the “Cinderella” story. There are over 450 versions of the “Cinderella” story around the world.&amp;nbsp; The story is about over-coming adversity and oppression, and avoiding self-pity and selfishness. Basically, it is much more than a Disney animation, in traditional folklore it has been passed down through the generations to reinforce societal values.&lt;/P&gt;
&lt;P&gt;The first time I read about a &lt;A href="http://web.cecs.pdx.edu/~hamlet/relymine.html" mce_href="http://web.cecs.pdx.edu/~hamlet/relymine.html"&gt;minefield analogy&lt;/A&gt; was in the context of sampling. Later, Brian Marick used a similar analogy to suggest repeating tests (regression testing) is not likely to reveal new bugs. Marick’s analogy is perpetuated by Bach, Kaner, and others who tend to diminish the value of regression testing (especially automated testing) because we are simply traversing a minefield by following a previously cleared path.&lt;/P&gt;
&lt;P&gt;The Marick minefield analogy is simply an alternate perspective of Beizer’s pesticide paradox which states “Every method you use to prevent or find bugs leaves a residue of subtler bugs against which those methods are ineffectual. Basically, no single approach to software testing is effective in identifying all categories of defects, and we must use many approaches in software testing and vary our tests. In that context I absolutely agree with the analogy. &lt;/P&gt;
&lt;P&gt;However, a basic problem of Marick’s minefield analogy as it is often misrepresented is that it seems to treat the software under test as a static, unchanging field of easily exposed mines. &lt;/P&gt;
&lt;P&gt;If you were hired as a consultant to come in a perform a rapid evaluation of a software product using a sampling approach such as exploratory testing, then Marick’s minefield analogy is a wonderful strategy. In that context re-running a test provides no new value and has little probability of exposing new information.&amp;nbsp; However, for the rest of us who work in iterative software development lifecycles (including agile lifecycles) building complex systems with interdependent components the minefield analogy may not be as useful. &lt;/P&gt;
&lt;P&gt;For example, in complex systems with interdependent modules we know that a change in one module can adversely affect other modules that have some dependence on that module. So, a change in one module can impact the functional behavior of other modules. In layman’s terms, activating a mine while traversing one path through the minefield may reactivate an already cleared mine in another part of the minefield, or even plant a new mine in a previously traversed path.&lt;/P&gt;
&lt;P&gt;In iterative development lifecycles, the minefield is in constant flux (at least until the code complete stage, but even then the code is changing as issues are being addressed.) In iterative lifecycles features are being added, changed, and possibly removed during the process. Depending on the length of your product lifecycle the changes can be massive. The PDC release of Windows 95 ‘looked’ very different as compared to the final release.&amp;nbsp; The build verification/acceptance test suite for Windows 95 was a relatively static baseline regression test suite that continued to find ‘regression’ problems up to the final weeks of the project due to code churn. &lt;/P&gt;
&lt;P&gt;Also, not all mines are equal! Some mines are quite easy to detect while others are very hard to find which is why systematic probing is still used by professional’s to clear latent minefields. Similarly, an exploratory approach to testing software will easily reveal some bugs very quickly, but without ‘systematic probing’ we could just as easily overlook other types of issues. &lt;/P&gt;
&lt;P&gt;There are also different types of mines which may be activated differently, so traversing a minefield with a size 10 boot may not activate the mine, but someone with a size 12 boot, or who weighs more than the previous person may in fact activate the mine. Likewise, traversing the same path through software using different data or applying a more systematic analysis of a path may reveal interesting information or expose anomalies that were not previously discovered. For example, throwing simple ASCII characters at a text input control is not likely to expose any bugs (or restated it is likely to show us a clear path through the minefield). However, when we take that same exact path using Unicode characters, or Unicode surrogate pair characters we are very likely to expose problems not revealed previously. &lt;/P&gt;
&lt;P&gt;In part 2 I will discuss regression testing and specific situations where regression testing is very valuable.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9340544" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/imtesty/archive/tags/The+Professional+Tester/default.aspx">The Professional Tester</category><category domain="http://blogs.msdn.com/imtesty/archive/tags/Testing/default.aspx">Testing</category></item><item><title>Data-Driven Testing</title><link>http://blogs.msdn.com/imtesty/archive/2009/01/04/data-driven-testing.aspx</link><pubDate>Sun, 04 Jan 2009 10:27:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9271051</guid><dc:creator>I.M.Testy</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/imtesty/comments/9271051.aspx</comments><wfw:commentRss>http://blogs.msdn.com/imtesty/commentrss.aspx?PostID=9271051</wfw:commentRss><wfw:comment>http://blogs.msdn.com/imtesty/rsscomments.aspx?PostID=9271051</wfw:comment><description>&lt;P&gt;I am generally not a big fan of static data in test automation, but being a pragmatic person, I know there are clearly times when using data-driven testing is just plain common-sense. For example, data-driven testing is an effective automation approach when designing ‘black-box’ tests for testing an API.&lt;/P&gt;
&lt;P&gt;Data-driven testing is a common approach to test automation where static test data is passed to application parameters and the expected result (which is usually also read from static data) is compared against the actual result. This automation approach is effective when the actual result compared to some expected result can be resolved as a Boolean outcome. In other words, if the actual and expected results match the outcome is true and the test passes; otherwise the outcome is false and the test fails. (Of course, if something occurs during the test where there is no actual result then that particular test is usually logged as indeterminate.)&lt;/P&gt;
&lt;P&gt;Of course, the key to effective data-driven testing is the data! If we don’t identify the most appropriate data to use in the test then the test case may have holes and we might overlook important information or miss critical anomalies. If we have too much redundant data then we may be simply running unnecessary tests (yes, even with test automation redundant testing is not an efficient use of resources). &lt;/P&gt;
&lt;P&gt;Let’s say we had to test an API method such as:&lt;/P&gt;
&lt;DIV class=csharpcode-wrapper&gt;&lt;PRE class=csharpcode&gt;&lt;SPAN class=kwrd&gt;public&lt;/SPAN&gt; &lt;SPAN class=kwrd&gt;bool&lt;/SPAN&gt; IsValidNetBiosName(&lt;SPAN class=kwrd&gt;string&lt;/SPAN&gt; name)&lt;/PRE&gt;&lt;/DIV&gt;
&lt;P&gt;where the return value is true if the string argument passed to the name parameter is a valid NetBIOS name on the Windows operating environment; otherwise it returns false. &lt;/P&gt;
&lt;P&gt;With a data-driven testing approach we could use a simple CSV file that contained the string arguments and the expected result for each string passed to the &lt;EM&gt;name&lt;/EM&gt; parameter. A partial sample of the CSV data file would be:&lt;/P&gt;
&lt;DIV class=csharpcode-wrapper&gt;&lt;PRE class=csharpcode&gt;a,&lt;SPAN class=kwrd&gt;true&lt;/SPAN&gt;
validname,&lt;SPAN class=kwrd&gt;true&lt;/SPAN&gt;
validnamexxxxxx,&lt;SPAN class=kwrd&gt;true&lt;/SPAN&gt;
invalidnamexxxxx,&lt;SPAN class=kwrd&gt;false&lt;/SPAN&gt;
invalidnamexxxxxxxxxxxxxxxxxxxxxxx,&lt;SPAN class=kwrd&gt;false&lt;/SPAN&gt;
,&lt;SPAN class=kwrd&gt;false&lt;/SPAN&gt;
&lt;SPAN class=kwrd&gt;null&lt;/SPAN&gt;,&lt;SPAN class=kwrd&gt;false&lt;/SPAN&gt;,
xx\x,&lt;SPAN class=kwrd&gt;false&lt;/SPAN&gt;
xx/xx,&lt;SPAN class=kwrd&gt;false&lt;/SPAN&gt;
x:x,&lt;SPAN class=kwrd&gt;false&lt;/SPAN&gt;
xxx*xx,&lt;SPAN class=kwrd&gt;false&lt;/SPAN&gt;
x?xx,&lt;SPAN class=kwrd&gt;false&lt;/SPAN&gt;
xxxx",&lt;SPAN class=kwrd&gt;false&lt;/SPAN&gt;
;,&lt;SPAN class=kwrd&gt;false&lt;/SPAN&gt;
xxx|xxx,false&lt;/PRE&gt;&lt;/DIV&gt;
&lt;P&gt;(NOTE: null is a special case in which we need to convert the string “null” to a null in the test code, and the test above null is an empty string. An empty string and null are two different things and both must be tested in this case.)&lt;/P&gt;
&lt;P&gt;Next, we need to read in the CSV file into our automated test, and perhaps the easiest way I found to read in a text or CSV file in C# is with the &lt;A href="http://msdn.microsoft.com/en-us/library/system.io.file.readalllines.aspx" target=_blank mce_href="http://msdn.microsoft.com/en-us/library/system.io.file.readalllines.aspx"&gt;File.ReadAllLines&lt;/A&gt; method. The ReadAllLines method opens a text file, reads each line of text as an element in a string array, and then closes the file. Once we have a array of all lines in our data file, we simply need to parse each element in the string array into test data and/or expected result, and then compare the actual result against the expected result as illustrated in this example.&lt;/P&gt;
&lt;DIV class=csharpcode-wrapper&gt;&lt;PRE class=csharpcode&gt;&lt;SPAN class=rem&gt;// Read each line in the entire CSV file into a string array&lt;/SPAN&gt;
&lt;SPAN class=kwrd&gt;string&lt;/SPAN&gt;[] testDataArray = System.IO.File.ReadAllLines(&lt;SPAN class=str&gt;"myTestData.csv"&lt;/SPAN&gt;);

&lt;SPAN class=rem&gt;// Iterate through each element in the test data file&lt;/SPAN&gt;
&lt;SPAN class=kwrd&gt;foreach&lt;/SPAN&gt;(&lt;SPAN class=kwrd&gt;string&lt;/SPAN&gt; test &lt;SPAN class=kwrd&gt;in&lt;/SPAN&gt; testDataArray)
{
    &lt;SPAN class=rem&gt;// Split each element in each line into an array where the elements are the&lt;/SPAN&gt;
    &lt;SPAN class=rem&gt;// test data and the expected result&lt;/SPAN&gt;
    &lt;SPAN class=kwrd&gt;string&lt;/SPAN&gt;[] testElement = test.Split(&lt;SPAN class=str&gt;','&lt;/SPAN&gt;);
    &lt;SPAN class=kwrd&gt;string&lt;/SPAN&gt; testData = testElement[0];
    &lt;SPAN class=kwrd&gt;string&lt;/SPAN&gt; expectedResult = testElement[1];
    
    &lt;SPAN class=rem&gt;// Special case for passing a null to the API parameter&lt;/SPAN&gt;
    &lt;SPAN class=kwrd&gt;if&lt;/SPAN&gt; (&lt;SPAN class=kwrd&gt;string&lt;/SPAN&gt;.Equals(testData, &lt;SPAN class=str&gt;"null"&lt;/SPAN&gt;, 
        StringComparison.OrdinalIgnoreCase))
    {
        &lt;SPAN class=kwrd&gt;if&lt;/SPAN&gt; (&lt;SPAN class=kwrd&gt;string&lt;/SPAN&gt;.Equals(api.IsValidNetBiosName(&lt;SPAN class=kwrd&gt;null&lt;/SPAN&gt;).ToString(), expectedResult, 
            StringComparison.OrdinalIgnoreCase))
        {
            result = &lt;SPAN class=str&gt;"Pass"&lt;/SPAN&gt;;
        }&lt;BR&gt;        &lt;SPAN class=kwrd&gt;else&lt;BR&gt;      &lt;/SPAN&gt; { &lt;BR&gt;           result = &lt;SPAN class=str&gt;"Fail"&lt;/SPAN&gt;;&lt;BR&gt;       } &lt;BR&gt;&lt;BR&gt;&lt;BR&gt;    &lt;SPAN class=rem&gt;// Compare the return value against the expected result&lt;/SPAN&gt;
    &lt;SPAN class=kwrd&gt;else&lt;/SPAN&gt; &lt;SPAN class=kwrd&gt;if&lt;/SPAN&gt;(&lt;SPAN class=kwrd&gt;string&lt;/SPAN&gt;.Equals(api.IsValidNetBiosName(testData).ToString(), expectedResult,
        StringComparison.OrdinalIgnoreCase))
    {
        result = &lt;SPAN class=str&gt;"Pass"&lt;/SPAN&gt;;
    }
    &lt;SPAN class=kwrd&gt;else&lt;/SPAN&gt;
    {
        result = &lt;SPAN class=str&gt;"Fail"&lt;/SPAN&gt;;
    }
}&lt;/PRE&gt;&lt;/DIV&gt;
&lt;P&gt;This is rather simple example, but data-driven testing is effective for unit testing, API testing, and can even be used in automated GUI testing (although data-driven automation may only have limited applicability in GUI automation). I am a firm believer in the KISS principle when it comes to developing automated tests, and the ReadAllLines method is perhaps the easiest and most efficient way to read in data file for data-driven development. Of course, data-driven testing doesn’t solve all problems. &lt;A href="http://blogs.msdn.com/testing123/archive/2007/02/24/data-driven-tests.aspx" target=_blank mce_href="http://blogs.msdn.com/testing123/archive/2007/02/24/data-driven-tests.aspx"&gt;Chan Chaiyochlarb&lt;/A&gt; has a good post on some pitfalls to watch out for. But, in the right context, data-driven testing can be one approach used in automated testing.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9271051" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/imtesty/archive/tags/Test+Automation/default.aspx">Test Automation</category><category domain="http://blogs.msdn.com/imtesty/archive/tags/The+Professional+Tester/default.aspx">The Professional Tester</category><category domain="http://blogs.msdn.com/imtesty/archive/tags/Testing/default.aspx">Testing</category></item><item><title>The Ultimate Desktop Reference</title><link>http://blogs.msdn.com/imtesty/archive/2008/12/24/the-ultimate-desktop-reference.aspx</link><pubDate>Wed, 24 Dec 2008 06:55:21 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9251358</guid><dc:creator>I.M.Testy</dc:creator><slash:comments>4</slash:comments><comments>http://blogs.msdn.com/imtesty/comments/9251358.aspx</comments><wfw:commentRss>http://blogs.msdn.com/imtesty/commentrss.aspx?PostID=9251358</wfw:commentRss><wfw:comment>http://blogs.msdn.com/imtesty/rsscomments.aspx?PostID=9251358</wfw:comment><description>&lt;p&gt;I have a library of books and white papers on software testing, engineering processes and management, and software development that I have read and reference quite often. For new testers I generally recommend &lt;a href="http://www.amazon.com/gp/product/158053791X/ref=pd_sxp_elt_l1/102-6179150-6556164?n=283155"&gt;&lt;em&gt;A Practitioner's Guide to Software Test Design&lt;/em&gt;&lt;/a&gt; by Lee Copeland, and &lt;em&gt;&lt;a href="http://www.amazon.com/gp/product/0201796198/ref=pd_sxp_elt_l1/102-6179150-6556164?n=283155"&gt;How to Break Software: A Practical Guide to Testing&lt;/a&gt;&lt;/em&gt; by James Whittaker. There are &lt;a href="http://blogs.msdn.com/imtesty/archive/2006/05/02/588125.aspx" target="_blank"&gt;5 books I highly recommend&lt;/a&gt; (not including &lt;a href="http://www.amazon.com/How-We-Test-Software-Microsoft/dp/0735624259" target="_blank"&gt;How We Test Software at Microsoft&lt;/a&gt; which I co-authored and also highly recommend).&lt;/p&gt;  &lt;p&gt;In my current role as a teacher, trainer, and mentor of new testers the 2 books that are constantly on my desktop are&lt;em&gt; &lt;strong&gt;&lt;em&gt;&lt;a href="http://www.amazon.com/gp/product/0201809389/ref=pd_sxp_elt_l1/102-6179150-6556164?n=283155"&gt;Testing Object-Oriented Systems: Models, Patterns, and Tools&lt;/a&gt;&lt;/em&gt;&lt;/strong&gt;, &lt;/em&gt;by Robert V. Binder, and &lt;b&gt;&lt;em&gt;&lt;a href="http://www.amazon.com/gp/product/0442206720/ref=ase_acmorg-20/102-6179150-6556164?s=books&amp;amp;v=glance&amp;amp;n=283155&amp;amp;tagActionCode=acmorg-20"&gt;Software Testing Techniques&lt;/a&gt;&lt;/em&gt;&lt;/b&gt;, 2nd edition by Boris Beizer. Not that I don't frequently reference other books, but to me these are the quintessential books on the foundational knowledge of software testing techniques and methodologies for intermediate to advanced testers with a strong technical background. &lt;/p&gt;  &lt;p&gt;But, the booklet that I would keep in my shirt pocket if I tested products on a day-to-day basis would be &lt;a href="http://tester.poleyland.com/tester/publications/Black%20Book.pdf" target="_blank"&gt;&lt;strong&gt;Josh Poley's Black Book&lt;/strong&gt;.&lt;/a&gt; Josh's Black Book is the ultimate desktop reference for software testers (and developers). While this book is primarily intended to aid those who work on projects developed in C/C++, it has loads of information that is valuable to any tester working on just about any technology. From decimal and named entities of ISO characters to error codes for DOS, VB, JScript, HTTP, and of course Windows Errors this book is jammed packed with great information and quick reminders for both developers and testers.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9251358" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/imtesty/archive/tags/Tester_2700_s+Bookshelf/default.aspx">Tester's Bookshelf</category><category domain="http://blogs.msdn.com/imtesty/archive/tags/The+Professional+Tester/default.aspx">The Professional Tester</category><category domain="http://blogs.msdn.com/imtesty/archive/tags/Testing/default.aspx">Testing</category></item><item><title>Temporary test files</title><link>http://blogs.msdn.com/imtesty/archive/2008/12/02/temporary-test-files.aspx</link><pubDate>Tue, 02 Dec 2008 17:58:27 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9164764</guid><dc:creator>I.M.Testy</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/imtesty/comments/9164764.aspx</comments><wfw:commentRss>http://blogs.msdn.com/imtesty/commentrss.aspx?PostID=9164764</wfw:commentRss><wfw:comment>http://blogs.msdn.com/imtesty/rsscomments.aspx?PostID=9164764</wfw:comment><description>&lt;p&gt;There are occasionally times during an automated test needs to create a temporary file during the execution of that test. The problem is that often this file is left behind on the system, or even worse stored in some obscure directory on a server. I say worse because those files will be discovered by someone approximately 9.25 months from the time they were created, and that person will spend about 6.5 hours trying to figure out who they belong to before realizing they are no longer needed and can blow them away.&lt;/p&gt;  &lt;p&gt;The test designer must decide whether or not to leave test artifacts once created. My general rule of thumb is if the test run is a&amp;#160; system level (or dirty room) test then it is probably ok to leave any artifacts from previous tests lying about on the local machine. But, if the test run is a integration or component level (or primarily clean room) test, then in order to preserve the clean room environment (in other words, I want to eliminate or control the number of unknown environmental variables) then I probably want to remove any test artifacts that are created during the execution of a test.&lt;/p&gt;  &lt;p&gt;There are many ways to create a file and delete a file in an automated test. But, one of the easiest ways is to use File class members in C# to create a file that will automatically delete itself when the automated test ends. The FileOptions enumeration in File.Create method provides additional options for FileStream objects including a member that will automatically delete the file when the thread that created it closes.&lt;/p&gt;  &lt;blockquote&gt;   &lt;div&gt;     &lt;div class="csharpcode"&gt;       &lt;pre class="alt"&gt;FileStream fs = File.Create(path, bufferSize, FileOptions.DeleteOnClose)&lt;/pre&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/blockquote&gt;

&lt;p&gt;Of course if you wanted to design in the option to delete the file at the end of a test based on some Boolean decision you could simply create the file using WriteAllText(), WriteAllLines() or WriteAllBytes() methods.&lt;/p&gt;

&lt;p&gt;Another problem with temporary test files is that the test designer frequently hard-codes a clever name such at “test.txt” to name the temporary file in the test case itself. Then of course, the next test fires off and that test also has a hard-coded file name which also happens to be “text.txt” that will either overwrite the first file, or in the worse case append to it. Again, the tester can easily create a random string generator to generate random strings for use as file names, or use another method that is already built into C#.&lt;/p&gt;

&lt;p&gt;Another useful method for creating temporary file names is found in the Path class. The Path class member Path.GetRandomFileName() will generate a random file name. This random file name also includes a random extension which may not be desired, so you can use the Path.ChangeExtension method to automatically generate a randomly named file and change the extension to the desired extension.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;div&gt;
    &lt;div class="csharpcode"&gt;
      &lt;div&gt;
        &lt;div class="csharpcode"&gt;
          &lt;pre class="alt"&gt;&lt;span class="kwrd"&gt;string&lt;/span&gt; filename = Path.ChangeExtension(GetRandomFileNamePath.GetRandomFileName(), &lt;span class="str"&gt;&amp;quot;txt&amp;quot;&lt;/span&gt;);&lt;/pre&gt;
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;Now, we can create a temporary test file at a desired location (say the My Documents folder) on the local machine with a random name and that file will be automatically deleted at the end of the test. &lt;/p&gt;

&lt;div&gt;
  &lt;blockquote class="csharpcode"&gt;
    &lt;pre class="alt"&gt;FileStream fs = File.Create(Path.Combine(&lt;/pre&gt;
  &lt;/blockquote&gt;

  &lt;blockquote class="csharpcode"&gt;
    &lt;pre class="alteven"&gt;    Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments),&lt;/pre&gt;
  &lt;/blockquote&gt;

  &lt;blockquote class="csharpcode"&gt;
    &lt;pre class="alt"&gt;    Path.ChangeExtension(Path.GetRandomFileName(), &lt;span class="str"&gt;&amp;quot;txt&amp;quot;&lt;/span&gt;)),&lt;/pre&gt;
  &lt;/blockquote&gt;

  &lt;blockquote&gt;
    &lt;pre class="alteven"&gt;    bufferSize, FileOptions.DeleteOnClose);&lt;/pre&gt;
  &lt;/blockquote&gt;
&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9164764" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/imtesty/archive/tags/Test+Automation/default.aspx">Test Automation</category><category domain="http://blogs.msdn.com/imtesty/archive/tags/Testing/default.aspx">Testing</category></item></channel></rss>