如何让初级程序员写测试? [英] How to make junior programmers write tests?

查看:29
本文介绍了如何让初级程序员写测试?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个初级程序员,他根本没有编写足够的测试.
我必须每两个小时唠叨一次,你写过测试吗?"
我们已经尝试过:

We have a junior programmer that simply doesn't write enough tests.
I have to nag him every two hours, "have you written tests?"
We've tried:

  • 表明设计变得更简单
  • 展示它可以防止缺陷
  • 让它成为自负的东西,只说糟糕的程序员不会
  • 这个周末 2 名团队成员不得不上班,因为他的代码有一个 NULL 引用,而他没有测试

我的工作需要高质量的稳定代码,而且通常每个人都明白"并且不需要通过测试.我们知道我们可以让他编写测试,但我们都知道有用的测试是在您投入使用时编写的.

My work requires top quality stable code, and usually everyone 'gets it' and there's no need to push tests through. We know we can make him write tests, but we all know the useful tests are those written when you're into it.

你知道更多的动机吗?

推荐答案

这是最难的事情之一.让您的员工得到它.

有时,帮助初级程序员掌握"并从高级程序员那里学习正确技术的最佳方法之一是进行一些结对编程.

Sometimes one of the best ways to help junior level programmers 'get it' and learn the right techniques from the seniors is to do a bit of pair programming.

试试这个:在一个即将到来的项目中,将初级人员与你自己或其他高级程序员配对.他们应该一起工作,轮流驾驶"(在他们的键盘上打字)和指导"(看着司机的肩膀并在他们前进时指出建议、错误等).这似乎是一种资源浪费,但您会发现:

Try this: on an upcoming project, pair the junior guy up with yourself or another senior programmer. They should work together, taking turns "driving" (being the one typing at they keyboard) and "coaching" (looking over the shoulder of the driver and pointing out suggestions, mistakes, etc as they go). It may seem like a waste of resources, but you will find:

  1. 这些人一起可以快速生成更高质量的代码.
  2. 如果你的初级人员学习了足够多的知识来掌握它",并且有一位高级人员指导他走正确的道路(例如好的,现在在我们继续之前,让我们为这个功能编写测试.")这将是非常值得的您投入的资源.

也许你的小组中也有人给出了单元测试 101Kate Rhodes 的演讲,我认为这是让人们对测试感到兴奋的好方法,如果交付得当的话.

Maybe also have someone in your group give the Unit Testing 101 presentation by Kate Rhodes, I think its a great way to get people excited about testing, if delivered well.

您可以做的另一件事是让您的 Jr. Devs 练习 Bowling Game Kata帮助他们学习测试驱动开发.它是在 java 中,但可以很容易地适应任何语言.

Another thing you can do is have your Jr. Devs practice the Bowling Game Kata which will help them learn Test Driven Development. It is in java, but could easily be adapted to any language.

这篇关于如何让初级程序员写测试?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆