In version 2.0 of Team Foundation Sidekicks we have first introduced Code Review Sidekick; today, I am going to explain in some detail the usage we had in mind while developing the tool. The name of the tool hints on usefulness in code review; however, since everybody has different code review process some extra explanation is required.
Let’s start with review of the files, based on changesets committed to source control repository.
When you invoke Code Review Sidekick from Source Control Explorer, “Find Changesets” dialog will be displayed:
Depending on the changeset selection, you can easily handle the following scenarios
- Review all changes done on project X within the last week. Specify project path and the dates range in “Find Changesets” dialog (the path will be pre-selected when starting Sidekick from SCE), and select appropriate changesets from the Results list
- Review changes performed by user X within the last week. Specify user name and date range in the “Find Changesets” dialog
Once you selected the changesets to review, the changesets and files revisions contained will be loaded into Code Review Sidekick:
In addition to reviewing files revisions, it is also possible to review work items associated with the changesets selected (on “Work Items” tab). That may answer the questions such as "What did user X worked on during this week?" and "What defects were fixed in these changes?"
The approach described above is working well if you review changes based on generic criteria ("changes by X within Y days") that you can search changesets by. Alternative to that approach would be work item driven approach, where you would specify queries such as "All bugs fixed by X during Y days", "All changes related to feature X", "Changes associated with reopened bugs" etc. Sidekick provides for this approach as well; instead of selecting changesets, you may select work items (by opening Sidekick from “Tools->Team Foundation Sidekicks” menu, and clicking Work Items button):
Once work items are selected, Code Review Sidekick window will be populated with file revisions (retrieved based on changesets, associated with work items).
The changesets associated with selected work items are available through Changesets tab.
Once the set of file revisions is retrieved (based on changesets or work items), you can compare the between two revisions of the file in view or between the revision in view and revision not in view (the most recent change not contained in the set of reviewed changes); also one can view the changeset details in standard “Changeset Details” window. The file revisions in the view may be filtered by the file name or by user name
Additional feature available when doing either review by changeset or review by work item is the ability to pick and choose changesets/work items; thus if query results is too general, you can select entries of interest without re-running the query. Or once "pick and choose" mode is enabled, you can remove unneeded entries from the list.
Using Code Review Sidekick, you can facilitate more formal code reviews or just keep abreast of the changes in a large project you work on (for example, by looking at the daily changes performed by the member of your team). Myself, I found it especially helpful when working with distributed team; first thing in the morning I fire it up to see what are the changes performed overnight.
However, it is important to understand that Sidekick works only with committed (that is checked in) files; it does not help with code reviews that involve shelvesets and in which the un-reviewed code is never checked in. We are considering implementing a tool for that scenario; if you feel strongly about it, please leave a comment.