Earlier quoted context omitted.
"I use it on occasion as a good sanity check to make sure I didn't break anything too obvious" That sounds more like unit tests than TDD. With TDD you should already know that you didn't break anything.. If you suck at writing code, then TDD should help you determine whether your sucky code produces the correct output for a given input; it is not however going to determine if you did that in the best possible way.
> If you suck at writing code, then TDD should help you determine whether your sucky code produces the correct output for a given input Well, if you suck at writing code, what guarantees do you have that the tests (which are also code you write) are even correct?
TDD did not live up to expectations
41–50 of 450 posts
Re: TDD did not live up to expectations
#42In the earlier days of the ruby community, I feel TDD was seen as gospel. And if you dared say that TDD wasn't the way (which I always felt), you'd feel like you were ostracized (update: just rewording to say, you'd worry that it would hurt you in a job search, not that people were mean to you). So I never spoke up. I feel like I was in the TDD-bad closet. I absolutely think _tests_ are useful, but have never found a…
Re: TDD did not live up to expectations
#43Earlier quoted context omitted.
Except in order to have a checklist you have to have your design and implementation up front which is out of reach for most developers. If were testing high level results in multiple cases thats cool. But a lot of the time youre going to try different approaches that may modify or involve changing your output.
TDD is waterfall
Re: TDD did not live up to expectations
#44I've also never found TDD to really be very beneficial except for all but the most trivial utility libraries. Most of the time, I have an idea of where I want to go, but not necessarily exactly what my interface will look like. Writing tests beforehand seems to never work our since nearly always, then will be some requirement or change that I decide to make that'd necessitate re-writing the test anyway, so why write…
Put "test stubs" out there that define what I'm testing in "human" terms, leave the stub either skipped or failing.
I've also found that if I wait a day or 2 after writing the implementation to write the tests, they catch much more.
If you write the code to match the tests, or you write the tests right after the code the chance that both the test and the code are wrong is much higher in my experience than if you wait a bit and come back to write the tests with fresh eyes.
Re: TDD did not live up to expectations
#45Defining the interface before you write the code is the major advantage of test-driven development and what it added to that way of thinking was very valuable especially to novices. It also makes your code more modular and reusable. Writing code as if other people were going to use it is something we don't talk about enough.
Either that or you end up with a load of stuff in your interface that you thought you'd need, but when you actually got to it you either didn't, or it wasn't important to implement at the outset.
Re: TDD did not live up to expectations
#46It always startles me when people assume that one programming technique either works for every type of programming or doesn't work for every type. Working on Perl 6 compilers, an extensive set of tests was our best friend. It was (probably still is, I haven't had time to help the last few years) utterly routine to write tests first and then write the code to make them work. It was a perfect way of working on it. On t…
I feel like it's much more akin to human language. Though the language primatives might be the same, it's used differently in different contexts are appropriate.
In formal, legal speech, you might want to be explicit.
In informal, everyday speech, not so much.
Similar analogs exist in programming. 10 time script to reformat data for one time use, careful documentation, tests etc. not really required.
Aircraft flight control system, very different...
But then why is it that so many programmers seem to focus on "the one true way" (TDD, agile etc). Beats me.
Re: TDD did not live up to expectations
#47This will happen again and again.
[1] http://faculty.salisbury.edu/~xswang/Research/Papers/SERelat...
Re: TDD did not live up to expectations
#48Re: TDD did not live up to expectations
#49In the earlier days of the ruby community, I feel TDD was seen as gospel. And if you dared say that TDD wasn't the way (which I always felt), you'd feel like you were ostracized (update: just rewording to say, you'd worry that it would hurt you in a job search, not that people were mean to you). So I never spoke up. I feel like I was in the TDD-bad closet. I absolutely think _tests_ are useful, but have never found a…
For instance, if you were working on a big app and there was a bug, writing a failing test for that bug and then looking into the fix is very helpful. But if you're starting a new project from scratch with loose requirements, or worse yet, building a prototype, starting with tests would be a waste of time at best.
Re: TDD did not live up to expectations
#50I get that it's a technical blog, but "TDD" isn't exactly a household name. You can't utter it in the same breath as SSL or RSA and expect people to know what it means without context.
As a test (no pun intended), try reading the article with the premise that you have NO idea what "TDD" stands for. Can you reasonably infer it from the rest of the article?