Hello.
Even though there are plenty introductions to TDD (even in PHP, my primary programming language now), I'm feeling a bit stuck about it.
My friend introduced me TDD a while ago, but I wasn't actually able to understand it - what's the point in writing tests to everything first - even the simplest tasks - when in the end, it looks it's more efficient to test only if something doesn't work, although it might be much harder to locate the bug (this could be solved through VCS, no?).
So is there any introduction, with dead-simple examples and arguments behind "pros"?
Something like "yeah, it's better, because you have better design - look at this example..."
Also, it would be nice if this simple examples were in php (should be possible) or in as3 (idk...).
Thanks.
EDIT: I understand that you create "test" and then the function, that should pass the test. But how you say to language, what results should it have? To me it looks that you do some function... debug it (the same way as you debug in no test driven dev.) and call it test and do it again... Or?
EDIT 2: Oh... Also, is this applicable to MVC approach? Or rather, CodeIgniter Newbie MVC? :D
EDIT 3: Read a bunch of posted and googled advices, plans, ways and tutorials. I am still not entirely into TDD - I mostly have pretty good visualisation and I think (hope?) I write pretty maintable code, so i still see it as an extra work...