Should senior developers be exempt from unit testing - or should they be allowed to use lackeys to implement them? What's the best way to motivate people who are not used to using unit testing techniques to adopt them?
Unit testing ensures that all code meets quality standards before it's deployed. This ensures a reliable engineering environment where quality is paramount. Over the course of the product development life cycle, unit testing saves time and money, and helps developers write better code, more efficiently.
The most serious problem with unit tests is their focus on fixing bugs rather than of system-level improvement. There are two potential goals in testing. One is to use it as a learning tool: to learn more about the program and how it works.
The combination of code refactoring and unit testing led to test-driven development, where unit test creation is essential to the development process. In TDD, code must be testable before it is even created.
I would argue that from a TDD purist standpoint (i.e. one that thinks that unit tests should be written before implementation), senior developers should be writing more unit tests than lackeys, not less.
The reason being that since unit tests come first, writing them requires intimate knowledge of the code base. If you let the lackeys write them, you're essentially letting those who know the least about your domain dictate the structure of your code base. That sounds like a bad idea to me.
I think having lackeys do unit tests for someone else is destroying the point of having unit tests to begin with. The programmer who writes code should know how the code should break and what its expected behavior is. Just because someone else does does not release the original programmer from that responsibility.
(Awkward phrasing due to gender neutrality.)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With