Two Important Reason for Testing are …

Back in 2020 during the start of the first wave in the UK, before the lockdown, I gave a quick talk on testing with Pytest to a few developer’s colleagues in the office.

Few slides were titled why test and elaborated on various (more like 8) reasons for why we should write tests?

Two reasons that I believe are most important are….

Testing enables better design of the software.

Testing is not about writing tests. It is about writing a testable code.

In order to test a single unit, we need to be able to instantiate that unit standalone – without the rest of the system.
This leads to a loosely coupled code with explicit dependencies.
This leads to a better separation of concerns, and also follows the single responsibility principle

Testing enables quick feedback

Testing provides quick feedback and makes development more productive leading to more confidence when making any changes and eventually makes refactoring a codebase easier.

Whats your reason for writing or not writing tests?

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s