Test Driven Development Code Order
Posted
by
Bobby Kostadinov
on Programmers
See other posts from Programmers
or by Bobby Kostadinov
Published on 2012-09-19T08:07:13Z
Indexed on
2012/09/19
9:51 UTC
Read the original article
Hit count: 243
TDD
I am developing my first project using test driven development. I am using Zend Framework and PHPUnit.
Currently my project is at 100% code coverage but I am not sure I understand in what order I am supposed to write my code.
Am I supposed to write my test FIRST with what my objects are expected to do or write my objects and then test them?
Ive been working on completing a controller/model and then writing at test for it but I am not sure this is what TDD is about?
Any advice?
For example, I wrote my Auth plugin and my Auth controller and tested that they work properly in my browser, and then I sat down to write the tests for them, which proved that there were some logical errors in the code that did work in the browser.
© Programmers or respective owner