Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Senior Developers and Unit Tests - Required? Are they allowed to use lackeys? [closed]

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?

like image 566
Joe Schneider Avatar asked Aug 22 '08 22:08

Joe Schneider


People also ask

Why unit testing is mandatory?

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.

Why unit testing is a waste of time?

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.

Is unit testing a must?

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.


2 Answers

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.

like image 177
Kevin Pang Avatar answered Oct 09 '22 03:10

Kevin Pang


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.)

like image 20
Mat Noguchi Avatar answered Oct 09 '22 02:10

Mat Noguchi