PHP Classes

What ever happened to Unit Testing?

Recommend this page to a friend!

      Simple Paginator  >  All threads  >  What ever happened to Unit Testing?  >  (Un) Subscribe thread alerts  
Subject:What ever happened to Unit Testing?
Summary:With all due respect to the author; ever hear of Unit Testing?
Messages:1
Author:William Dodson
Date:2006-11-06 18:04:10
 

  1. What ever happened to Unit Testing?   Reply   Report abuse  
Picture of William Dodson William Dodson - 2006-11-06 18:04:10
With all due respect to the author; ever hear of Unit Testing? There seems to be a growing trend amongst the contributors for this site to release code that does not work. If you are going to provide examples of how a class works (also known as a Test Harness) you should make sure that your class actually works.

The class in-question, Simple Paginator, out-of-the-box returns a "divide by zero" warning error, which I assume in turn causes fatal error trying to access an empty class property.

I don't want to gripe too much, since I have never felt confident in releasing any of my classes here, but this seems to be modus operandi; draw up some diagrams, code a class, and then release it to PHPClasses without ever testing it. Just about every class that I have ever downloaded from here ended up requiring me to download a "patch" file of some sort. I guess you do get what you pay for, right?

Sorry for the rant, but you should Unit Test all your code. No one should code in a box. PHPUnit (http://phpunit.sourceforge.net/) is far too simple to setup and use for this to be an issue any longer. My suggestion to the developer of this class (and to all of the developers on this site) is to PLEASE TEST YOUR CODE!