fit 1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (110) hide show
  1. data/README.txt +203 -0
  2. data/Rakefile +111 -0
  3. data/bin/FitServer.rb +6 -0
  4. data/bin/fit +10 -0
  5. data/bin/fit.cgi +36 -0
  6. data/doc/examples/AllCombinations.html +55 -0
  7. data/doc/examples/AllFiles.html +60 -0
  8. data/doc/examples/AllPairs/function/cosine.html +57 -0
  9. data/doc/examples/AllPairs/function/sine.html +57 -0
  10. data/doc/examples/AllPairs/magnitude/180+30.html +45 -0
  11. data/doc/examples/AllPairs/magnitude/30.html +33 -0
  12. data/doc/examples/AllPairs/magnitude/360+30.html +45 -0
  13. data/doc/examples/AllPairs/magnitude/90-30.html +45 -0
  14. data/doc/examples/AllPairs/sign/change-sign.html +27 -0
  15. data/doc/examples/AllPairs/sign/multiply.html +31 -0
  16. data/doc/examples/AllPairs/sign/no-change.html +23 -0
  17. data/doc/examples/AllPairs.html +51 -0
  18. data/doc/examples/BinaryChop.html +89 -0
  19. data/doc/examples/CalculatorExample.html +108 -0
  20. data/doc/examples/ColumnIndex.html +43 -0
  21. data/doc/examples/ExampleTests.html +43 -0
  22. data/doc/examples/FitAcceptanceTests.html +53 -0
  23. data/doc/examples/GeoCoordinate.html +87 -0
  24. data/doc/examples/MusicExample.html +143 -0
  25. data/doc/examples/MusicExampleWithErrors.html +128 -0
  26. data/doc/examples/NetworkExample.html +47 -0
  27. data/doc/examples/WebPageExample.html +92 -0
  28. data/doc/examples/arithmetic.html +211 -0
  29. data/doc/examples/files/hp35bk.jpg +0 -0
  30. data/doc/examples/logo.gif +0 -0
  31. data/doc/fitnesse/FitNesse.RubY.AcceptanceTests.FixtureParameters.html +81 -0
  32. data/doc/fitnesse/FitNesse.RubY.AcceptanceTests.GracefulFixtureNames.html +87 -0
  33. data/doc/fitnesse/FitNesse.RubY.AcceptanceTests.GracefulMemberNames.html +73 -0
  34. data/doc/fitnesse/FitNesse.RubY.AcceptanceTests.ImportFixture.html +61 -0
  35. data/doc/fitnesse/FitNesse.RubY.AcceptanceTests.WaysToSpecifyaFixtureNamespace.html +81 -0
  36. data/doc/spec/annotation.html +3833 -0
  37. data/doc/spec/extensions.html +302 -0
  38. data/doc/spec/fixtures.html +5181 -0
  39. data/doc/spec/index.html +947 -0
  40. data/doc/spec/parse.html +3094 -0
  41. data/lib/eg/all_combinations.rb +44 -0
  42. data/lib/eg/all_files.rb +94 -0
  43. data/lib/eg/all_pairs.rb +172 -0
  44. data/lib/eg/arithmetic_column_fixture.rb +35 -0
  45. data/lib/eg/arithmetic_fixture.rb +29 -0
  46. data/lib/eg/binary_chop.rb +100 -0
  47. data/lib/eg/calculator.rb +69 -0
  48. data/lib/eg/column_index.rb +85 -0
  49. data/lib/eg/division.rb +13 -0
  50. data/lib/eg/echo_args_fixture.rb +9 -0
  51. data/lib/eg/example_tests.rb +84 -0
  52. data/lib/eg/music/Music.txt +38 -0
  53. data/lib/eg/music/browser.rb +60 -0
  54. data/lib/eg/music/display.rb +24 -0
  55. data/lib/eg/music/music.rb +67 -0
  56. data/lib/eg/music/music_library.rb +70 -0
  57. data/lib/eg/music/music_player.rb +77 -0
  58. data/lib/eg/music/realtime.rb +39 -0
  59. data/lib/eg/music/simulator.rb +81 -0
  60. data/lib/eg/nested/bob.rb +12 -0
  61. data/lib/eg/nested/bob_the_builder_fixture.rb +11 -0
  62. data/lib/eg/net/simulator.rb +69 -0
  63. data/lib/eg/page.rb +91 -0
  64. data/lib/eg/sqrt.rb +19 -0
  65. data/lib/fat/annotation_fixture.rb +83 -0
  66. data/lib/fat/color.rb +45 -0
  67. data/lib/fat/divide.rb +13 -0
  68. data/lib/fat/document_parse_fixture.rb +67 -0
  69. data/lib/fat/equals.rb +59 -0
  70. data/lib/fat/fixture_name_fixture.rb +67 -0
  71. data/lib/fat/html_to_text_fixture.rb +20 -0
  72. data/lib/fat/money.rb +18 -0
  73. data/lib/fat/output_fixture.rb +32 -0
  74. data/lib/fat/parse_fixture.rb +92 -0
  75. data/lib/fat/reference_fixture.rb +31 -0
  76. data/lib/fat/standard_annotation_fixture.rb +58 -0
  77. data/lib/fat/string_writer.rb +12 -0
  78. data/lib/fat/table.rb +23 -0
  79. data/lib/fat/table_parse_fixture.rb +33 -0
  80. data/lib/fat/text_to_html_fixture.rb +21 -0
  81. data/lib/fit/action_fixture.rb +65 -0
  82. data/lib/fit/column_fixture.rb +104 -0
  83. data/lib/fit/file_runner.rb +80 -0
  84. data/lib/fit/fit_protocol.rb +62 -0
  85. data/lib/fit/fit_server.rb +173 -0
  86. data/lib/fit/fixture.rb +309 -0
  87. data/lib/fit/fixture_loader.rb +75 -0
  88. data/lib/fit/import_fixture.rb +9 -0
  89. data/lib/fit/parse.rb +206 -0
  90. data/lib/fit/primitive_fixture.rb +52 -0
  91. data/lib/fit/row_fixture.rb +188 -0
  92. data/lib/fit/scientific_double.rb +70 -0
  93. data/lib/fit/summary.rb +46 -0
  94. data/lib/fit/timed_action_fixture.rb +35 -0
  95. data/lib/fit/type_adapter.rb +95 -0
  96. data/lib/fit/wiki_runner.rb +15 -0
  97. data/lib/fittask.rb +184 -0
  98. data/test/all_tests.rb +13 -0
  99. data/test/file_runner_test.rb +52 -0
  100. data/test/fit_server_test.rb +214 -0
  101. data/test/fixture_loader_test.rb +71 -0
  102. data/test/fixture_test.rb +41 -0
  103. data/test/fixtures/fail_fixture.rb +9 -0
  104. data/test/fixtures/pass_fixture.rb +9 -0
  105. data/test/framework_test.rb +51 -0
  106. data/test/parse_test.rb +101 -0
  107. data/test/row_fixture_test.rb +44 -0
  108. data/test/scientific_double_test.rb +35 -0
  109. data/test/type_adapter_test.rb +120 -0
  110. metadata +165 -0
@@ -0,0 +1,33 @@
1
+ <!doctype html public "-//w3c//dtd html 4.0 transitional//en">
2
+ <html>
3
+ <head>
4
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
5
+ <meta name="GENERATOR" content="Mozilla/4.77C-CCK-MCD {C-UDP; EBM-APPLE} (Macintosh; U; PPC) [Netscape]">
6
+ <title>change-sign.html</title>
7
+ </head>
8
+ <body>
9
+ Enter thirty degrees.
10
+ <br>&nbsp;
11
+ <table BORDER CELLSPACING=0 CELLPADDING=3 >
12
+ <tr>
13
+ <td>eg.Calculator</td>
14
+
15
+ <td>&nbsp;</td>
16
+ </tr>
17
+
18
+ <tr>
19
+ <td>key</td>
20
+
21
+ <td>x()</td>
22
+ </tr>
23
+
24
+ <tr>
25
+ <td>30</td>
26
+
27
+ <td>30.0000</td>
28
+ </tr>
29
+ </table>
30
+
31
+ <p>See <a href="http://fit.c2.com/wiki.cgi?AllPairsExample">AllPairsExample</a>.
32
+ </body>
33
+ </html>
@@ -0,0 +1,45 @@
1
+ <!doctype html public "-//w3c//dtd html 4.0 transitional//en">
2
+ <html>
3
+ <head>
4
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
5
+ <meta name="GENERATOR" content="Mozilla/4.77C-CCK-MCD {C-UDP; EBM-APPLE} (Macintosh; U; PPC) [Netscape]">
6
+ <title>change-sign.html</title>
7
+ </head>
8
+ <body>
9
+ Enter 360+30 degrees.
10
+ <br>&nbsp;
11
+ <table BORDER CELLSPACING=0 CELLPADDING=3 >
12
+ <tr>
13
+ <td>eg.Calculator</td>
14
+
15
+ <td>&nbsp;</td>
16
+ </tr>
17
+
18
+ <tr>
19
+ <td>key</td>
20
+
21
+ <td>x()</td>
22
+ </tr>
23
+
24
+ <tr>
25
+ <td>360</td>
26
+
27
+ <td>&nbsp;</td>
28
+ </tr>
29
+
30
+ <tr>
31
+ <td>30</td>
32
+
33
+ <td>&nbsp;</td>
34
+ </tr>
35
+
36
+ <tr>
37
+ <td>+</td>
38
+
39
+ <td>390.0000</td>
40
+ </tr>
41
+ </table>
42
+
43
+ <p>See <a href="http://fit.c2.com/wiki.cgi?AllPairsExample">AllPairsExample</a>.
44
+ </body>
45
+ </html>
@@ -0,0 +1,45 @@
1
+ <!doctype html public "-//w3c//dtd html 4.0 transitional//en">
2
+ <html>
3
+ <head>
4
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
5
+ <meta name="GENERATOR" content="Mozilla/4.77C-CCK-MCD {C-UDP; EBM-APPLE} (Macintosh; U; PPC) [Netscape]">
6
+ <title>change-sign.html</title>
7
+ </head>
8
+ <body>
9
+ Enter 90-30 degrees.
10
+ <br>&nbsp;
11
+ <table BORDER CELLSPACING=0 CELLPADDING=3 >
12
+ <tr>
13
+ <td>eg.Calculator</td>
14
+
15
+ <td>&nbsp;&nbsp;</td>
16
+ </tr>
17
+
18
+ <tr>
19
+ <td>key</td>
20
+
21
+ <td>x()</td>
22
+ </tr>
23
+
24
+ <tr>
25
+ <td>90</td>
26
+
27
+ <td>&nbsp;</td>
28
+ </tr>
29
+
30
+ <tr>
31
+ <td>30</td>
32
+
33
+ <td>&nbsp;</td>
34
+ </tr>
35
+
36
+ <tr>
37
+ <td>-</td>
38
+
39
+ <td>60.0000</td>
40
+ </tr>
41
+ </table>
42
+
43
+ <p>See <a href="http://fit.c2.com/wiki.cgi?AllPairsExample">AllPairsExample</a>.
44
+ </body>
45
+ </html>
@@ -0,0 +1,27 @@
1
+ <!doctype html public "-//w3c//dtd html 4.0 transitional//en">
2
+ <html>
3
+ <head>
4
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
5
+ <meta name="GENERATOR" content="Mozilla/4.77C-CCK-MCD {C-UDP; EBM-APPLE} (Macintosh; U; PPC) [Netscape]">
6
+ <title>change-sign.html</title>
7
+ </head>
8
+ <body>
9
+ Change sign using the <b>ch s</b> key.
10
+ <br>&nbsp;
11
+ <table BORDER CELLSPACING=0 CELLPADDING=3 >
12
+ <tr>
13
+ <td>eg.Calculator</td>
14
+ </tr>
15
+
16
+ <tr>
17
+ <td>key</td>
18
+ </tr>
19
+
20
+ <tr>
21
+ <td>ch s</td>
22
+ </tr>
23
+ </table>
24
+
25
+ <p>See <a href="http://fit.c2.com/wiki.cgi?AllPairsExample">AllPairsExample</a>.
26
+ </body>
27
+ </html>
@@ -0,0 +1,31 @@
1
+ <!doctype html public "-//w3c//dtd html 4.0 transitional//en">
2
+ <html>
3
+ <head>
4
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
5
+ <meta name="GENERATOR" content="Mozilla/4.77C-CCK-MCD {C-UDP; EBM-APPLE} (Macintosh; U; PPC) [Netscape]">
6
+ <title>change-sign.html</title>
7
+ </head>
8
+ <body>
9
+ Change sign by multiplying.
10
+ <br>&nbsp;
11
+ <table BORDER CELLSPACING=0 CELLPADDING=3 >
12
+ <tr>
13
+ <td>eg.Calculator</td>
14
+ </tr>
15
+
16
+ <tr>
17
+ <td>key</td>
18
+ </tr>
19
+
20
+ <tr>
21
+ <td>-1</td>
22
+ </tr>
23
+
24
+ <tr>
25
+ <td>*</td>
26
+ </tr>
27
+ </table>
28
+
29
+ <p>See <a href="http://fit.c2.com/wiki.cgi?AllPairsExample">AllPairsExample</a>.
30
+ </body>
31
+ </html>
@@ -0,0 +1,23 @@
1
+ <!doctype html public "-//w3c//dtd html 4.0 transitional//en">
2
+ <html>
3
+ <head>
4
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
5
+ <meta name="GENERATOR" content="Mozilla/4.77C-CCK-MCD {C-UDP; EBM-APPLE} (Macintosh; U; PPC) [Netscape]">
6
+ <title>change-sign.html</title>
7
+ </head>
8
+ <body>
9
+ Don't change sign
10
+ <br>&nbsp;
11
+ <table BORDER CELLSPACING=0 CELLPADDING=3 >
12
+ <tr>
13
+ <td>eg.Calculator</td>
14
+ </tr>
15
+
16
+ <tr>
17
+ <td>key</td>
18
+ </tr>
19
+ </table>
20
+
21
+ <p>See <a href="http://fit.c2.com/wiki.cgi?AllPairsExample">AllPairsExample</a>.
22
+ </body>
23
+ </html>
@@ -0,0 +1,51 @@
1
+ <html>
2
+ <head>
3
+ <title>Wiki: All Pairs</title>
4
+ <head>
5
+ <body bgcolor=#FFFFFF link=#d06040 vlink=#806040>
6
+ <h1>All Pairs</h1>
7
+ <wiki>This is the third and final fixture of a suite that make up the AllPairsExample. Like with AllFiles, we expand wildcard characters in path specifications to get lists of tests. And, like in AllCombinations, we enumerate cases drawing from these lists one test at a time in sequence. But here our goal is only to test all possible pairs of test, which will require fewer cases.
8
+ <p><hr>
9
+ <p>Here is the same specification we used to test the CalculatorExample in AllCombinations. Try it using AllPairs.
10
+ <p><a href="run.cgi">http:run.cgi</a>
11
+ <p><table BORDER CELLSPACING=0 CELLPADDING=3>
12
+ <tr><td ColSpan=2> eg.AllPairs </td></tr>
13
+ <tr><td> doc/examples/AllPairs/magnitude/*.html </td><td>&nbsp;</td></tr>
14
+ <tr><td> doc/examples/AllPairs/sign/*.html </td><td>&nbsp;</td></tr>
15
+ <tr><td> doc/examples/AllPairs/function/*.html </td><td>&nbsp;</td></tr>
16
+ </table>
17
+ <p>To meet the "all pairs" requirement we need at least n X m cases, where n and m are the sizes of the two largest categories. That means with only two categories all combinations and all pairs are the same. The marvel of the all pairs algorithm is that it squeezes draws from additional categories into these same cases and possibly a few more.
18
+ <p><table BORDER CELLSPACING=0 CELLPADDING=3>
19
+ <tr><td ColSpan=2> fit.Summary </td></tr>
20
+ </table>
21
+ <p><hr>
22
+ <p><strong>Implementation</strong>
23
+ <p>The algorithm is largely JamesBach's from the source cited on the AllPairsExample page. My implementation can be summarized as follows.
24
+ <p><UL>
25
+ <li> Fill test cases with tests drawn from a list of <em>most wanted</em> pairs.
26
+ <li> Fill one case at a time. Never reexamine a case once filled.
27
+ <li> Recirculate used pairs back to the list but as <em>less wanted</em>.
28
+ <li> Quit filling cases when all pairs have been used at least once.
29
+ <p></UL>
30
+ The case currently being filled is called the <em>slug.</em> A pair will fit the slug only if the following hold.
31
+ <p><UL>
32
+ <li> At least one item of a pair is of a category that is not already filled.
33
+ <li> The other item must match the slug in its category or must also be unfilled.
34
+ <p></UL>
35
+ The fixture uses these helper objects to represent the state of the algorithm.
36
+ <p><UL>
37
+ <li> Item -- A value from within a category.
38
+ <li> Pair -- Two Items drawn from different categories.
39
+ <li> Var -- A category, one per list of files.
40
+ <p></UL>
41
+ See the source.
42
+ <p><UL>
43
+ <li> <a href="Release/Source/eg/AllPairs.java">http:Release/Source/eg/AllPairs.java</a>
44
+ <p></UL>
45
+ See AllPairsAlgorithm for some tests we've written for this algorithm itself.
46
+ </wiki>
47
+ <hr>
48
+ Last edited November 9, 2002
49
+ </body>
50
+ </html>
51
+
@@ -0,0 +1,89 @@
1
+ <html>
2
+ <head>
3
+ <title>Wiki: Binary Chop</title>
4
+ <head>
5
+ <body bgcolor=#FFFFFF link=#d06040 vlink=#806040>
6
+ <h1>Binary Chop</h1>
7
+ <wiki><em>DaveThomas suggests practicing programming and offers 'Kata' (practice problems) to encourage the activity. Here is a recent Kata.</em>
8
+ <p><UL>
9
+ <li> <a href="//pragprog.com/pragdave/Practices/Kata/KataTwo.rdoc,v">http://pragprog.com/prag ... a/KataTwo.rdoc,v</a>
10
+ <p></UL>
11
+ <em>The Kata is to write a binary chop, often called binary search. Dave offered the following specification and included test data which I've converted to tables.</em>
12
+ <p><hr>
13
+ <p>Write a binary chop method that takes an integer search target and a sorted array of integers. It should return the integer index of the target in the array, or -1 if the target is not in the array. The signature will logically be:
14
+ <p><p><PRE>
15
+ chop(int, array_of_int) -&gt; int
16
+ <p></PRE>
17
+ You can assume that the array has less than 100,000 elements. For the purposes of this Kata, time and memory performance are not issues (assuming the chop terminates before you get bored and kill it, and that you have enough RAM to run it).
18
+ <p>Here is the test data I used when developing my methods. Feel free to add to it. The tests assume that array indices start at zero.
19
+ <p><em>The table has been modifed to run all of Ward's versions. Try this yourself with <a href="run.cgi">http:run.cgi</a>.</em>
20
+ <p><table BORDER CELLSPACING=0 CELLPADDING=3>
21
+ <tr><td ColSpan=7> eg.BinaryChop </td></tr>
22
+ <tr><td> key </td><td> array </td><td> mon() </td><td> tue() </td><td> wed() </td><td> thr() </td><td> fri() </td></tr>
23
+ <tr><td> 3 </td><td>&nbsp;</td><td> -1 </td><td> -1 </td><td> -1 </td><td> -1 </td><td> -1 </td></tr>
24
+ <tr><td> 3 </td><td> 1 </td><td> -1 </td><td> -1 </td><td> -1 </td><td> -1 </td><td> -1 </td></tr>
25
+ <tr><td> 1 </td><td> 1 </td><td> 0 </td><td> 0 </td><td> 0 </td><td> 0 </td><td> 0 </td></tr>
26
+ <tr><td> 1 </td><td> 1, 3, 5 </td><td> 0 </td><td> 0 </td><td> 0 </td><td> 0 </td><td> 0 </td></tr>
27
+ <tr><td> 3 </td><td> 1, 3, 5 </td><td> 1 </td><td> 1 </td><td> 1 </td><td> 1 </td><td> 1 </td></tr>
28
+ <tr><td> 5 </td><td> 1, 3, 5 </td><td> 2 </td><td> 2 </td><td> 2 </td><td> 2 </td><td> 2 </td></tr>
29
+ <tr><td> 0 </td><td> 1, 3, 5 </td><td> -1 </td><td> -1 </td><td> -1 </td><td> -1 </td><td> -1 </td></tr>
30
+ <tr><td> 2 </td><td> 1, 3, 5 </td><td> -1 </td><td> -1 </td><td> -1 </td><td> -1 </td><td> -1 </td></tr>
31
+ <tr><td> 4 </td><td> 1, 3, 5 </td><td> -1 </td><td> -1 </td><td> -1 </td><td> -1 </td><td> -1 </td></tr>
32
+ <tr><td> 6 </td><td> 1, 3, 5 </td><td> -1 </td><td> -1 </td><td> -1 </td><td> -1 </td><td> -1 </td></tr>
33
+ <tr><td> 1 </td><td> 1, 3, 5, 7 </td><td> 0 </td><td> 0 </td><td> 0 </td><td> 0 </td><td> 0 </td></tr>
34
+ <tr><td> 3 </td><td> 1, 3, 5, 7 </td><td> 1 </td><td> 1 </td><td> 1 </td><td> 1 </td><td> 1 </td></tr>
35
+ <tr><td> 5 </td><td> 1, 3, 5, 7 </td><td> 2 </td><td> 2 </td><td> 2 </td><td> 2 </td><td> 2 </td></tr>
36
+ <tr><td> 7 </td><td> 1, 3, 5, 7 </td><td> 3 </td><td> 3 </td><td> 3 </td><td> 3 </td><td> 3 </td></tr>
37
+ <tr><td> 0 </td><td> 1, 3, 5, 7 </td><td> -1 </td><td> -1 </td><td> -1 </td><td> -1 </td><td> -1 </td></tr>
38
+ <tr><td> 2 </td><td> 1, 3, 5, 7 </td><td> -1 </td><td> -1 </td><td> -1 </td><td> -1 </td><td> -1 </td></tr>
39
+ <tr><td> 4 </td><td> 1, 3, 5, 7 </td><td> -1 </td><td> -1 </td><td> -1 </td><td> -1 </td><td> -1 </td></tr>
40
+ <tr><td> 6 </td><td> 1, 3, 5, 7 </td><td> -1 </td><td> -1 </td><td> -1 </td><td> -1 </td><td> -1 </td></tr>
41
+ <tr><td> 8 </td><td> 1, 3, 5, 7 </td><td> -1 </td><td> -1 </td><td> -1 </td><td> -1 </td><td> -1 </td></tr>
42
+ </table>
43
+ <p><hr>
44
+ <p>Dave suggests writing this program differently every day for a week. For a week. I've done that. He also suggests keeping track of errors, which I did and summarize as follows.
45
+ <p><p><UL>
46
+ <li> Monday
47
+ <UL>
48
+ <li> off by one
49
+ <li> sense of test
50
+ <li> operator precedence
51
+ <li> leading blanks (in fit)
52
+ <li> null value (in fit)
53
+ </UL>
54
+ <li> Tuesday
55
+ <UL>
56
+ <li> type incompatibility
57
+ <li> sense of test
58
+ </UL>
59
+ <li> Wednesday
60
+ <UL>
61
+ <li> off by one
62
+ <li> offset
63
+ <li> sense of test
64
+ <li> case analysis
65
+ </UL>
66
+ <li> Thursday
67
+ <UL>
68
+ <li> interface
69
+ </UL>
70
+ <li> Friday
71
+ <UL>
72
+ <li> no errors
73
+ <p><p></UL>
74
+ </UL>
75
+ Wednesday was a tough day. Here are the kind of results I was getting while working on my third implementation which was the first to use recursion.
76
+ <p><UL>
77
+ <li> <a href="files/BinaryChop/wednesday.html">http:files/BinaryChop/wednesday.html</a>
78
+ <p></UL>
79
+ Notice that fit kept on running even as I repeatedly exhausted the runtime stack. This allowed me to study the distribution of errors and go directly to the source of my error. Then it worked perfectly.
80
+ <p>See the source.
81
+ <p><UL>
82
+ <li> <a href="Release/Source/eg/BinaryChop.java">http:Release/Source/eg/BinaryChop.java</a>
83
+ </UL>
84
+ </wiki>
85
+ <hr>
86
+ Last edited April 22, 2003
87
+ </body>
88
+ </html>
89
+
@@ -0,0 +1,108 @@
1
+ <html>
2
+ <head>
3
+ <title>Wiki: Calculator Example</title>
4
+ <head>
5
+ <body bgcolor=#FFFFFF link=#d06040 vlink=#806040>
6
+ <h1>Calculator Example</h1>
7
+ <wiki>The HP-35 was HP's first pocket calculator. It was introduced at a time when most calculators had only the four basic functions. The HP-35 was the first pocket calculator with transcendental functions, and the first with RPN.
8
+ <p>The following specifications have been derived from the instructions printed on the back of the calculator. (Image from <a href="//www.hpmuseum.org/hp35.htm">http://www.hpmuseum.org/hp35.htm</a>.)
9
+ <p><img src="files/hp35bk.jpg">
10
+ <p><p>Low battery lights all decimal points.
11
+ <p><table BORDER CELLSPACING=0 CELLPADDING=3>
12
+ <tr><td ColSpan=3>eg.Calculator</td></tr>
13
+ <tr><td>volts</td><td>watts()</td><td>points()</td></tr>
14
+ <tr><td>3.75</td><td>.500</td><td>false</td></tr>
15
+ <tr><td>3.60</td><td>.500</td><td>false</td></tr>
16
+ <tr><td>3.45</td><td>.500</td><td>false</td></tr>
17
+ <tr><td>3.30</td><td>.500</td><td>true</td></tr>
18
+ </table>
19
+ <p>Improper operations flash display. Press <strong>clx</strong>.
20
+ <p><table BORDER CELLSPACING=0 CELLPADDING=3>
21
+ <tr><td ColSpan=3>eg.Calculator</td></tr>
22
+ <tr><td>key</td><td>x()</td><td>flash()</td></tr>
23
+ <tr><td>100</td><td>100</td><td>false</td></tr>
24
+ <tr><td>enter</td><td>100</td><td>false</td></tr>
25
+ <tr><td>0</td><td>0</td><td>false</td></tr>
26
+ <tr><td>/</td><td>0</td><td>true</td></tr>
27
+ <tr><td>clx</td><td>0</td><td>false</td></tr>
28
+ </table>
29
+ <p><strong>clx</strong> clears the display.
30
+ <p><table BORDER CELLSPACING=0 CELLPADDING=3>
31
+ <tr><td ColSpan=5>eg.Calculator</td></tr>
32
+ <tr><td>key</td><td>x()</td><td>y()</td><td>z()</td><td>t()</td></tr>
33
+ <tr><td>100</td><td>100</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr>
34
+ <tr><td>enter</td><td>100</td><td>100</td><td>&nbsp;</td><td>&nbsp;</td></tr>
35
+ <tr><td>enter</td><td>100</td><td>100</td><td>100</td><td>&nbsp;</td></tr>
36
+ <tr><td>enter</td><td>100</td><td>100</td><td>100</td><td>100</td></tr>
37
+ <tr><td>clx</td><td>0</td><td>100</td><td>100</td><td>100</td></tr>
38
+ </table>
39
+ <p><strong>clr</strong> clears all registers.
40
+ <p><table BORDER CELLSPACING=0 CELLPADDING=3>
41
+ <tr><td ColSpan=5>eg.Calculator</td></tr>
42
+ <tr><td>key</td><td>x()</td><td>y()</td><td>z()</td><td>t()</td></tr>
43
+ <tr><td>100</td><td>100</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr>
44
+ <tr><td>enter</td><td>100</td><td>100</td><td>&nbsp;</td><td>&nbsp;</td></tr>
45
+ <tr><td>enter</td><td>100</td><td>100</td><td>100</td><td>&nbsp;</td></tr>
46
+ <tr><td>enter</td><td>100</td><td>100</td><td>100</td><td>100</td></tr>
47
+ <tr><td>clr</td><td>0</td><td>0</td><td>0</td><td>0</td></tr>
48
+ </table>
49
+ <p><strong>chs</strong> changes sign of display. May be used as the first entry when entering negative numbers.
50
+ <p><table BORDER CELLSPACING=0 CELLPADDING=3>
51
+ <tr><td ColSpan=3>eg.Calculator</td></tr>
52
+ <tr><td>key</td><td>x()</td><td>y()</td></tr>
53
+ <tr><td>100</td><td>100</td><td>0</td></tr>
54
+ <tr><td>chs</td><td>-100</td><td>0</td></tr>
55
+ <tr><td>chs</td><td>100</td><td>0</td></tr>
56
+ <tr><td>enter</td><td>100</td><td>100</td></tr>
57
+ <tr><td>chs</td><td>-0</td><td>100</td></tr>
58
+ <tr><td>100</td><td>-100</td><td>100</td></tr>
59
+ </table>
60
+ <p><strong>eex</strong> causes next entries to become the exponent of x. For negative expoinents <strong>chs</strong> must precede digits.
61
+ <p>The operational stack consistes of four registers (x, y, z and t). A fifth register (s) is used for constant storage.
62
+ <p>The stack is automatically raised by an entry into x or by <strong>rcl</strong> unless the entry or <strong>rcl</strong> immediately follows <strong>clx</strong>, <strong>sto</strong> or <strong>enter</strong>.
63
+ <p>Follwing any trig function z is duplicated into register t.
64
+ <p>All angles are in degrees.
65
+ <p>Example (2+3) * (4/5) / sin(30) * (4^-1.5) = 1.0000
66
+ <p><table BORDER CELLSPACING=0 CELLPADDING=3>
67
+ <tr><td ColSpan=3> eg.Calculator </td></tr>
68
+ <tr><td>key</td><td>x()</td><td>y()</td></tr>
69
+ <tr><td>2</td><td>2</td><td>&nbsp;</td></tr>
70
+ <tr><td>enter</td><td>2</td><td>2</td></tr>
71
+ <tr><td>3</td><td>3</td><td>2</td></tr>
72
+ <tr><td>+</td><td>5</td><td>&nbsp;</td></tr>
73
+ <tr><td>4</td><td>4</td><td>5</td></tr>
74
+ <tr><td>*</td><td>20</td><td>&nbsp;</td></tr>
75
+ <tr><td>5</td><td>5</td><td>20</td></tr>
76
+ <tr><td>/</td><td>4</td><td>&nbsp;</td></tr>
77
+ <tr><td>30</td><td>30</td><td>4</td></tr>
78
+ <tr><td>sin</td><td>.5</td><td>4</td></tr>
79
+ <tr><td>/</td><td>6</td><td>&nbsp;</td></tr>
80
+ <tr><td>-1.5</td><td>-1.5</td><td>8</td></tr>
81
+ <tr><td>enter</td><td>-1.5</td><td>-1.5</td></tr>
82
+ <tr><td>4</td><td>4</td><td>-1.5</td></tr>
83
+ <tr><td>x^y</td><td>.125</td><td>8</td></tr>
84
+ <tr><td>*</td><td>1.0000</td><td>&nbsp;</td></tr>
85
+ </table>
86
+ <p><hr>
87
+ <table BORDER CELLSPACING=0 CELLPADDING=3>
88
+ <tr><td>fit.Summary</td></tr>
89
+ </table>
90
+ <hr>
91
+ <p>You can run this document as it stands right now against a calculator implemented at c2.com using the RunScript below. You will find that that the tests, the fixture and the calculator code are all not yet complete. Failing tests turn a cell red. There are two values in the cell. The top one is the expected result. The bottom is the actual result.
92
+ <p><UL>
93
+ <li> <a href="run.cgi">http:run.cgi</a> -- invoke on c2.com and view results here
94
+ <li> <a href="hp35.cgi">http:hp35.cgi</a> -- model constrained generated test data
95
+ <li> <a href="Release/Source/eg/Calculator.java">http:Release/Source/eg/Calculator.java</a> -- the HP35 calculator and its fixture
96
+ <p></UL>
97
+ <hr>
98
+ <p>I'd like to see a manual interface to this calculator. It would provide keys and a display of the x value, just like a regular calculator. Doing this would point out some interesting differences between the programming and manual interfaces. One issue i'm curious about would be that keys would be digits, not complete numbers. So some mechanism would need to be created to convert. A manual interface would help to illustrate the concept of how you can test by going under the GUI. This is a hard concept for testers to understand.
99
+ <p>I have some comments on the perl hp35 simulator. I'm realizing that they'd be easier to make if i could cite tests. But that is hard, because they are random. Thus my first suggestion: Random tests should log the seed they used to generate them. And the script should be able to take a seed as an argument to regenerate the same test. This is a general rule for random tests, that i didn't get around to including in LessonsLearned. And, this would allow me to create a URL to a specific instance of a randomly generated test -- which would help me make my next suggestion.
100
+ <p>Second suggestion. Many of the tests using the hp35 simulator fail because of differences in precision. I would think that you'd want your fixture to be able to accept differences beyond a certain precision. Perhaps by setting a tolerance or something. Any tester who reported a bug simply because the implementation was calculating to a different level of precision than the oracle would be dismissed as wasting people's time. The fixtures need to have more sensitivity here. -- Oh i see i see that you (claim to) have addressed this in ScientificPrecision. Then why am i still seeing these problems?
101
+ <p>Hey. I'm seeing something strange with the calculator model. I generate a test (more) and then run it (run). And the test that is run is NOT THE SAME as the test that i just generated. This might be easier to track down if i could specify seeds.
102
+ <p>-- BretPettichord
103
+ <p><p><p></wiki>
104
+ <hr>
105
+ Last edited November 23, 2002
106
+ </body>
107
+ </html>
108
+
@@ -0,0 +1,43 @@
1
+ <html>
2
+ <head>
3
+ <title>Wiki: Column Index</title>
4
+ <head>
5
+ <body bgcolor=#FFFFFF link=#d06040 vlink=#806040>
6
+ <h1>Column Index</h1>
7
+ <wiki>Here are the methods of assorted Fixtures.
8
+ <p><a href="run.cgi">http:run.cgi</a>
9
+ <p><table BORDER CELLSPACING=0 CELLPADDING=3>
10
+ <tr><td ColSpan=6>eg.<a href=wiki.cgi?ColumnIndex>ColumnIndex</a> </td></tr>
11
+ <tr><td> className </td><td> columnName </td><td> columnType </td><td>&nbsp;</td></tr>
12
+ <tr><td> eg.music.Music </td><td> title </td><td> String </td><td>&nbsp;</td></tr>
13
+ <tr><td> eg.music.Music </td><td> album </td><td> String </td><td>&nbsp;</td></tr>
14
+ <tr><td> eg.music.Music </td><td> artist </td><td> String </td><td>&nbsp;</td></tr>
15
+ <tr><td> eg.music.Music </td><td> genre </td><td> String </td><td>&nbsp;</td></tr>
16
+ <tr><td> eg.music.Music </td><td> year </td><td> Fixnum </td><td> copyright date </td></tr>
17
+ <tr><td> eg.music.Music </td><td> track() </td><td> String </td><td> number of count </td></tr>
18
+ <tr><td> eg.music.Music </td><td> trackCount </td><td> Fixnum </td><td>&nbsp;</td></tr>
19
+ <tr><td> eg.music.Music </td><td> trackNumber </td><td> Fixnum </td><td>&nbsp;</td></tr>
20
+ <tr><td> eg.music.Music </td><td> seconds </td><td> Fixnum </td><td> playing time in seconds </td></tr>
21
+ <tr><td> eg.music.Music </td><td> time() </td><td> Float </td><td> playing time in minutes </td></tr>
22
+ <tr><td> eg.music.Music </td><td> date </td><td> Time </td><td> date uploaded </td></tr>
23
+ <tr><td> eg.music.Music </td><td> size </td><td> Fixnum </td><td> mp3 size </td></tr>
24
+ <tr><td> eg.music.Music </td><td> toString() </td><td> String </td><td>&nbsp;</td></tr>
25
+ </table>
26
+ <p><table BORDER CELLSPACING=0 CELLPADDING=3>
27
+ <tr><td ColSpan=3> eg.<a href=wiki.cgi?ColumnIndex>ColumnIndex</a> </td></tr>
28
+ <tr><td> className </td><td> columnName </td><td> columnType </td></tr>
29
+ <tr><td> eg.<a href=wiki.cgi?ColumnIndex>ColumnIndex</a>$Column </td><td> columnName </td><td> String </td></tr>
30
+ <tr><td> eg.<a href=wiki.cgi?ColumnIndex>ColumnIndex</a>$Column </td><td> className </td><td> Class </td></tr>
31
+ <tr><td> eg.<a href=wiki.cgi?ColumnIndex>ColumnIndex</a>$Column </td><td> columnType </td><td> Class </td></tr>
32
+ <tr><td> eg.<a href=wiki.cgi?ColumnIndex>ColumnIndex</a>$Column </td><td> column </td><td> Object </td></tr>
33
+ <tr><td> Object </td><td> toString() </td><td> String </td></tr>
34
+ </table>
35
+ <p></p></wiki>
36
+
37
+ <hr>
38
+
39
+ Last edited October 7, 2002<br>
40
+
41
+ </body>
42
+ </html>
43
+
@@ -0,0 +1,43 @@
1
+ <html>
2
+ <head>
3
+ <title>Wiki: Example Tests</title>
4
+ <head>
5
+ <body bgcolor=#FFFFFF link=#d06040 vlink=#806040>
6
+ <h1>Example Tests</h1>
7
+ <wiki>These are examples that you can view and run from this site right now.
8
+ <p><UL>
9
+ <li> SimpleExample -- Start here. This test checks floating-point division using a five-line fixture.
10
+ <p><li> CalculatorExample -- This test checks an HP-35 calculator simulator with assorted tables, all using the same column fixture. This includes a model based test generator.
11
+ <p><li> MusicExample -- Iinspired by Apple's iTunes, we test browsing of a music library using a combination of ActionFixture and RowFixture.
12
+ <p><li> WebPageExample -- We use a fixture to browse the web. The Page fixture hosts actions for ActionFixture and produces rows as a RowFixture.
13
+ <p><li> AllPairsExample -- These fixtures find and run other tests. Wildcard searches produce lists which are run in order, run in all combinations and run in all pair-wise combinations.
14
+ <p></UL>
15
+ These are examples that are still in development.
16
+ <p><UL>
17
+ <li> NetworkExample -- This tests a simulated radio network using action fixtures.
18
+ <p><li> TimeClockJobStatusExample -- This tests a GUI application with action and row fixtures. Compare this with ruby script tests for the same application.
19
+ <p></UL>
20
+ <hr>
21
+ <p>We use these examples for testing new implementations. Here is an example that runs the other examples. Click <a href="run.cgi">http:run.cgi</a> to perform this test.
22
+ <p><table BORDER CELLSPACING=0 CELLPADDING=3>
23
+ <tr><td ColSpan=6> eg.ExampleTests </td></tr>
24
+ <tr><td> file </td><td> wiki </td><td> right() </td><td> wrong() </td><td> ignores() </td><td> exceptions() </td></tr>
25
+ <tr><td> arithmetic.html </td><td> false </td><td> 37 </td><td> 10 </td><td> 0 </td><td> 2 </td></tr>
26
+ <tr><td> CalculatorExample.html </td><td> true </td><td> 75 </td><td> 9 </td><td> 0 </td><td> 0 </td></tr>
27
+ <tr><td> MusicExample.html </td><td> true </td><td> 95 </td><td> 0 </td><td> 0 </td><td> 0 </td></tr>
28
+ <tr><td> MusicExampleWithErrors.html </td><td> true </td><td> 54 </td><td> 10 </td><td> 0 </td><td> 0 </td></tr>
29
+ <tr><td> NetworkExample.html </td><td> true </td><td> 5 </td><td> 0 </td><td> 0 </td><td> 0 </td></tr>
30
+ <tr><td> AllFiles.html </td><td> true </td><td> 9 </td><td> 3 </td><td> 0 </td><td> 0 </td></tr>
31
+ <tr><td> AllCombinations.html </td><td> true </td><td> 80 </td><td> 6 </td><td> 0 </td><td> 0 </td></tr>
32
+ <tr><td> AllPairs.html </td><td> true </td><td> 45 </td><td> 3 </td><td> 0 </td><td> 0 </td></tr>
33
+ </table>
34
+ <p>We are only testing that we get the expected counts of right and wrong. There are twenty of these count comparisions above. But there are actually many more tests preformed. This fixture adds an extra line to the summary so that we can feel good even though LessonsLearned advises us not to base our confidence on test counts which are easily inflated.
35
+ <p><table BORDER CELLSPACING=0 CELLPADDING=3>
36
+ <tr><td ColSpan=2> fit.Summary </td></tr>
37
+ </table>
38
+ <p>See the fixture: <a href="Release/Source/eg/ExampleTests.java">http:Release/Source/eg/ExampleTests.java</a></wiki>
39
+ <hr>
40
+ Last edited April 20, 2003
41
+ </body>
42
+ </html>
43
+
@@ -0,0 +1,53 @@
1
+ <html>
2
+ <head>
3
+ <title>Wiki: Fit Acceptance Tests</title>
4
+ <head>
5
+ <body bgcolor=#FFFFFF link=#d06040 vlink=#806040>
6
+ <h1>Fit Acceptance Tests</h1>
7
+ <wiki>These are the tests that we expect any implementation of fit to pass. Run these tests with the following command. Be patient. This can take some time.
8
+ <p><UL>
9
+ <li> <a href="run.cgi">http:run.cgi</a>
10
+ <p></UL>
11
+ First we define the various framework implementations we will be testing. Each implementation provides a RunScript that will return and annotated version of the test pages listed below.
12
+ <p><p><table BORDER CELLSPACING=0 CELLPADDING=3>
13
+ <tr><td ColSpan=3> fat.Frameworks </td></tr>
14
+ <tr><td> language </td><td> page </td><td> runscript </td></tr>
15
+ <tr><td> java </td><td> JavaPlatform </td><td> <a href="//fit.c2.com/fatJava.cgi">http://fit.c2.com/fatJava.cgi</a>? </td></tr>
16
+ <tr><td> c# </td><td> DotNetPlatform </td><td>&nbsp;</td></tr>
17
+ <tr><td> clisp </td><td> LispPlatform </td><td> <a href="//fit.c2.com/fatLisp.cgi">http://fit.c2.com/fatLisp.cgi</a>? </td></tr>
18
+ <tr><td> scheme </td><td> LispPlatform </td><td> <a href="//fit.c2.com/fatScheme.cgi">http://fit.c2.com/fatScheme.cgi</a>? </td></tr>
19
+ </table>
20
+ <p><p>Then we list the tests that we expect them to pass. For each test and each language we run the test with that language's runscrip and report the the wrong and exception counts. 0/0 means all tests passed.
21
+ <p>We will group tests into categories. We begin with the two examples from fit.c2.com that are expected to be free of errors. These are the 'tests' recommended in TipsForCoreImplementors.
22
+ <p><table BORDER CELLSPACING=0 CELLPADDING=3>
23
+ <tr><td ColSpan=5> fat.Tests </td></tr>
24
+ <tr><td> page </td><td> java </td><td> c# </td><td> clisp </td><td> scheme </td></tr>
25
+ <tr><td> SimpleExample </td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr>
26
+ <tr><td> MusicExample </td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr>
27
+ </table>
28
+ <p>Now we proceed with more through specification and testing of exactly what an implementation must do to be a version 1.0 implementation.
29
+ <p><table BORDER CELLSPACING=0 CELLPADDING=3>
30
+ <tr><td ColSpan=5> fat.Tests </td></tr>
31
+ <tr><td> page </td><td> java </td><td> c# </td><td> clisp </td><td> scheme </td></tr>
32
+ </table>
33
+ <p><em>(Nothing hear yet. This is an active area of development.)</em>
34
+ <p>Some implementations have capabilities beyond that currently considered part of the fit core. These are under consideration as core pending positive experience in real testing and support from a majority of implementations.
35
+ <p><table BORDER CELLSPACING=0 CELLPADDING=3>
36
+ <tr><td ColSpan=5> fat.Tests </td></tr>
37
+ <tr><td> page </td><td> java </td><td> c# </td><td> clisp </td><td> scheme </td></tr>
38
+ </table>
39
+ <p><em>(Nothing hear yet. This is an active area of development.)</em>
40
+ <p><hr>
41
+ <p>These fixtures are really test runners written as fixtures. The <strong>Frameworks</strong> fixture collects information about the framework implementations to be tested. The <strong>Tests</strong> fixture combines this information with a list of test pages and reports run results in the remaining blank cells of the table.
42
+ <p>The actual running of the tests is delegated to cgi scripts that can be scattered around the internet. Not all implementations need be hosted here at fit.c2.com. We ask that implementors provide a cgi specifically for running these tests that doesn't exploit the HttpReferer trick common with RunScript. This makes tracking down test failures much simpler.
43
+ <p>The interaction with these cgi scripts is model on the fixture used in the WebPageExample. The td tags present in the cgi output are classified as red, green, yellow or gray based on the presence of bgcolor attributes in the tags. The various colors are counted and selected totals reported.
44
+ <p>See the source.
45
+ <p><UL>
46
+ <li> <a href="Release/Source/fat/Frameworks.java">http:Release/Source/fat/Frameworks.java</a>
47
+ <li> <a href="Release/Source/fat/Tests.java">http:Release/Source/fat/Tests.java</a></UL>
48
+ </wiki>
49
+ <hr>
50
+ Last edited April 22, 2003
51
+ </body>
52
+ </html>
53
+