Saturday, September 28, 2013

Code Review Tools

  • Before introducing code reviews in your project, agree on a procedure for how to do it, and make sure that everyone agrees with it and understands it. I can suggest the following procedure points, just to get started:



  •     Plan for a maximum of four hours development time pr.task

        Keep the master branch as the production ready branch at all times

        Always branch out a new task from master or release

        Use a standard for naming your task branches (more on this below)

        Use task branches for every change (no exception!)

        When done coding, push to Github and do pull request to development branch on every task branch

        Do a code review of your own pull request before sending it

        Never merge to master until you get at least one "Ok" comment from others

        Check others pull requests at least every two hours



    http://share.ez.no/blogs/arne-bakkebo/branching-and-code-review-procedures-qa-4

  • Review Assistant tool includes the custom check-in policy for TFS

  • Team Foundation Server provides a number of out-of-box check-in policies, including policies that check that static code analysis has been performed

    https://www.devart.com/review-assistant/docs/index.html?adding_code_review_policy_to_tfs_project.html

  • setup a custom policy to TFS that every check-in needs to pass a code review

  • So, instead of developers having to shelve their changes manually and assign the shelveset to a code review, if this tool can do that automatically for you in a check-in process, that’d be super

    http://blog.devart.com/creating-tfs-custom-check-in-policy-part-1.html

  • FishEye

FishEye knows everything about your code: search out source code artifacts, integrate with JIRA, and browse commits, files, revisions, or people.
fishEye provides a read-only window into your Subversion, Perforce, CVS, Git, and Mercurial repositories, all in one place.
Keep a pulse on everything about your code:
Visualize and report on activity, integrate source with JIRA issues, and search for commits, files, revisions, or people.
http://www.atlassian.com/software/fisheye/overview

  • stash
On-premise source code management for Git that's secure, fast, and enterprise grade. Create and manage repositories, integrate with JIRA for end to end traceability, set up fine-grained permissions, collaborate on code and instantly scale with high performance.
https://www.atlassian.com/software/stash
  • Gerrit

Gerrit is a free, web-based team software code review tool.
Software developers in a team can review each other's modifications on their source code using a Web browser and approve or reject those changes.
It integrates closely with git, a distributed version control system.
https://en.wikipedia.org/wiki/Gerrit_(software)

Gerrit
Gerrit is a web based code review system, facilitating online code reviews for projects using the Git version control system.
https://code.google.com/p/gerrit/


  • A code review process is a process in which a change by a developer is reviewed by other developers.

Every developer can suggest changes and update the suggested changes.
Once the change is accepted by all relevant parties, it is applied to the code base.
While a code review process can be implemented without any tool support, it is typically more efficient if a structured code review system is used.
Gerrit is a code review system developed for the Git version control system

Advantages of code review

In general a structure code review process has the following advantages:

    Early error detection: errors are early identified in the process

    Conformity with coding standards: code review allows the team to identify early in the process any violations with the code standards of the team

    Knowledge exchange: the code review process allows new developers to see the code of other developers and to get early feedback on their suggested changes

    Shared code ownership: by reviewing code of other developers the whole team gets a solid knowledge of the complete code basis

    Code reviews in open tools provide people without the permission to push to a repository with a simple way to contribute their suggested changes and to get feedback.

http://www.vogella.com/articles/Gerrit/article.html


  • Before you can commit the files to your repository, you need to add them. Simply right click the shared project’s node and navigate to Team => Add


After this operation, the question mark should change to a plus symbol. To set certain folders or files to be ignored by Git, e.g. the bin folder, right click them and select Navigate => Ignore.


The ignored items will be stored in a file called gitignore, which you should add to the repository
After changing files in your project, a “>” sign will appear right after the icon, telling you the status of these files is dirty
Any parent folder of this file will be marked as dirty as well.


http://eclipsesource.com/blogs/tutorials/egit-tutorial/


  • Git blame

git status git tag git blame
The git blame command is a versatile troubleshooting utility that has extensive usage options. The high-level function of git blame is the display of author metadata attached to specific committed lines in a file. This is used to examine specific points of a file's history and get context as to who the last author was that modified the line. This is used to explore the history of specific code and answer questions about what, how, and why the code was added to a repository.

Git Blame vs Git Log
While git blame displays the last author that modified a line, often times you will want to know when a line was originally added. This can be cumbersome to achieve using git blame. It requires a combination of the -w, -C, and -M options. It can be far more convenient to use the git log command.

The git blame command is used to examine the contents of a file line by line and see when each line was last modified and who the author of the modifications was
Online Git hosting solutions like Bitbucket offer blame views, which offer a superior user experience to command line git blame usage. git blame and git log can be used in combination to help discover the history of a file's contents.
https://www.atlassian.com/git/tutorials/inspecting-a-repository/git-blame

No comments:

Post a Comment