[Laszlo-checkins] r3724 - sandbox/frisco/trunk/docs/src/dguide
frisco@openlaszlo.org
frisco at openlaszlo.org
Wed Feb 7 20:07:12 PST 2007
Author: frisco
Date: 2007-02-07 20:07:08 -0800 (Wed, 07 Feb 2007)
New Revision: 3724
Modified:
sandbox/frisco/trunk/docs/src/dguide/testdriven.html
Log:
Change 20070207-laszlosystems-E by laszlosystems at Frisco-Mini.local on 2007-02-07 20:03:33 PST
in /Users/laszlosystems/src/svn/openlaszlo/sandbox
Summary:
New Features:
Bugs Fixed:
Technical Reviewer: (pending)
QA Reviewer: (pending)
Doc Reviewer: (pending)
Documentation:
Release Notes:
Details:
Tests:
Modified: sandbox/frisco/trunk/docs/src/dguide/testdriven.html
===================================================================
--- sandbox/frisco/trunk/docs/src/dguide/testdriven.html 2007-02-08 03:37:50 UTC (rev 3723)
+++ sandbox/frisco/trunk/docs/src/dguide/testdriven.html 2007-02-08 04:07:08 UTC (rev 3724)
@@ -19,9 +19,9 @@
<li>Remove duplication</li>
</ol>
-<h4>Think Like a Grandmaster</h4>
+<h3>Think Like a Grandmaster</h3>
-<p>According to Beck, test-driven development gives a programmer courage. When the end of a difficult programming task is not in sight, bringing one failing or "red" test to "green" signifies one concrete, irreversible step forward.</p>
+<p>According to Beck, test-driven development gives a programmer courage. When the end of a difficult programming task is not in sight, bringing one failing or "red" test to "green" signifies one concrete step forward.</p>
<p>Test-driven development demands thoughtful design. In the "waterfall" model, testing is the last phase. As a beginning programmer, I stumble through the implementation phase, not certain that the code will fulfill the requirements <i>because it is untested</i>. In test-first development, the programmer must be accurate and specific about what the code is meant to accomplish, then design a test for that.</p>
@@ -29,7 +29,7 @@
<p>Another analogy: A well-trained chess student should be coached to play moves that are foolish at the start -- as practice for difficult situations in the future. Beck instructs that at the start of the TDD cycle to write a test that <i>fails</i>. Red in the opening, green in the endgame.</p>
-<h4>Test-Driven Documentation</h4>
+<h3>Test-Driven Documentation</h3>
<p>The computer science instructors who stress the <a href="http://en.wikipedia.org/wiki/Big_Design_Up_Front">Big Design Up Front</a> methodology would probably require that I understand TDD at a professional level before I write this. The test-driven methodology, on the other hand, says that if each code example takes a tiny step while adhering to test-driven principles, I can write with confidence.</p>
@@ -39,10 +39,10 @@
<li>To demonstrate test-driven development through the construction of simple OpenLaszlo applications;</li>
<li>To build upon the OpenLaszlo developers' guide section about <a href="/docs/guide/lzunit.html">LzUnit</a>, the <a href="http://www.junit.org">JUnit</a> framework for OpenLaszlo;</li>
<li>To complete the LzUnit-related documentation tasks assigned to me in the OpenLaszlo <a href="http://www.openlaszlo.org/jira/secure/Dashboard.jspa">bug reporting database</a>, so I can think of this as actual work;</li>
- <li>Learn.</li>
+ <li>To learn.</li>
</ol>
-<h4>Teeny Tiny Steps</h4>
+<h3>Teeny Tiny Steps</h3>
<p>Many folks seem to be hoping that a writer's life is mystical and arcane, but Beck, a software engineer, understands it completely. I knew Beck was speaking my language when he wrote in <i>JUnit Pocket Guide</i>: "Writers write. Testers test." In <i>Test-Driven Development</i>, Beck cut through the knot that has buried my programming education since the beginning. "Take teeny tiny steps," he said.</p>
@@ -90,15 +90,16 @@
<example class="code" title="test-stub">
<canvas debug="true">
+<debug y="150"/>
<include href="lzunit"/>
<simplelayout axis="y" spacing="10"/>
<TestSuite>
- <TestCase>
- <method name="test">
-
- </method>
- </TestCase>
+ <TestCase>
+ <method name="test">
+
+ </method>
+ </TestCase>
</TestSuite>
</canvas>
@@ -108,15 +109,16 @@
<example class="code" title="testGoButtonTrue">
<canvas debug="true">
+<debug y="150"/>
<include href="lzunit"/>
<simplelayout axis="y" spacing="10"/>
<TestSuite>
- <TestCase>
- <method name="testGoButtonTrue">
- assertTrue(goButton.go);
- </method>
- </TestCase>
+ <TestCase>
+ <method name="testGoButtonTrue">
+ assertTrue(goButton.go);
+ </method>
+ </TestCase>
</TestSuite>
</canvas>
@@ -132,6 +134,7 @@
<example class="code" title="testGoButtonTrue">
<canvas debug="true">
+<debug y="150"/>
<include href="lzunit"/>
<simplelayout axis="y" spacing="10"/>
@@ -146,7 +149,7 @@
<method name="testGoButtonTrue">
assertTrue(goButton.go);
</method>
- </TestCase>
+ </TestCase>
</TestSuite>
</canvas>
@@ -160,6 +163,7 @@
<example class="code" title="testGoButtonTrueFalse">
<canvas debug="true">
+<debug y="150"/>
<include href="lzunit"/>
<simplelayout axis="y" spacing="10"/>
@@ -187,7 +191,7 @@
<method name="testGoButtonTrue">
assertTrue(goButton.go);
</method>
- </TestCase>
+ </TestCase>
</TestSuite>
</canvas>
@@ -199,6 +203,7 @@
<example class="code" title="testGoButtonCounter">
<canvas debug="true">
+<debug y="150"/>
<include href="lzunit"/>
<simplelayout axis="y" spacing="10"/>
@@ -222,10 +227,10 @@
<TestSuite>
<TestCase>
<method name="testGoButtonTrue">
- assertEquals(1, goButton.counter);
+ assertEquals(1, goButton.counter);
assertTrue(goButton.go);
</method>
- </TestCase>
+ </TestCase>
</TestSuite>
</canvas>
@@ -235,6 +240,7 @@
<example class="code" title="testGoButtonCounter">
<canvas debug="true">
+<debug y="150"/>
<include href="lzunit"/>
<simplelayout axis="y" spacing="10"/>
@@ -259,10 +265,10 @@
<TestSuite>
<TestCase>
<method name="testGoButtonTrue">
- assertEquals(1, goButton.counter);
+ assertEquals(1, goButton.counter);
assertTrue(goButton.go);
</method>
- </TestCase>
+ </TestCase>
</TestSuite>
</canvas>
@@ -272,6 +278,7 @@
<example class="code" title="testGoButtonWhile">
<canvas debug="true">
+<debug y="150"/>
<include href="lzunit"/>
<simplelayout axis="y" spacing="10"/>
@@ -280,14 +287,14 @@
<attribute name="go" type="boolean" value="true"/>
<attribute name="counter" type="number" value="1" when="once"/>
-<method event="onclick">
+<method event="onclick">
if (goButton.go==true) {
this.setAttribute('text', 'Stop');
this.setAttribute('go', false);
while (goButton.counter < Number.MAX_VALUE) {
- Debug.write(goButton.counter);
- counter++;
- }
+ Debug.write(goButton.counter);
+ counter++;
+ }
}
else {
this.setAttribute('text', 'Go');
@@ -300,10 +307,10 @@
<TestSuite>
<TestCase>
<method name="testGoButtonTrue">
- assertEquals(1, goButton.counter);
+ assertEquals(1, goButton.counter);
assertTrue(goButton.go);
</method>
- </TestCase>
+ </TestCase>
</TestSuite>
</canvas>
@@ -317,15 +324,16 @@
<example class="code" title="testIdle">
<canvas debug="true">
+<debug y="150"/>
<include href="lzunit"/>
<simplelayout axis="y" spacing="10"/>
<TestSuite>
- <TestCase>
- <method name="testIdle">
- assertTrue(this.idle);
- </method>
- </TestCase>
+ <TestCase>
+ <method name="testIdle">
+ assertTrue(this.idle);
+ </method>
+ </TestCase>
</TestSuite>
</canvas>
@@ -351,23 +359,24 @@
<example class="code" title="testIdle">
<canvas debug="true">
+<debug y="150"/>
<include href="lzunit"/>
<simplelayout axis="y" spacing="10"/>
- <method name="wake" event="oninit">
- foo = new LzDelegate(this, "sleep", LzIdle, "onidle");
- </method>
+ <method name="wake" event="oninit">
+ foo = new LzDelegate(this, "sleep", LzIdle, "onidle");
+ </method>
- <method name="sleep">
- Debug.write("Sleeping");
- </method>
+ <method name="sleep">
+ Debug.write("Sleeping");
+ </method>
<TestSuite>
- <TestCase>
- <method name="testIdle">
- assertTrue(this.idle);
- </method>
- </TestCase>
+ <TestCase>
+ <method name="testIdle">
+ assertTrue(this.idle);
+ </method>
+ </TestCase>
</TestSuite>
</canvas>
@@ -381,6 +390,7 @@
<example class="code" title="testGoButtonCount">
<canvas debug="true">
+<debug y="150"/>
<include href="lzunit"/>
<simplelayout axis="y" spacing="10"/>
@@ -390,7 +400,7 @@
<attribute name="counter" type="number" value="1" when="once"/>
<method event="onclick">
- if (goButton.go==true && goButton.counter<Number.MAX_VALUE) {
+ if (goButton.go==true & & goButton.counter<Number.MAX_VALUE) {
foo = new LzDelegate(this, "count", LzIdle, "onidle");
this.setAttribute('text', 'Stop');
this.setAttribute('go', false);
@@ -412,10 +422,10 @@
<TestSuite>
<TestCase>
<method name="testGoButtonTrue">
- assertEquals(1, goButton.counter);
- assertTrue(goButton.go);
+ assertEquals(1, goButton.counter);
+ assertTrue(goButton.go);
</method>
- </TestCase>
+ </TestCase>
</TestSuite>
</canvas>
@@ -437,6 +447,7 @@
<example class="code" title="testGoButtonCount">
<canvas debug="true">
+<debug y="150"/>
<include href="lzunit"/>
<simplelayout axis="y" spacing="10"/>
@@ -446,7 +457,7 @@
<attribute name="counter" type="number" value="1" when="once"/>
<method event="onclick">
- if (goButton.go==true && goButton.counter<Number.MAX_VALUE) {
+ if (goButton.go==true & & goButton.counter<Number.MAX_VALUE) {
foo = new LzDelegate(this, "count", LzIdle, "onidle");
this.setAttribute('text', 'Stop');
this.setAttribute('go', false);
@@ -469,10 +480,10 @@
<TestSuite>
<TestCase>
<method name="testGoButtonTrue">
- assertEquals(1, goButton.counter);
+ assertEquals(1, goButton.counter);
assertTrue(goButton.go);
</method>
- </TestCase>
+ </TestCase>
</TestSuite>
</canvas>
More information about the Laszlo-checkins
mailing list