|
My build/SCM blog series (see part 1 and part 2) ends with a look at one of the most annoying things a member can do to his team and a checklist to follow for reducing the chances of breaking a build.
So what can really irritate the rest of team? How about checking in a bunch of changes that break the build and then leaving for the day? This is bad enough for small teams, but consider bigger, distributed teams developing complex applications. You could have team members who start their day after you've left. If the team follows the rule of not checking in on a broken build, what's the team supposed to do? Well, to continue progress, somebody else has to step in and fix the build. This can really slow a team down.
A good practice is to wait for a successful build after your last check in before leaving. After all, you know the most about the changes that would have broken the build. This practice implies some prerequisites: a continuous integration system that runs often and builds that run quickly.
Now that I've ranted enough, what can you do to reduce the chances of breaking a build in the first place? Listed below are steps to follow. It starts at the point where you're ready to check in. Essentially, you mimic the continuous integration system on your development workstation.
Do I follow all of these steps on every check in? No way. That wouldn't be practical. You need to consider the size and impact of your changes. The bigger they are, the more rigorous you should be. If I made just a small change, I would probably just make sure the code compiled and unit tests for that change passed.
Well, that's it. Hope you enjoyed.
Nice checklist but I would add some items (like your list, these are
"optional" items depending on the impact of your changes):
Make sure tests have been added, expanded or modified for any of your code changes. Of course the tests should have come first! But this is a good time to do a mental check that those tests are sufficient (better now then later!). Think about edge and corner cases that may need to be tested as a result of your changes.
Make sure inline docs (e.g. javadocs and implementation notes within the code) have been added, expanded or modified for any of your code changes (better now then later).
Have a colleague review any changes you are not 100% sure of, or anything you made a change to a unit test for. At least shoot an email out to the chosen reviewer.
Run static analysis tools (PMD, Checkstyle and FindBugs) as an easy way to catch places where your new code is out of synch with the local coding standard, or otherwise stinky). This one is especially good for newbies!