Re: Using refactoring to make code more testable Re: [refactoring] Using refactoring to make code more testable
Adam Sroka <[email protected]>
| Newsgroups | gmane.comp.programming.refactoring |
|---|---|
| Message-ID | <[email protected]> |
On Mon, Oct 12, 2009 at 3:52 PM, Michael Charland <[email protected]> wrote: > > > > Along similar lines, how do i get people to add tests? Most of the people I work with do not add any unit tests when submitting new code or fixing old bugs. It's a pretty generic question, but any approaches would help. > Not so easy. You need to agree as a team to do it, and then hold yourself to that commitment. Without commitment you will never get there. Once you have the commitment you can use metrics that measure coverage to analyze your progress (CRAP is better than coverage, but the only implementation I know of is for Java: http://www.crap4j.org/ ). Getting the commitment is the hard part. What seems to work more often than other methods is to get them to accept a time-boxed trial. e.g. we won't check in any code that isn't tested for the next three iterations. After that we will have a retrospective and talk about what we have learned. This is a lot easier than getting them to admit that it is a good idea. In the end, having the experience of seeing it work is the best evidence you can provide. Some people are also swayed by studies. e.g. http://research.microsoft.com/en-us/projects/esm/nagappan_tdd.pdf ------------------------------------ Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/refactoring/ <*> Your email settings: Individual Email | Traditional <*> To change settings online go to: http://groups.yahoo.com/group/refactoring/join (Yahoo! ID required) <*> To change settings via email: mailto:[email protected] mailto:[email protected] <*> To unsubscribe from this group, send an email to: [email protected] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/