Crafting Software With Care
Testing Isn’t Optional

Want to hear my two cents on pushing untested code?

Don’t do it.

It physically aches me to approve a PR without tests. In my experience, I’ve seen developers with a decade of experience do it, too. Don’t lower your standards and allow bad practices to creep in.

Imagine you were asked to just write a few features initially and you thought the project was never going to come back, so you delivered a product without tests. Unfortunately, one day, the project did come back. Now, you have no documentation because it was done in a hurry (happens almost all the time) and can’t rely on your memory to remember what the requirements were, so basically you’re in soup.

Tests are the single most effective way of documenting business requirements.

Ideally, your code should be ironclad with tests, including tests that verify the business logic, integration with APIs and persistence layers, and UI/acceptance tests.

You can’t always cover 100% of the codebase with, tests but the least you can do is make sure you add unit tests to cover most of the business logic. When code changes or tests break, you’ll know what changed and be able to rewrite the tests according to new requirements.

Test-driven development is how you can be certain your code is doing what you were asked to do. It can be treated as the official documentation of the codebase. This is also how you save yourself from trouble during long-term maintenance.

If your code has no tests. Get it to a state in which you can write some tests for important logic.
[]
['Software Development', 'Coding', 'Startup', 'Technology', 'Programming']