I try to. I didn't, int the past, and suffered from it when I made changes and broke things. The benefit of testing in side projects is not proving their correctness - it's protecting yourself from accidentally breaking your code.
As for the type of tests - I prefer integration tests. I think unit tests are overused - they are good for library code, but when you start to need to mock everything their RoI drops and it's time to move to integration tests.
Thank you, Idan! I think this is something that kept me back from writing tests in the past. Unit tests seemed to me always to be an overkill for the few functions I had. My apps are often connected to databases and Web APIs, so I think integration tests will be also my preferred type in the future 👍
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I try to. I didn't, int the past, and suffered from it when I made changes and broke things. The benefit of testing in side projects is not proving their correctness - it's protecting yourself from accidentally breaking your code.
As for the type of tests - I prefer integration tests. I think unit tests are overused - they are good for library code, but when you start to need to mock everything their RoI drops and it's time to move to integration tests.
Thank you, Idan! I think this is something that kept me back from writing tests in the past. Unit tests seemed to me always to be an overkill for the few functions I had. My apps are often connected to databases and Web APIs, so I think integration tests will be also my preferred type in the future 👍