문제

개발자 중 하나는 지속적으로 코드를 작성하고 테스트하지 않고 버전 제어에 넣는 것입니다. 우리 코드의 품질은 결과적으로 고통 받고 있습니다.

개발자를 제거하는 것 외에도이 문제를 어떻게 해결할 수 있습니까?

편집하다

나는 그에 대해 그와 얘기에 대해 이야기했고 심지어 그에게 서면 경고를 주었다.

도움이 되었습니까?

해결책

체계적으로 수행하는 경우 코드 리뷰 개발자가 코드를 커밋 할 수 있도록 허용하기 전에 문제가 대부분 해결됩니다. 그러나 이것은 당신의 경우가 아닌 것 같습니다. 그래서 이것이 내가 추천하는 것입니다.

  • 개발자와 대화하십시오. 팀의 다른 사람들에 대한 결과에 대해 토론하십시오. 대부분의 개발자는 동료에 의해 인식되기를 원하므로 충분할 수 있습니다. 또한 몇 주 오래된 코드보다 마음에 새로운 코드의 버그를 수정하는 것이 훨씬 쉽다고 지적합니다. 이 부분은 당신이 어떤 형태의 형태를 가지고 있다면 의미가 있습니다. 코드 소유주 제자리에.
  • 시간이 지나지 않아 작동하지 않으면 저자에게 버기 코드를 불쾌하게 만드는 정책을 마련하십시오. 한 가지 인기있는 방법은 다음을 만들기위한 집안일에 대한 책임을 맡은 사람을 돌보는 것입니다. 빌드 프로세스가 완전히 자동화 된 경우 대신 처리 할 다른 정신적 작업을 찾으십시오. 이 접근법은 특히 누군가를 정확히 찾아 내지 않고 모든 사람에게 더 수용 할 수 있다는 이점이 있습니다.
  • 징계 조치를 사용하십시오. 팀과 회사의 규모에 따라 여러 형태를 취할 수 있습니다.
  • 개발자를 발사하십시오. 나쁜 사과를 유지하는 것과 관련된 비용이 있습니다. 당신이 이것을 멀리 할 때, 개발자는 그의 동료 개발자를 신경 쓰지 않으며, 당신은 이미 당신의 손에 사람들의 문제를 가지고 있습니다. 작업 환경에 중독되면이 단일 나쁜 개발자보다 훨씬 더 생산성과 사람이있는 사람이 손실 될 수 있습니다.

다른 팁

코드 리뷰를 할 수 있다면, 그것을 잡을 수있는 완벽한 장소입니다.

반복 트렁크를 병합하기 전에 리뷰가 필요하므로 일반적으로 모든 것이 잡혔습니다.

의식 구타! 각 버그에 대해 채찍의 한 속눈썹!

(그것을 얻지 못하는 사람을위한 농담)

자신의 코드를 거의 테스트하지 않는 개발자로서, 나는 천천히 내 행동을 바꾸는 한 가지를 말할 수 있습니다 ...

시계

환경이 코드를 푸시 할 수있게되면 사용자가 문제를 찾을 때까지 기다렸다가 본질적으로 "지금은 어떻습니까?"라고 묻습니다. 코드를 변경 한 후에는 자신의 내용을 테스트 할 진정한 인센티브가 없습니다.

코드 리뷰 및 협업은 동료가 '위젯 y'및 '위젯 Z'에서 일하는 동안 '위젯 X'를 제공하는 것보다 품질 제품을 훨씬 더 많은 제품을 만들도록 권장합니다.

당신의 작업이 눈에 띄게 많을수록 그것이 얼마나 잘 작동하는지에 대해 더 많이 돌볼 가능성이 높습니다.

Code review. Stick all of your dev's in a room every Monday morning and ask them to bring their most proud code-based accomplishment from the previous week along with them to the meeting.

Let them take the spotlight and get excited about explaining what they did. Have them bring copies of the code so other dev's can see what they're talking about.

We started this process a few months ago, and it's astonishing to see the amount of sub-conscious quality checks that take place. After all, if the dev's are simply asked to talk about what they're most excited about, they'll be totally stoked to show people their code. Then, other dev's will see the quality errors and publicly discuss why they're wrong and how the code should really be written instead.

If this doesn't get your dev to write quality code, he's probably not a good fit for your team.

Make it part of his Annual Review objectives. If he doesn't achieve it, no pay rise.

Sometimes though you do just have to accept that someone is just not right for your team/environment, it should be a last resort and can be tough to handle but if you have exhausted all other options it may be the best thing in the long run.

Tell the developer you would like to see a change in their practices within 2 weeks or you will begin your company's disciplinary procedure. Offer as much help and assistance as you can, but if you can't change this person, he's not right for your company.

Using Cruise Control or a similar tool, you can make checkins automatically trigger a build and unit tests. You would still need to ensure that there are unit tests for any new functionality he adds, which you can do by looking at his checkins. However, this is a human problem, so a technical solution can only go so far.

Why not just talk to him? He probably won't actually bite you.

  • Make him "babysit" the build, and become the build manager. This will give him less time to develop code (thus increasing everyone's performance) and teach him why a good build is so necessary.

  • Enforce test cases - code cannot be submitted without unit test cases. Modify the build system so that if the test cases don't compile and run correctly, or don't exist, then the entire task checkin is denied.

-Adam

Publish stats on test code coverage per developer, this would be after talking to him.

Here are some ideas from a sea shanty.

Intro
   What shall we do with a drunken sailor, (3×)
   Early in the morning?
Chorus
   Wey–hey and up she rises, (3×)
   Early in the morning!
Verses
   Stick him in a bag and beat him senseless, (3×)
   Early in the morning!
   Put him in the longboat till he’s sober, (3×)
   Early in the morning!

etc. Replace "drunken sailor" with a "sloppy developer".

Depending on the type of version control system you are using you could set up check-in policies that force the code to pass certain requirements before being allowed to check-in. If you are using a sytem like Team Foundation Server it gives you the ability to specify code-coverage and unit testing requirements for check-ins.

You know, this is a perfect opportunity to avoid singling him out (though I agree you need to talk with him) and implement a Test-first process in-house. If the rules aren't clear and the expectations are known to all, I've found that what you describe isn't all that uncommon. I find that doing the test-first development scheme works well for me and improves the code quality.

They may be overly focused on speed rather than quality.

This can tempt some people into rushing through issues to clear their list and see what comes back in bug reports later.

To rectify this balance:

  1. assign only a couple of items at a time in your issue tracking system,
  2. code review and test anything they have "completed" as soon as possible so it will be back with them immediately if there are any problems
  3. talk to them about your expectations about how long an item will take to do properly

Peer programming is another possibility. If he is with another skilled developer on the team who dies meet quality standards and knows procedure then this has a few benifits:

  1. With an experienced developer over his shoulder he will learn what is expected of him and see the difference between his code and code that meets expectations
  2. The other developer can enforce a test first policy: not allowing code to be written until tests have been written for it
  3. Similarly, the other developer can verify that the code is up to standard before it is checked-in reduicing the nmber of bad check-ins

All of this of course requires the company and developers to be receptive to this process which they may not be.

It seems that people have come up with a lot of imaginative and devious answers to this problem. But the fact is that this isn't a game. Devising elaborate peer pressure systems to "name and shame" him is not going to get to the root of the problem, ie. why is he not writing tests?

I think you should be direct. I know you say that you've talked to him, but have you tried to find out why he isn't writing tests? Clearly at this point he knows that he should be, so surely there must be some reason why he isn't doing what he's been told to do. Is it laziness? Procrastination? Programmers are famous for their egos and strong opinions - perhaps he's convinced for some reason that testing is a waste of time, or that his code is always perfect and doesn't need testing. If he's an immature programmer, he might not fully understand the implications of his actions. If he's "too mature" he might be too set in his ways. Whatever the reason, address it.

If it does come down to a matter of opinion, you need to make him understand that he needs to set his own personal opinion aside and just follow the rules. Make it clear that if he can't be trusted to follow the rules then he will be replaced. If he still doesn't, do just that.

One last thing - document all of your discussions along with any problems that occur as a result of his changes. If it comes to the worst you may be forced to justify your decisions, in which case, having documentary evidence will surely be invaluable.

Stick him on his own development branch, and only bring his stuff into the trunk when you know it's thoroughly tested. This might be a place where a distributed source control management tool like GIT or Mercurial would excel. Although with the increased branching/merging support in SVN, you might not have too much trouble managing it.

EDIT

This is only if you can't get rid of him or get him to change his ways. If you simply can't get this behaviour to stop (by changing or firing), then the best you can do is buffer the rest of the team from the bad effects of his coding.

If you are at a place where you can affect the policies, make some changes. Do code reviews before check ins and make testing part of the development cycle.

It seems pretty simple. Make it a requirement and if he can't do it, replace him. Why would you keep him?

I usually don't advocate this unless all else fails...

Sometimes, a publicly-displayed chart of bug-count-by-developer can apply enough peer pressure to get favorable results.

Try the Carrot, make it a fun game.
E.g The Continuous Integration Game plugin for Hudson
http://wiki.hudson-ci.org/display/HUDSON/The+Continuous+Integration+Game+plugin

Put your developers on branches of your code, based on some logic like, per feature, per bug fix, per dev team, whatever. Then bad check-ins are isolated to those branches. When it comes time to do a build, merge to a testing branch, find problems, resolve, and then merge your release back to a main branch.

Or remove commit rights for that developer and have them send their code to a younger developer for review and testing before it can be committed. That might motivate a change in procedure.

You could put together a report with errors found in the code with the name of the programmer that was responsible for that piece of software.

If he's a reasonable person, discuss the report with him.

If he cares for his "reputation" publish the report regularly and make it available to all his peers.

If he only listens to the "authority", do the report and escalate the issue to his manager.

Anyway, I've seen often that when people are made aware of how bad they seem from outside, they change their behaviour.

Hey this reminds me of something I read on xkcd :)

Are you referring to writing automated unit test or manually unit testing prior to check-in?

If your shop does not write automated tests then his checking in of code that does not work is reckless. Is it impacting the team? Do you have a formalized QA department?

If you are all creating automated unit tests then I would suggest that part of your code review process include the unit tests as well. It will become obvious that the code is not acceptable per your standards during your review.

Your question is rather broad but I hope I provided some direction.

I would agree with Phil that the first step is to individually talk to him and explain the importance of quality. Poor quality can often be linked to the culture of the team, department and company.

Make executed test cases one of the deliverables before something is considered "done."

If you don't have executed test cases, then the work is not complete, and if the deadline passes before you have the documented test case execution, then he has not delivered on time, and the consequences would be the same as if he had not completed the development.

If your company's culture would not allow for this, and it values speed over accuracy, then that's probably the root of the problem, and the developer is simply responding to the incentives that are in place -- he is being rewarded for doing a lot of things half-assed rather than fewer things correctly.

Make the person clean latrines. Worked in the Army. And if you work in a group with individuals who eat a lot of Indian food, it wont take long for them to fall in line.

But that's just me...

Every time a developer checks something in that does not compile, put some money in a jar. You'll think twice before checking in then.

Unfortunately if you have already spoken to him many times and given him written warnings I would say it is about time to eliminate him from the team.

You might find some helpful answers here: How to make junior programmers write tests?

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top