Results 1 to 4 of 4
Apr 28, 2013, 14:41 #1
- Join Date
- Dec 2003
- 7 Post(s)
- 0 Thread(s)
Starting with unit testing and looking for pointers
I'd like to hear some advice on how to best start with learning test driven development and unit testing. I have no practical experience with this, only some theory here and there. Now I'm starting a new php project which has a potential for being developed and expanded long-term so I think this is a good opportunity to start using TDD in practice.
What steps would you suggest to take to start learning TDD? Any ideas, tutorials, books? I have found The Grumpy Programmer's PHPUnit Cookbook which sounds promising, do you think it's worth getting it?
To be honest, I don't want to spend a huge amount of time learning now before I get to work, because I have work to get done, so I want to take it step by step spending a small amount of time each day as I realise mastering TDD can take quite a long time. That's why I'm looking for any helpers so that I don't have to make all the mistakes I could avoid by reading someone's good advice.
Currently, I'm developing with the use of a framework of my own that I have got used to over time and I'm very comfortable with so I'd like to carry on using it - it has its simple ORM with auto-generated classes from database schemata and it generates all initial controllers, actions and forms for editing data in the admin area. I realise some parts of the code are not well suited for unit testing but I can always make changes to the code if really necessary. I hope I can focus now on making most of my new code testable, I'm not striving now on making all of my framework testable since I'd probably have to spend at least a month or more on learning and modifications while the project would show no real progress.