DEV Community

Discussion on: How to convince my colleagues about the importance of automated testing

craser profile image
Chris Raser

I've personally never seen anyone convinced to be diligent about testing simply by being convinced. They may even nod and agree with you, but they're not going to actually change the way they work.

The one and only way to go is to lead by example. And it's going to take a long, long time for the team's culture to shift. In my experience, expect it to take at least 2 to 5 years.

The only way to speed it up is to get your manager, PM, and team lead to actually measure testing and test coverage as part of how they measure team performance and code health.

And along the way, you're going to lose momentum every time anyone has a negative experience that they feel is because of the testing.

"I just made a little change and all these tests broke! My code is fine! Why do we even have these stupid tests?"

"I came in early to get my code rebased and merged, and the project won't build until I update my IDE and run npm and get theses tests running, and they're not even my tests! ARRRRRGH!"

"Why are we slipping deadlines? We'd be on schedule if we didn't spend time writing tests. Isn't that QA's job?"

So. Go slow. Make absolutely sure that living with tests is a positive experience for everyone. Any time someone asks you about them, be the calm voice that says everything is going to be wonderful.

The absolute kiss of death is if your manager feels you're diverting the team's energy away from the business's goals and toward your own. You're manager gets a bonus for hitting various KPIs. If your manager feels you're hurting their chances of hitting those KPIs, they will feel you are going rogue and literally taking money out of their pocket and hurting the team's performance in the service of your own idealism. (And they're not entirely wrong.)

So, unless you have enthusiastic support from your boss, tread lightly, persuade gently, show everyone the way, and let them come follow you when they're ready.

Be patient. And good luck!