|
|
Personally, I prefer PbC, as it minimizes side-effects.
With TDD, the whole point of programming is to get it to pass the tests.
When I first read about it, they even gave this example (pseudocode):
Test:
add(3,5)=8
add(a,b)
return 8
It passes the test, so TDD assumes that the function is correct. This,
to me, is wrong. Obviously, you wouldn't use one single test to verify
the function of your code, you would use multiples, but the point
remains that with TDD your whole purpose is to "game the system." As
long is it passes the test, then it's correct.
PbC is much more flexible in that you're free to look at something and
say, "That's not right."
--
...Chambers
www.pacificwebguy.com
Post a reply to this message
|
|