Unit testing poll

Not for 'how-to' coding questions but PHP theory instead, this forum is here for those of us who wish to learn about design aspects of programming with PHP.

Moderator: General Moderators

Post Reply

When do you write tests for your code?

Before I write the code
1
7%
As I write the code
9
64%
Just after I write the code
3
21%
Before I ship the application
0
No votes
Someone else does testing
0
No votes
The customer does the testing for me
1
7%
 
Total votes: 14

lastcraft
Forum Commoner
Posts: 80
Joined: Sat Jul 12, 2003 10:31 pm
Location: London

Unit testing poll

Post by lastcraft »

Hi...

I am very much in the "Test Infected" (Eric Gamma) camp, but was curious to see how current practices on this topic have penetrated the PHP community. I am talking about writing test scripts here that can be run by anyone.

yours, Marcus
User avatar
trollll
Forum Contributor
Posts: 181
Joined: Tue Jun 10, 2003 11:56 pm
Location: Round Rock, TX
Contact:

Post by trollll »

Since I couldn't select multiple choices (I test as I write it, after I write it, before I ship it and if I have a PM they test it as well (or rather not as well, but they test it).
jason
Site Admin
Posts: 1767
Joined: Thu Apr 18, 2002 3:14 pm
Location: Montreal, CA
Contact:

Post by jason »

I would love to say honestly that I write my tests before and during the coding process, but I don't. Hey, I am being honest!

Okay, I know the benefits, it's obvious, and I should do the testing. So, in order to advance this into something more productive than just a "I feel good because I voted the popular vote", let me ask this: which tools do you guys unit test with? Which unit testing packages?
User avatar
trollll
Forum Contributor
Posts: 181
Joined: Tue Jun 10, 2003 11:56 pm
Location: Round Rock, TX
Contact:

Post by trollll »

I don't really use a tool... I just write code so that I can test it outside of the application. just like in other experiments, you need to eliminate external stimuli in order to tell what causes things to go wrong.
User avatar
devork
Forum Contributor
Posts: 213
Joined: Fri Aug 08, 2003 6:44 am
Location: p(h) developer's network

Post by devork »

I usuall make a test dir with every project ..then make,test modules in that directory and then insert in project
lastcraft
Forum Commoner
Posts: 80
Joined: Sat Jul 12, 2003 10:31 pm
Location: London

Post by lastcraft »

Hi
jason wrote:which tools do you guys unit test with? Which unit testing packages?
You don't need a tool to start unit testing as such, only a homebrew script that can be run again and again. Pretty soon you would evolve these scripts into a test tool anyway. The problem is that when you move on to tricker test cases (using mock objects say, performance tuning or testing web pages directly) you will want to use a tool. You then face changing over all of your old test cases into a different format.

yours, Marcus
Post Reply