Well I could test it some more but...

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
User avatar
Ollie Saunders
DevNet Master
Posts: 3179
Joined: Tue May 24, 2005 6:01 pm
Location: UK

Well I could test it some more but...

Post by Ollie Saunders »

Mods: This isn't about testing as such more about the emotional response to programming so I think Theory and Design is more appropriate also i'm more interested in the comment from more advanced developers

Do any of you experience this:
  • You have just spent ages writing something.
  • You're pretty sure you've got it right and you've tested it once; none of those E_ messages come up and it appears to work.
  • So you are happy. xD
  • You are so happy in fact you don't want anything to spoil that happiness. Something like.....testing it some more perhaps.
Often I get something to work and test it very very briefly for the simple reason that I don't want the ego crushing experience of finding out that it doesn't work perfectly first time. A kind of emotional protection mechanism.

Now obviously this is a really stupid thing to do and yet I still do it. Frequently it gets me into trouble as well, especially now I've started writing OO code. It is much easier to write a class and test it thoroughly before proceeding, this one of the nice things about OO because you can then be certain about what works and what doesn't because everything is compartmentalized. Of course if you don't bother to test stuff it could be anything and this means that most of the time finding the error is harder than actually fixing it. Sometimes I have to think about which directory of files the problem might be in, and then which file before I can isolate the problem to a single function.

The moral of this story is Don't do an Ole! test thoroughly before writing anymore. But then again, is that sometimes counter-productive?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

I write the tests first.
User avatar
Jenk
DevNet Master
Posts: 3587
Joined: Mon Sep 19, 2005 6:24 am
Location: London

Post by Jenk »

I sometimes do that myself, especially if the requirements are complex.. knowing what to test for helps you understand what is wanted, infact it just plain demands you do. (also gives you measurable progress - ugh damned management rubbing off on me.)
User avatar
Ollie Saunders
DevNet Master
Posts: 3179
Joined: Tue May 24, 2005 6:01 pm
Location: UK

Post by Ollie Saunders »

feyd wrote:I write the tests first.
Well I could well be drifting in that direction.
measurable progress
Hmmm...I'm drifting a bit more.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Have a read through the threads and links found in the Testing board. I'd also suggest researching Test Driven Development. It may seem extreme now, but might make more sense as you grow more accustomed. I'd also suggest reading on other development methodologies such as Agile, Extreme Programming, and others.

I'd have to say I spend far more time planning what I will do than actually doing it when it comes to development.
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

I have a tendency to overkill test my apps, piece by piece as each segment is produced. I try to break them to the best of my ability so that my users, who don't know quite how to use my apps as intuitively as I'd like, don't break them out of sheer naivite.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

The final test for my applications is often either my closest friends, my parents or my grandparents. The latter is preferred as I consider them a good test of whether something is intuitive enough and accessible enough in meatspace.
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: Well I could test it some more but...

Post by Christopher »

ole wrote:Often I get something to work and test it very very briefly for the simple reason that I don't want the ego crushing experience of finding out that it doesn't work perfectly first time. A kind of emotional protection mechanism.
Test FIrst is good "emotional protection" because not only are you semi-guaranteed that it will work perfectly, but it improves your designs -- and good design is the ultimate ego boost for programmers.
(#10850)
User avatar
Ollie Saunders
DevNet Master
Posts: 3179
Joined: Tue May 24, 2005 6:01 pm
Location: UK

Post by Ollie Saunders »

Have a read through the threads and links found in the Testing board.
I have
It may seem extreme now
They did, but I could understand they principle.
but might make more sense as you grow more accustomed
That doesn't surprise me. But it is a dramatic change.
I'd also suggest reading on other development methodologies such as Agile, Extreme Programming, and others.
Any good links/books? Also could you summarize those?
User avatar
Oren
DevNet Resident
Posts: 1640
Joined: Fri Apr 07, 2006 5:13 am
Location: Israel

Post by Oren »

feyd wrote:I'd have to say I spend far more time planning what I will do than actually doing it when it comes to development.
Damn right, that's exactly what I do.
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Post by Christopher »

ole wrote:Any good links/books? Also could you summarize those?
The Kent Beck is the classic and he has a new book too.

http://www.testdriven.com/modules/mylin ... php?cid=10
(#10850)
User avatar
sweatje
Forum Contributor
Posts: 277
Joined: Wed Jun 29, 2005 10:04 pm
Location: Iowa, USA

Post by sweatje »

You might try this online book while it is up:
http://xunitpatterns.com/
Post Reply