4 ms·
Nope. Hate unit testing. Never do it. Makes me more invested in my existing code so I'm less likely to throw out previous versions.
by einarvollset 18y ago
Nope. Hate unit testing. Never do it. Makes me more invested in my existing code so I'm less likely to throw out previous versions.
- felipe 18y agoUnit testing written first actually forces you to throw away bad code more often. The test is independent from the production code.
- einarvollset 18y agoNot exactly: It forces you to throw away bad code inside a component _that conforms to the unit test_. If the unit test inherently tests something that isn't optimal for the larger problem then you're no further.
- chrisbroadfoot 18y agoSo, you throw away previous versions without knowing that your new code actually works with your existing integration points? Ba bow.
- einarvollset 18y agoThere's a difference between checking that the code works overall, and checking that each individual component works. Anyways, I realize I'm in the minority (in many ways..), but I find that if I have a crapload unit tests, then I'm more inclined to not want to change how something works (because then I'd need both new code AND new unit tests - for everything). To me, that's a bad thing As an aside, is there any studies that show that the proliferation of unit testing in the last few years has actually reduced the number of bugs and/or decreased development time _overall_?
- bhb 18y agoIt does make it harder for me to completely throw out older versions, but it makes it way easier for me to refactor my old version into a better new version (which I think is often more productive than just starting from scratch)