4 ms·
As someone who uses unit tests to find bugs in my code, that I would never otherwise find, this is surprising.
by isuckatcoding 10y ago
As someone who uses unit tests to find bugs in my code, that I would never otherwise find, this is surprising.
- WalterSear 10y agoThat not TDD, though. It's more similar to test-after.
- deleted 10y ago[deleted]
- mattschmulen 10y agoI think test after is a reasonable approach. I am constantly dealing with new code bases and in the interview process I am often asked about my philosophy about testing. My response is thatbtrsting occurs on two fronts from the top down ( functional UI tests) and from the bottom up (unit tests). When it comes to unit testing my approach is to focus on the hotspots. If something gives you trouble, or if you find a bug/ issue then wrap it in a unit test. That way you don't have to worry about it. Bugs tell you where the weak spots in your code base are. When they speak to you, listen and take some action. Otherwise, I feel like chasing blanket coverage is not worth the effort in most products.
- mattschmulen 10y agoI think test after is a reasonable approach. I am constantly dealing with new code bases and in the interview process I am often asked about my philosophy about testing. My response is thatbtrsting occurs on two fronts from the top down ( functional UI tests) and from the bottom up (unit tests). When it comes to unit testing my approach is to focus on the hotspots. If something gives you trouble, or if you find a bug/ issue then wrap it in a unit test. That way you don't have to worry about it. Bugs tell you where the weak spots in your code base are. When they speak to you, listen and take some action. Otherwise, I feel like chasing blanket coverage is not worth the effort in most procure.
- erik 10y agoIt's not about TDD vs no tests. The article is about tests first or tests later.
- danjoc 10y agoAnd yet, that is not what the clickbait title implies.
- zzalpha 10y agoOnly if you think unit testing necessarily requires TDD (which is defined as writing tests before writing the code that passes those tests). It doesn't. All the article says is TDD has little or not impact... it does not say unit testing as a practice has no impact. Seems to be a common misunderstanding around here that you, too, have fallen victim to...
- danjoc 10y ago>Seems to be a common misunderstanding around here that you, too, have fallen victim to... I work with people who openly believe that unit testing is a waste of time. Personally, I think they are afraid, because they don't even know how, and don't care to learn. They would see that title, and that's all the confirmation bias they would need. Thanks for assuming the worst about me though.
- zzalpha 10y agoErr, my apologies if that came across as a slight, I literally meant you and a lot of other folks made the exact same mistake. No judgement intended, it's clearly a common misapprehension. My guess is that a lot of folks got introduced to unit testing through test-driven development and, as a result, conflate the two, assuming the former necessarily implies the latter. Speaking for myself, I was writing UTs long before the TDD fad landed and so I never picked up the habit. It's just not the way my developer mind works, and I've not found it compelling enough to try and re-train myself. That said, not believing in the value of automated regression test (of which UTs are the lowest hanging fruit) is utter madness...
- deleted 10y ago[deleted]