I have long felt the urge to address dogmatism in software engineering. As opinions have seemed to get more radical in developer communities, I had to add my 2 cents to a few of them. I pointed to some of the biggest beefs in the developer community - like unpopular design patterns, typescript or releasing on Fridays and tried to add some nuance to the discussions. I could finally sleep safe and sound again.
Until someone suggested writing an additional piece on testing. “What about addressing the ‘abolish unit tests’ clash?”
🤯
The TDD fan in me got triggered. I can understand people's reluctance to use TDD always and foremost, but abolishing tests is one step (way!) too far.
There it was - my very own dogma. I’m far from being alone, software testing is littered with very strong opinions.
The unit testing squabble is one of the most controversial conversations in the community. Sometimes leading to hilarious exchanges like this one:
To be fair, there are some legit arguments against unit testing:
In my opinion however, most of the criticism boils down to the wrong application of unit tests. Unit tests are often misunderstood and misapplied. For example, they don’t necessarily need to focus on a single file, object, or function, but rather on a unit of behavior, which can be more broadly defined.
I just think the arguments for unit testing are too solid to be ignored:
The testing debate continues around the importance of tests in general. A small, vocal group of ‘move fast, break things’ devs advocate for releasing without testing, testing in production or even leaving the quality check to the users. I guess you can, if the stakes are low enough and your users are forgiving.
For me, this was the hardest part of questioning my own dogma. Ask any of my current or former colleagues, there’s one thing that I have been pretty dogmatic about in my career - testing your code. I’ve been likened to a “testing drill sergeant”.
I don’t think I’m quite as strongly opinionated about this anymore as I used to be. I don’t really care what level of the testing pyramid you choose to cover your code. I also am fine with tests growing along with the code: a prototype probably doesn’t need full coverage, while the full scalable production ready app does and I do think writing good tests is just as hard as writing good code (maybe even harder), so I understand the struggle.
If I’m allowed one ultimate developer opinion, please, test your code. It doesn’t have to suck. We try to help by making testing easier, so feel free to see if that can assist you achieving the code quality you want.
---
Thanks for going through reading my 2 cents about dogmatism in software engineering Let me wrap up my dogma busting with one last thought from the Pragmatic Engineer:
So take it all with a grain of salt!
If you think I’m missing something or just want to chat about dogmatism, tests, AI or general startup engineering, you can find me here: