When working together in a software development team it is important to have a common definition for when something is DONE. An important aspect of getting things DONE is a well-defined check-in procedure that all developers follow to commit something into the source control repository. Here is the procedure that we use at Pragma for committing changes into our Team Foundation Source Control repository:
- Code has been integrated with a recent version of the code in the TFS repository – at least a version of the TFS repository on the same day.
- Code has been formatted according to our ReSharper Pragma Full Cleanup profile. This automatically formats all code to follow the same formatting and layout standards.
- Code compiles without any compiler warnings.
- Code adheres to our coding standards - I’ll write more about this in a future post. We try to automate the application of our coding standards (where possible) using tools like ReSharper. Alternatively, use a code review checklist to quickly identify areas of concern.
- No ReSharper code analysis Error or Warning violations (i.e. green square in scrollbar). Any violation needs to be identified and agreed upon. Suggestions and Hints can be ignored if deemed unnecessary.
- No FxCop violations. Any violation needs to be identified, agreed upon and justified using the in-code SuppressMessage attribute.
- New functionality has been covered by tests and the code coverage has been verified using NCover.
- Bugs have been covered by tests and verified using NCover.
- Code adherers to the Logging strategy and the developer has inspected the usefulness of the log statements using Log4View.
- Code adheres to the Exception handling strategy for managing exceptions.
- Error Messages and translations have been added to the resource files.
- The associated TFS work item (development ticket/task) has been updated to reflect the effort involved (actual hours, comments etc.)
Once the code satisfies the above mentioned criteria, the developer runs a gated check-in using the TeamCity Visual Studio Plug-in. This ensures that all the unit and integration tests are executed by the TeamCity build server after integrating the local changes with the latest TFS repository changeset. Only if all the tests pass will TeamCity commit the changes onto the Mainline. The observant reader may have noticed that we don’t do an upfront code review. As we work from home for 2-3 days a week, we conduct our code reviews on the checked-in artefacts. I’ll write more about the code review procedure in a future blog posting.
Lastly, for service pack development, the developer needs to consider whether the change needs to be merged across to the Mainline for the next major version and merge the changes across if required.