DEV Community

loading...

Discussion on: Unit Testing is Overrated

Collapse
onimisionipe profile image
Mathew Onipe

Thank you for this. I recently wrote a web server in golang that handles Auth request from dovecot checkpasswd plugin. I started out writing only unit tests but I began to question myself as the complexity of tests and code grew due to unnecessary mocks and dependency injection. I ended up writing integration tests by using docker to spin up a container that contains dependencies I needed for my tests. Then automate this via bash scripts to make it runnable on most CI tools.

This paid off and the value gain was immediately obvious.
I'm normally an SRE, so I can force docker and bash to do anything. This was a big advantage for me. I suspect some Devs might have trouble navigating docker etc to create integration environment.

But yes, I 100% agree with you.

Collapse
tyrrrz profile image
Alexey Golub Author

For sure, I know too many devs who avoid anything that sounds remotely devops-y because it's "not their job".