Unit-testing – Colleague unwilling to use unit tests “as it’s more to code”

refactoringunit testing

A colleague is unwilling to use unit tests and instead opting for a quick test, pass it to the users, and if all is well it is published live. Needless to say some bugs do get through.

I mentioned we should think about using unit tests – but she was all against it once it was realised more code would have to be written. This leaves me in the position of modifying something and not being sure the output is the same, especially as her code is spaghetti and I try to refactor it when I get a chance.

So whats the best way forward for me?

Best Answer

She is not aware of the benefits of unit testing and that's what you need to change:

  • Her awareness.

You will have to prove her it will improve her work not just yours. That will be difficult, she will probably try to focus on every negative aspect she could find if she is afraid of change.

You can try to discuss with her about all the benefits and listen to all her counter arguments. Wait until she finish to talk before starting to talk yourself.

To prepare yourself, you should look on P.SE or Google for all things management or developers are worried about unit testing and compile the answers you will use during your discussions with your colleague.

Just listening to her and provide proof it will improve her work will help you a lot. You prove you are concerned by her opinion, and you provide her with all data she needs to analyze the situation and eventually change her mind.

Related Topic