Quote:
Originally Posted by freedom18
TDD (test driven development) blows monkey nuts, confusing as hell for a beginning programmer
heres the thing about TDD
you probably already do a lot of testing already, but don't realize it.
i'm a hobby programmer with half of a CS degree before i dropped out to play poker. so most of my coding hasn't been professional, but rather hacked together personal projects. right now i'm working on my first public software release
here's what my typical development work flow goes like:
- have an idea
- write some code to implement the idea
- execute the program to see if idea works
- program doesn't work
- find buggy code, throw in a messagebox to confirm this is the bug area
- re-execute the program to confirm bug
- attempt to fix the buggy code
- re-execute the program to confirm bugfix
- etc.
as you can see, i'm constantly executing my code to test if it works, to test if it fails unexpectedly, or to test if it fails expectedly., when i'm done with my process, i mark the idea complete or the bug fixed, and move on.
HOWEVER, since i ran all those tests manually, i can never reproduce them without a lot of time and effort. had i just written test code at the same time, i could re-run those tests at any point, to have peace of mind that my code works. if i ever rewrite a part of that code to add a feature, i could just run my tests and ensure that everything is good. but since i didnt, i have to run all my tests manually.
now, with all that said, i still DON'T write unit tests. why? because i'm lazy. because mentally i think that the time is not worth the effort, even though i've just written this post which argues against the workings of my mind. ill have to re-read this and let it sink in for myself
Last edited by greg nice; 05-11-2011 at 04:33 PM.