1. Automatic Code Review Process
    1. Traditional code review process
      1. Offline code review
        1. Scenario
          1. Author submitted the code
          2. Reviewer reviewed the code later
          3. Reviewer gave some suggestion to the author
          4. Author refactored the code
          5. Reviewer checked the code again and accepted the changes
        2. Disadvantages
          1. Low efficient
          2. Decrease productivity
          3. Boring
      2. Code review as event
        1. Scenario
          1. Team members found there were many bad codes and decided to hold a meeting to address them
          2. Team members gathered together for the CR meeting
          3. Speaker talked about the bad practices in the recently submitted code
          4. Team went back and fixed their own problems
        2. Disadvantages
          1. No all problems can be mentioned on the meeting
          2. Breed the tiger from cute to horrible one
          3. Could be more efficient if CR is daily practice
    2. Why Automatic matters in CR
      1. Scenario
        1. The code analysis tool runs at night and a report was generated
        2. The developers get the report from email notification
        3. Tom got a coding convention warning of his method
          1. Tom checked the MA Coding Convention and identify the problem
          2. Tom fixed the issue and run the code analysis tool locally
          3. The locally running code analysis tool told Tom the code was fine this time
          4. Tom submit the code, happily
        4. Jerry got a design warning of his class
          1. Jerry read the description and the suggested solution of the warning
          2. Jerry really had no idea how to get it fixed
          3. Jerry came to his mentor (or his colleague) Henry, who had the responsibility to do code review with Jerry in this iteration
          4. Jerry and Henry sat together for 1 hour and finally fixed the warning
          5. Jerry and Henry run code analysis tool locally and the warning disapear
          6. Jerry and Henry run unit test locally and nothing failed by this modification
          7. Jerry submit the code, “High five!”
      2. Advantages
        1. Help to make real online code review practical
        2. Help to identify the facial issues (productivity)
        3. Help to identify the potential hidden issues (productivity)
        4. Help to establish a process of really doing CR and get benifit from it
        5. Make CR as a daily practice
  2. Tools
    1. CC.NET
    2. StyleCop
      1. Default rules area
        1. Documentation
        2. Layout
        3. Maintanablity
        4. Naming
        5. Ordering
        6. Readability
        7. Spacing
      2. Customize default rules into MA Coding Convention rules
        1. General
        2. Comments
        3. Subtopic 3
        4. Subtopic 4
      3. Extend more good rules accommodate our needs
    3. FxCop
      1. Default warnings area
        1. Design
        2. Globalization
        3. Interoperability
        4. Naming
        5. Performance
        6. Security
        7. Usage
      2. Customize default rules into rules fit our needs
        1. Study them all
        2. Directly use some of them
        3. Customize some of them
        4. Establish our own rule set
      3. Why useful?
        1. Give warnings to code which violate design guidelines
        2. Learn design guidelines from the warnings
  3. Tasks
    1. Customize a set of rules which accommodate Moody's Coding Convention
    2. Integrate StyleCop into CC.NET
    3. Establish reporting mechanism of StyleCop
    4. Apply the coding convention to an existing project
    5. Retrospective of the StyleCop ACR customization
    6. Select/Modify/Add a rule set from default FxCop rule base
    7. Identify one piece of code belongs to whom
    8. Integrate FxCop into CC.NET
    9. Establish reporting mechanism of FxCop
    10. Retrospective of the FxCop ACR customization
    11. Define the ACR process and spread the experience
  4. Advantages
    1. Improve product quality
    2. Have clean & consistent code base
    3. Improve developer skills
    4. Knowledge spreading
    5. Way of mentoring
    6. Metrics of performance