[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">
 &lt;canvas debug="true"&gt;
+&lt;debug y="150"/&gt;
 &lt;include href="lzunit"/&gt;
 &lt;simplelayout axis="y" spacing="10"/&gt;
 
 &lt;TestSuite&gt;
-	&lt;TestCase&gt;
-		&lt;method name="test"&gt;
-		
-		&lt;/method&gt;
-	&lt;/TestCase&gt;	
+    &lt;TestCase&gt;
+        &lt;method name="test"&gt;
+        
+        &lt;/method&gt;
+    &lt;/TestCase&gt;   
 &lt;/TestSuite&gt;
 
 &lt;/canvas&gt;
@@ -108,15 +109,16 @@
 
 <example class="code" title="testGoButtonTrue">
 &lt;canvas debug="true"&gt;
+&lt;debug y="150"/&gt;
 &lt;include href="lzunit"/&gt;
 &lt;simplelayout axis="y" spacing="10"/&gt;
 
 &lt;TestSuite&gt;
-	&lt;TestCase&gt;
-		&lt;method name="testGoButtonTrue"&gt;
-			assertTrue(goButton.go);
-		&lt;/method&gt;
-	&lt;/TestCase&gt;	
+    &lt;TestCase&gt;
+        &lt;method name="testGoButtonTrue"&gt;
+            assertTrue(goButton.go);
+        &lt;/method&gt;
+    &lt;/TestCase&gt;   
 &lt;/TestSuite&gt;
 
 &lt;/canvas&gt;
@@ -132,6 +134,7 @@
 
 <example class="code" title="testGoButtonTrue">
 &lt;canvas debug="true"&gt;
+&lt;debug y="150"/&gt;
 &lt;include href="lzunit"/&gt;
 &lt;simplelayout axis="y" spacing="10"/&gt;
 
@@ -146,7 +149,7 @@
         &lt;method name="testGoButtonTrue"&gt;
             assertTrue(goButton.go);
         &lt;/method&gt;
-    &lt;/TestCase&gt;	
+    &lt;/TestCase&gt;   
 &lt;/TestSuite&gt;
 
 &lt;/canvas&gt;
@@ -160,6 +163,7 @@
 
 <example class="code" title="testGoButtonTrueFalse">
 &lt;canvas debug="true"&gt;
+&lt;debug y="150"/&gt;
 &lt;include href="lzunit"/&gt;
 &lt;simplelayout axis="y" spacing="10"/&gt;
 
@@ -187,7 +191,7 @@
         &lt;method name="testGoButtonTrue"&gt;
             assertTrue(goButton.go);
         &lt;/method&gt;
-    &lt;/TestCase&gt;	
+    &lt;/TestCase&gt;   
 &lt;/TestSuite&gt;
 
 &lt;/canvas&gt;
@@ -199,6 +203,7 @@
 
 <example class="code" title="testGoButtonCounter">
 &lt;canvas debug="true"&gt;
+&lt;debug y="150"/&gt;
 &lt;include href="lzunit"/&gt;
 &lt;simplelayout axis="y" spacing="10"/&gt;
 
@@ -222,10 +227,10 @@
 &lt;TestSuite&gt;
     &lt;TestCase&gt;
         &lt;method name="testGoButtonTrue"&gt;
-        	assertEquals(1, goButton.counter);
+            assertEquals(1, goButton.counter);
             assertTrue(goButton.go);
         &lt;/method&gt;
-    &lt;/TestCase&gt;	
+    &lt;/TestCase&gt;   
 &lt;/TestSuite&gt;
 
 &lt;/canvas&gt;
@@ -235,6 +240,7 @@
 
 <example class="code" title="testGoButtonCounter">
 &lt;canvas debug="true"&gt;
+&lt;debug y="150"/&gt;
 &lt;include href="lzunit"/&gt;
 &lt;simplelayout axis="y" spacing="10"/&gt;
 
@@ -259,10 +265,10 @@
 &lt;TestSuite&gt;
     &lt;TestCase&gt;
         &lt;method name="testGoButtonTrue"&gt;
-        	assertEquals(1, goButton.counter);
+            assertEquals(1, goButton.counter);
             assertTrue(goButton.go);
         &lt;/method&gt;
-    &lt;/TestCase&gt;	
+    &lt;/TestCase&gt;   
 &lt;/TestSuite&gt;
 
 &lt;/canvas&gt;
@@ -272,6 +278,7 @@
 
 <example class="code" title="testGoButtonWhile">
 &lt;canvas debug="true"&gt;
+&lt;debug y="150"/&gt;
 &lt;include href="lzunit"/&gt;
 &lt;simplelayout axis="y" spacing="10"/&gt;
 
@@ -280,14 +287,14 @@
 &lt;attribute name="go" type="boolean" value="true"/&gt;
 &lt;attribute name="counter" type="number" value="1" when="once"/&gt;
 
-&lt;method event="onclick">
+&lt;method event="onclick"&gt;
     if (goButton.go==true) {
         this.setAttribute('text', 'Stop');
         this.setAttribute('go', false);
         while (goButton.counter &lt; Number.MAX_VALUE) {
-        	Debug.write(goButton.counter);
-        	counter++;
-        	}
+            Debug.write(goButton.counter);
+            counter++;
+            }
         }
     else {
     this.setAttribute('text', 'Go');
@@ -300,10 +307,10 @@
 &lt;TestSuite&gt;
     &lt;TestCase&gt;
         &lt;method name="testGoButtonTrue"&gt;
-        	assertEquals(1, goButton.counter);
+            assertEquals(1, goButton.counter);
             assertTrue(goButton.go);
         &lt;/method&gt;
-    &lt;/TestCase&gt;	
+    &lt;/TestCase&gt;   
 &lt;/TestSuite&gt;
 
 &lt;/canvas&gt;
@@ -317,15 +324,16 @@
 
 <example class="code" title="testIdle">
 &lt;canvas debug="true"&gt;
+&lt;debug y="150"/&gt;
 &lt;include href="lzunit"/&gt;
 &lt;simplelayout axis="y" spacing="10"/&gt;
 
 &lt;TestSuite&gt;
-	&lt;TestCase&gt;
-		&lt;method name="testIdle"&gt;
-			assertTrue(this.idle);
-		&lt;/method&gt;
-	&lt;/TestCase&gt;
+    &lt;TestCase&gt;
+        &lt;method name="testIdle"&gt;
+            assertTrue(this.idle);
+        &lt;/method&gt;
+    &lt;/TestCase&gt;
 &lt;/TestSuite&gt;
 
 &lt;/canvas&gt;
@@ -351,23 +359,24 @@
 
 <example class="code" title="testIdle">
 &lt;canvas debug="true"&gt;
+&lt;debug y="150"/&gt;
 &lt;include href="lzunit"/&gt;
 &lt;simplelayout axis="y" spacing="10"/&gt;
 
-	&lt;method name="wake" event="oninit"&gt;
-		foo = new LzDelegate(this, "sleep", LzIdle, "onidle");
-	&lt;/method&gt;
+    &lt;method name="wake" event="oninit"&gt;
+        foo = new LzDelegate(this, "sleep", LzIdle, "onidle");
+    &lt;/method&gt;
     
-	&lt;method name="sleep"&gt;
-		Debug.write("Sleeping");
-	&lt;/method&gt;
+    &lt;method name="sleep"&gt;
+        Debug.write("Sleeping");
+    &lt;/method&gt;
 
 &lt;TestSuite&gt;
-	&lt;TestCase&gt;
-		&lt;method name="testIdle"&gt;
-			assertTrue(this.idle);
-		&lt;/method&gt;
-	&lt;/TestCase&gt;	
+    &lt;TestCase&gt;
+        &lt;method name="testIdle"&gt;
+            assertTrue(this.idle);
+        &lt;/method&gt;
+    &lt;/TestCase&gt;   
 &lt;/TestSuite&gt;
 
 &lt;/canvas&gt;
@@ -381,6 +390,7 @@
 
 <example class="code" title="testGoButtonCount">
 &lt;canvas debug="true"&gt;
+&lt;debug y="150"/&gt;
 &lt;include href="lzunit"/&gt;
 &lt;simplelayout axis="y" spacing="10"/&gt;
 
@@ -390,7 +400,7 @@
 &lt;attribute name="counter" type="number" value="1" when="once"/&gt;
 
 &lt;method event="onclick"&gt;
-    if (goButton.go==true &amp;&amp; goButton.counter&lt;Number.MAX_VALUE) {
+    if (goButton.go==true &amp; &amp; goButton.counter&lt;Number.MAX_VALUE) {
         foo = new LzDelegate(this, "count", LzIdle, "onidle");
         this.setAttribute('text', 'Stop');
         this.setAttribute('go', false);
@@ -412,10 +422,10 @@
 &lt;TestSuite&gt;
     &lt;TestCase&gt;
         &lt;method name="testGoButtonTrue"&gt;
-        	assertEquals(1, goButton.counter);
-            assertTrue(goButton.go);
+          assertEquals(1, goButton.counter);
+          assertTrue(goButton.go);
         &lt;/method&gt;
-    &lt;/TestCase&gt;	
+    &lt;/TestCase&gt;   
 &lt;/TestSuite&gt;
 
 &lt;/canvas&gt;
@@ -437,6 +447,7 @@
 
 <example class="code" title="testGoButtonCount">
 &lt;canvas debug="true"&gt;
+&lt;debug y="150"/&gt;
 &lt;include href="lzunit"/&gt;
 &lt;simplelayout axis="y" spacing="10"/&gt;
 
@@ -446,7 +457,7 @@
 &lt;attribute name="counter" type="number" value="1" when="once"/&gt;
 
 &lt;method event="onclick"&gt;
-    if (goButton.go==true &amp;&amp; goButton.counter&lt;Number.MAX_VALUE) {
+    if (goButton.go==true &amp; &amp; goButton.counter&lt;Number.MAX_VALUE) {
         foo = new LzDelegate(this, "count", LzIdle, "onidle");
         this.setAttribute('text', 'Stop');
         this.setAttribute('go', false);
@@ -469,10 +480,10 @@
 &lt;TestSuite&gt;
     &lt;TestCase&gt;
         &lt;method name="testGoButtonTrue"&gt;
-        	assertEquals(1, goButton.counter);
+            assertEquals(1, goButton.counter);
             assertTrue(goButton.go);
         &lt;/method&gt;
-    &lt;/TestCase&gt;	
+    &lt;/TestCase&gt;   
 &lt;/TestSuite&gt;
 
 &lt;/canvas&gt;



More information about the Laszlo-checkins mailing list