I don't like writing tests, it's boring. I like it even less when I'm grudgingly writing tests anyway and stumble upon a bug in the process. It means boring work is still necessary. 😞

@ayo I hate writing tests too...

are you writing unit tests, or end-to-end/integration tests?

@Wolf480pl unit. Integration tests are even more painful write. More fragile, too.

@ayo personally I hate unit tests (especially with mocks) because I end up testing whether the function I wrote does the thing I wrote, instead of testing if it does the right thing. So these tests end up not checking anything.

OTOH, I like automating the testing I do by hand (not sure if it qualifies as integration or end-to-end or what) that tends to go through all the layers of a program, even if only in a very specific way.

@ayo IMO the most important reason to have tests is so that I'm not afraid to do refactoring. Without tests, I'd be worried that I broke something. With a test (any test will do), I run the test, see that it still passes, and become convinced that the code still works.

@Wolf480pl I only write unit tests for functions where it makes sense to do so. Things like string parsing or complex logic where it's easy to get some special case wrong. Writing tests for every function is a pointless exercise.

Sign in to participate in the conversation

Welcome to your niu world ! We are a cute and loving international community O(≧▽≦)O !