The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.
<html xmlns:v="urn:schemas-microsoft-com:vml"
xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:w="urn:schemas-microsoft-com:office:word"
xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=ProgId content=Word.Document>
<meta name=Generator content="Microsoft Word 9">
<meta name=Originator content="Microsoft Word 9">
<link rel=File-List href="./AllCombinations-Dateien/filelist.xml">
<link rel=Edit-Time-Data href="./AllCombinations-Dateien/editdata.mso">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]-->
<title>Wiki: All Combinations</title>
<!--[if gte mso 9]><xml>
 <o:DocumentProperties>
  <o:Author>Martin Busik</o:Author>
  <o:LastAuthor>Martin Busik</o:LastAuthor>
  <o:Revision>2</o:Revision>
  <o:Created>2006-04-29T15:12:00Z</o:Created>
  <o:LastSaved>2006-04-29T15:12:00Z</o:LastSaved>
  <o:Pages>2</o:Pages>
  <o:Words>422</o:Words>
  <o:Characters>2408</o:Characters>
  <o:Company>Hogwarts</o:Company>
  <o:Lines>20</o:Lines>
  <o:Paragraphs>4</o:Paragraphs>
  <o:CharactersWithSpaces>2957</o:CharactersWithSpaces>
  <o:Version>9.3821</o:Version>
 </o:DocumentProperties>
</xml><![endif]-->
<style>
<!--
 /* Font Definitions */
@font-face
	{font-family:Wingdings;
	panose-1:5 0 0 0 0 0 0 0 0 0;
	mso-font-charset:2;
	mso-generic-font-family:auto;
	mso-font-pitch:variable;
	mso-font-signature:0 268435456 0 0 -2147483648 0;}
 /* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
	{mso-style-parent:"";
	margin:0cm;
	margin-bottom:.0001pt;
	mso-pagination:widow-orphan;
	font-size:12.0pt;
	font-family:"Times New Roman";
	mso-fareast-font-family:"Times New Roman";}
a:link, span.MsoHyperlink
	{color:#D06040;
	text-decoration:underline;
	text-underline:single;}
a:visited, span.MsoHyperlinkFollowed
	{color:#806040;
	text-decoration:underline;
	text-underline:single;}
p
	{font-size:12.0pt;
	font-family:"Times New Roman";
	mso-fareast-font-family:"Times New Roman";}
@page Section1
	{size:595.3pt 841.9pt;
	margin:70.85pt 70.85pt 2.0cm 70.85pt;
	mso-header-margin:35.4pt;
	mso-footer-margin:35.4pt;
	mso-paper-source:0;}
div.Section1
	{page:Section1;}
 /* List Definitions */
@list l0
	{mso-list-id:173418735;
	mso-list-type:hybrid;
	mso-list-template-ids:271849482 -1088668940 799979202 -704849924 -1889095130 -128696518 256561266 819084500 -587286016 381452844;}
@list l0:level1
	{mso-level-number-format:bullet;
	mso-level-text:\F0B7;
	mso-level-tab-stop:36.0pt;
	mso-level-number-position:left;
	text-indent:-18.0pt;
	mso-ansi-font-size:10.0pt;
	font-family:Symbol;}
@list l1
	{mso-list-id:524903185;
	mso-list-type:hybrid;
	mso-list-template-ids:-1544113422 1956386310 1010350786 649642934 -1862115000 -1847149284 1853244994 -1333506878 158600852 -1857778998;}
@list l1:level1
	{mso-level-number-format:bullet;
	mso-level-text:\F0B7;
	mso-level-tab-stop:36.0pt;
	mso-level-number-position:left;
	text-indent:-18.0pt;
	mso-ansi-font-size:10.0pt;
	font-family:Symbol;}
@list l2
	{mso-list-id:1855338372;
	mso-list-type:hybrid;
	mso-list-template-ids:559062498 1343755688 707397168 -545120130 -944984922 -66710874 -1295739030 1132919588 1216247422 463637412;}
@list l2:level1
	{mso-level-number-format:bullet;
	mso-level-text:\F0B7;
	mso-level-tab-stop:36.0pt;
	mso-level-number-position:left;
	text-indent:-18.0pt;
	mso-ansi-font-size:10.0pt;
	font-family:Symbol;}
ol
	{margin-bottom:0cm;}
ul
	{margin-bottom:0cm;}
-->
</style>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1027"/>
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1"/>
 </o:shapelayout></xml><![endif]-->
</head>

<body bgcolor=white lang=EN-GB link="#d06040" vlink="#806040" style='tab-interval:
36.0pt'>

<div class=Section1>

<h1>All Combinations<o:p></o:p></h1>

<p class=MsoNormal><wiki>This is the second of a suite of fixtures that make up
the AllPairsExample. Like with AllFiles, we expand wildcard characters in path
specifications to get lists of tests. But this time we run all combinations of
the tests. This is another warmup for AllPairs testing. </p>


<div class=MsoNormal align=center style='text-align:center'>

<hr size=2 width="100%" align=center>

</div>


<p>A project can expect to have dozens or hundreds of files testing specific
features in a stand-alone way. We may wonder if there are any interactions
between features that will cause any of these tests to fail. AllCombinations
explores this. It is a fixture that enumerates cases by drawing one file at a
time from each of a number of lists; running each in turn, and then repeating
the drawing and running for all possible combinations. </p>

<p>For the purpose of illustration we've created a number of files that contain
small tests of the CalculatorExample. We've categorized the files as <em>magnitudes,
signs</em> and <em>functions,</em> which enter values, changes signs, and
compute functions, respectivly. </p>

<ul type=disc>
 <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
     mso-list:l0 level1 lfo1;tab-stops:list 36.0pt'><a
     href="Release\Documents\AllPairs\">http:Release/Documents/AllPairs/</a> </li>
</ul>

<p class=MsoNormal>This table runs all possible sequences of magnitude, sign
and function. Try it with <a href="run.cgi">http:run.cgi</a>. </p>

<table border=1 cellspacing=0 cellpadding=0 style='mso-cellspacing:0cm;
 mso-padding-alt:2.25pt 2.25pt 2.25pt 2.25pt'>
 <tr>
  <td colspan=2 style='padding:2.25pt 2.25pt 2.25pt 2.25pt'>
  <p class=MsoNormal>eg.AllCombinations </p>
  </td>
 </tr>
 <tr>
  <td style='padding:2.25pt 2.25pt 2.25pt 2.25pt'>
  <p class=MsoNormal>input/AllPairs/magnitude/*.html </p>
  </td>
  <td style='padding:2.25pt 2.25pt 2.25pt 2.25pt'>
  <p class=MsoNormal>&nbsp;</p>
  </td>
 </tr>
 <tr>
  <td style='padding:2.25pt 2.25pt 2.25pt 2.25pt'>
  <p class=MsoNormal>input/AllPairs/sign/*.html </p>
  </td>
  <td style='padding:2.25pt 2.25pt 2.25pt 2.25pt'>
  <p class=MsoNormal>&nbsp;</p>
  </td>
 </tr>
 <tr>
  <td style='padding:2.25pt 2.25pt 2.25pt 2.25pt'>
  <p class=MsoNormal>input/AllPairs/function/*.html </p>
  </td>
  <td style='padding:2.25pt 2.25pt 2.25pt 2.25pt'>
  <p class=MsoNormal>&nbsp;</p>
  </td>
 </tr>
</table>

<p>The number of cases will as large as the product of the size of each list of
tests. The searches in the table find four magnitues, three signs and two
functions. </p>

<ul type=disc>
 <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
     mso-list:l1 level1 lfo2;tab-stops:list 36.0pt'>4 magnitudes X 3 signs X 2
     functions = 24 cases </li>
</ul>

<p class=MsoNormal>Any file of any case can fail. We save the results from
failed tests only. A single file can fail different ways in different cases.
Look for differences in the counts or examine each FileFootnote. </p>

<p>If the tests are intended to interact, as ours are here, then some care is
required to be sure that checks in the tests are independent of this
interaction. No checks at all my be suitable if we are only testing that there
are no exceptions thrown. Or the simplest checks may be adaquate so long as
features are tested well in isolation. It may be convenient to run a
simulation, a so called <em>oracale</em>, along side the application to
generate expected results. </p>


<div class=MsoNormal align=center style='text-align:center'>

<hr size=2 width="100%" align=center>

</div>


<p><strong>Implementation</strong> </p>

<p>The fixture inherits path expansion from AllFiles, but captures these by
overrinding <em>doRows(Parse, List)</em> and saving the list of files in a list
of lists. Then, at the end of <em>doTable</em>, the fixture gets to work
computing and running combinations. </p>

<p>See source. </p>

<ul type=disc>
 <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
     mso-list:l2 level1 lfo3;tab-stops:list 36.0pt'><a
     href="Release\Source\eg\AllCombinations.java">http:Release/Source/eg/AllCombinations.java</a>
     </li>
</ul>

<p class=MsoNormal>We had a little trouble setting up the test data for this
example so we wrote this little <em>Trigonometry Refresher</em>. </p>

<table border=1 cellspacing=0 cellpadding=0 style='mso-cellspacing:0cm;
 mso-padding-alt:2.25pt 2.25pt 2.25pt 2.25pt'>
 <tr>
  <td colspan=3 style='padding:2.25pt 2.25pt 2.25pt 2.25pt'>
  <p class=MsoNormal>eg.ArithmeticColumnFixture </p>
  </td>
 </tr>
 <tr>
  <td style='padding:2.25pt 2.25pt 2.25pt 2.25pt'>
  <p class=MsoNormal>x </p>
  </td>
  <td style='padding:2.25pt 2.25pt 2.25pt 2.25pt'>
  <p class=MsoNormal>sin() </p>
  </td>
  <td style='padding:2.25pt 2.25pt 2.25pt 2.25pt'>
  <p class=MsoNormal>cos() </p>
  </td>
 </tr>
 <tr>
  <td style='padding:2.25pt 2.25pt 2.25pt 2.25pt'>
  <p class=MsoNormal>0 </p>
  </td>
  <td style='padding:2.25pt 2.25pt 2.25pt 2.25pt'>
  <p class=MsoNormal>0.0000 </p>
  </td>
  <td style='padding:2.25pt 2.25pt 2.25pt 2.25pt'>
  <p class=MsoNormal>1.0000 </p>
  </td>
 </tr>
 <tr>
  <td style='padding:2.25pt 2.25pt 2.25pt 2.25pt'>
  <p class=MsoNormal>30 </p>
  </td>
  <td style='padding:2.25pt 2.25pt 2.25pt 2.25pt'>
  <p class=MsoNormal>0.5000 </p>
  </td>
  <td style='padding:2.25pt 2.25pt 2.25pt 2.25pt'>
  <p class=MsoNormal>0.8660 </p>
  </td>
 </tr>
 <tr>
  <td style='padding:2.25pt 2.25pt 2.25pt 2.25pt'>
  <p class=MsoNormal>60 </p>
  </td>
  <td style='padding:2.25pt 2.25pt 2.25pt 2.25pt'>
  <p class=MsoNormal>0.8660 </p>
  </td>
  <td style='padding:2.25pt 2.25pt 2.25pt 2.25pt'>
  <p class=MsoNormal>0.5000 </p>
  </td>
 </tr>
 <tr>
  <td style='padding:2.25pt 2.25pt 2.25pt 2.25pt'>
  <p class=MsoNormal>90 </p>
  </td>
  <td style='padding:2.25pt 2.25pt 2.25pt 2.25pt'>
  <p class=MsoNormal>1.0000 </p>
  </td>
  <td style='padding:2.25pt 2.25pt 2.25pt 2.25pt'>
  <p class=MsoNormal>0.0000 </p>
  </td>
 </tr>
 <tr>
  <td style='padding:2.25pt 2.25pt 2.25pt 2.25pt'>
  <p class=MsoNormal>120 </p>
  </td>
  <td style='padding:2.25pt 2.25pt 2.25pt 2.25pt'>
  <p class=MsoNormal>0.8660 </p>
  </td>
  <td style='padding:2.25pt 2.25pt 2.25pt 2.25pt'>
  <p class=MsoNormal>-0.5000 </p>
  </td>
 </tr>
 <tr>
  <td style='padding:2.25pt 2.25pt 2.25pt 2.25pt'>
  <p class=MsoNormal>150 </p>
  </td>
  <td style='padding:2.25pt 2.25pt 2.25pt 2.25pt'>
  <p class=MsoNormal>0.5000 </p>
  </td>
  <td style='padding:2.25pt 2.25pt 2.25pt 2.25pt'>
  <p class=MsoNormal>-.8660 </p>
  </td>
 </tr>
 <tr>
  <td style='padding:2.25pt 2.25pt 2.25pt 2.25pt'>
  <p class=MsoNormal>180 </p>
  </td>
  <td style='padding:2.25pt 2.25pt 2.25pt 2.25pt'>
  <p class=MsoNormal>0.0000 </p>
  </td>
  <td style='padding:2.25pt 2.25pt 2.25pt 2.25pt'>
  <p class=MsoNormal>-1.0000 </p>
  </td>
 </tr>
</table>


<div class=MsoNormal align=center style='text-align:center'>

<hr size=2 width="100%" align=center>

</div>


<table border=1 cellspacing=0 cellpadding=0 style='mso-cellspacing:0cm;
 mso-padding-alt:2.25pt 2.25pt 2.25pt 2.25pt'>
 <tr>
  <td style='padding:2.25pt 2.25pt 2.25pt 2.25pt'>
  <p class=MsoNormal>fit.Summary </p>
  </td>
 </tr>
</table>


<div class=MsoNormal align=center style='text-align:center'>

<hr size=2 width="100%" align=center>

</div>

</wiki>

<p class=MsoNormal>Last edited November 4, 2002 </p>

</div>

</body>

</html>