Writing tests are overrated. Convince me

Without tests, everything is working fine. Convince me why I need to write tests.

1 Like

Writing tests is the only thing keeping me sane now. For the past two weeks my team hasn’t had a single crash logged on Crashlytics and that’s pretty rare for a mobile app. Neither have we had bugs concerning intended behavior of features because there is loads of tests to cover every (might be an exaggeration, but meh) single user story.

Without tests, everything is working fine. Convince me why I need to write tests.

Sounds good except, when / if you have a bug, it might be a bit difficult to find exactly where the issue is and probably take more time than necessary. Time you could have been using to drink a cold glass of Club beer while playing FIFA 20.

2 Likes

I discovered writing tests makes my development process easier. If you think about it, no matter the code you write, you will have to test it either by running it in a browser of in postman. For me I write a lot of APIs, so rather than just write and test in postman, I just write a little script to run the program for me. When I save the file, the script runs and I am immediately able to get feedback without having to switch context to postman. At the end of the day, all the scripts become my tests.

1 Like

I agree with this to some degree, especially when writing code for marketing websites. I have never written a test for a marketing website, I have only done this when working on actual product websites (or web apps as some may call them).

It’s definitely an overkill for a marketing website.

1 Like

No it’s not, others have given solid reasons why you should but I feel I might add more.

  • Automated testing saves you time much more than manual testing (that’s is, if you test your code at all), as @bubu pointed out, the extra time you spend in writing the tests will quickly be amortized the moment you have to test more than once.
  • Writing tests help you structure your code well especially if you do TDD because you use your code as you write it and that feedback is incredibly useful.
  • When requirements change, you can make changes to the codebase with some amount of confidence.
  • Developers who are new to the codebase can also be confident they’re not breaking things as they make changes.

That said, by all means feel free to not write tests if that’s what works for you so far as you test your code.

2 Likes

If you do write tests and things still go wrong in production, all these reasons for writing test are invalid. Unless of course your tests ensure/guarantees that everything works in production which i don’t think anybody can guarantee that they can most possibly cover all edge cases. Writing tests sound like a way to make you earn your money. There is not much more sanity in running your application in the browser or whichever medium and clicking through all your user actions/stories and seeing them work pretty well…

That being said write tests if you have the time and resources and if you feel like it or it’s a requirement. If everything works fine it works fine.

Convince me too.

Writing tests is not about ensuring stuff works in production. Far from that. The main reason I write test is to ensure new feature i add in the future dont break the entire app. This is to help solve regression issues. The second main reason is to give confidence to change something without worrying about if it works. A while ago i switched the backend db from mongodb to postgres and if not for the test i had witten earlier, i would not have had the confidence to depoly and trust that the changes worked.

2 Likes