<?xml version="1.0" encoding="windows-1252"?>
<node id="328949" title="Yet another meditation on testing" created="2004-02-14 04:04:19" updated="2005-08-11 12:03:03">
<type id="120">
perlmeditation</type>
<author id="154315">
BUU</author>
<data>
<field name="doctext">
I've read lots of tutorials and various praises for the "Testing Paradign" and the thought of having hundreds of test I could just instantly run to tell me if my change affected anything fills me with glee, but I Just Don't Get It. 
&lt;br&gt;&lt;br&gt;
I understand the basic concept of testing, I think, and I can easily apply it to the examples they use in a text book: &lt;code&gt;ok(add(2,2),4);&lt;/code&gt; or whatever simple ass method you're testing. My problems comes when I try to extend/abstract the idea. &lt;br&gt;&lt;br&gt;
For example, something I've been working on now is a web application for manipulating a specific type of server. I have no bloody idea how to write tests for it. Sure I could test some of the classes that it uses and so forth, but how do I test the application it self? Print out the html and grep it for some specific phrase? What if I change the html, it's just the display layer isn't it? Do I use a dumper to dump the actual variables I'm passing to the template? Isn't that looking at the implementation?&lt;br&gt;&lt;br&gt; I'm just confused, I guess what I'm really looking for is "real world" examples of tests for complex things, things you &lt;b&gt;can't&lt;/b&gt; just test by calling a function and comparing it's output to a constant. 

&lt;br&gt;&lt;br&gt;
&lt;b&gt;Updated:&lt;/b&gt; Changed the "can" to a "can't" in that last line.</field>
</data>
</node>
