Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you persuade others to write unit tests? [closed]

Tags:

unit-testing

I've been test-infected for a long time now, but it would seem the majority of developers I work with either have never tried it or dismiss it for one reason or another, with arguments typically being that it adds overhead to development or they don't need to bother.

What bothers me most about this is that when I come along to make changes to their code, I have a hard time getting it under test as I have to apply refactorings to make it testable and sometimes end up having to do a lot of work just so that I can test the code I'm about to write.

What I want to know is, what arguments would you use to persuade other developers to start writing unit tests? Most developers I've introduced to it take to it quite well, see the benefits and continue to use it. This always seems to be the good developers though, who are already interested in improving the quality of their code and hence can see how unit testing does this.

How do persuade the rest of the motley crew? I'm not looking for a list of testing benefits as I already know what these are, but what techniques you have used or would use to get other people on board. Tips on how to persuade management to take an active role are appreciated as well

like image 907
tddmonkey Avatar asked Jan 06 '09 11:01

tddmonkey


1 Answers

People (and processes) don't change without one or more pain points. So you need to finjd the significant pain points and demonstrate how unit testing might help deal with them.

If you can't find any significant pain points, then unit testing may not add a lot of value to your current process.

As Steve Lott implies, delivering better results than the other team members will also help. But without the pain points, my experience is that people won't change.

like image 150
HTTP 410 Avatar answered Oct 18 '22 11:10

HTTP 410