2

I have recently heard a lot of people argue about using PHP testing features like PHPunit and SimpleTest together with their IDE of choice (Eclipse for me). After googling the subject, I have still a hard time understanding the pros and cons of using these testing frameworks to speed up development.

If anyone could explain this for me in a more basic level, I would really appreciate it. I am using PHP5 for the notice.

Thanks a lot!

Industrial
  • 41,400
  • 69
  • 194
  • 289
  • Possible duplicate: http://stackoverflow.com/questions/2161298/what-are-key-points-to-explain-unit-testing – Pekka May 16 '10 at 10:47
  • And another: http://stackoverflow.com/questions/67299/is-unit-testing-worth-the-effort – Pekka May 16 '10 at 10:47
  • 1
    Or am I getting you wrong. Are you asking about the merits of unit testing itself in general (that's what the links point to) or using test frameworks? – Pekka May 16 '10 at 10:48

1 Answers1

5

I'm not a big fan of unit testing: I'm not saying they're useless, they can be very useful - in certain situations.

The thing is that some people tend to overestimate what they can do with unit test.

Just remember two things: 1) Unit test CANNOT substitute beta testing. A bad interface remains a bad interface even if the code behind it works. (e.g.: if a button is unclickable it doesn't really matter whether the function to which it is attached works or not) 2) Unit test require time to be written. If you're developing a small project alone or in a small team maybe you can use that time to improve your code.

And have a look at this (please read it with a pinch of salt, it is obvious that the author is being provocative in the way he writes things): http://www.wilshipley.com/blog/2005/09/unit-testing-is-teh-suck-urr.html

nico
  • 50,859
  • 17
  • 87
  • 112