code reviews
  Effective


                                                                          ct
                                                                h   ite
                                                             rc
                                                          eA
                                                        ar
                                                     ftw
                                                So
                                            -
                                        k
                                     re
                                   Ma
                               n
                       s   ti a
                    ba
               Se
• a Pole living in Sheffield
• over 12 years in
  development
• Pascal, C++, PHP, perl,
  python, Java
• co-author of 2 PHP
  books
• big fan of process
  automation
• TDD and CI
• occasionally contributes
  to open source projects
• wants to be a knight

                  https://joind.in/6947

@proofek
Who does code reviews?
All characters
             appearing in this
             presentation are
             fictitious.


             Any resemblance to
             real persons, living or
             dead, is purely
             coincidental.

Disclaimer
Tom “I Need It Now” –
           The Owner




           Harry “Just Get It Done” –
           The Manager




The Team
Adam “The Night Coder” –
           developer



           Kris “Hackety Hack” –
           master code reviewer



           Bruno “It Will Work” –
           apprentice reviewer



The Team
How much time do we need to
             get this project done?




                     Well, design, coding, code
                     reviews, testing…


              Do we really need to code review the
              code? You surely know how to code,
              and you have tested it and it works…
              Right?

Scenario 1
We're nearly done, just need
                     to get this code reviewed.




             Hmmm… all the developers are busy,
             we have no one spare. Let's skip it and
             get it straight into QA…




Scenario 2
Hello Harry,
              I need John to review my code.



                  John is busy, you can have Rob.




             But Rob is a junior developer, and
             he doesn't know this system.


                 You want it code reviewed or
                 not? Rob is all we've got!

Scenario 3
We do all these code review, spend
             a lot of time on this, but the code
             that hits production is still buggy.
             It's a waste of time!




Scenario 4
Code review

      Adam The Developer                         9:31 PM (0 minutes ago)
      to Kris The Reviewer

      Kris,

      I got this code I need you to review.
      Can you do it for me please? The code is in my repository on problem-fix branch.

      Thanks

      ---
      Adam


      Click here to Reply or Forward
No (e)mail!




Raising a code review
Bug tracking systems
  - JIRA
  - Bugtrak
  - Mantis

  Code review tools
  - Crucible/Fisheye
  - Gerrit
  - Github



Raising a code review
Code review

      Adam The Developer                                        9:31 PM (13 minutes ago)
      to Kris The Reviewer

      Kris,

      I got this code I need you to review.
      Can you do it for me please? The code is in my repository on problem-fix branch.

      Thanks

      ---
      Adam


      Kris The Reviewer                                          9:44 PM (0 minutes ago)
      to Adam The Developer

      Adam,

      No problem at all, but where did you branch the code from?
      I can’t identify the change set without it.

      ---
      Kris


      Click here to Reply or Forward
Version control
                 • Specific change
                   sets
                 • avoid specific
                   commits
                 • Reviewing patches
                   risky, unless
                   automated



What to review
Code review

      Adam The Developer                                                9:31 PM (25 minutes ago)
       Kris, I got this code I need you to review. Can you do it for me please? …

      Kris The Reviewer                                  9:44 PM (12 minutes ago)
     to Adam The Developer
      Adam,

      No problem at all, but where did you branch the code from?
      I can’t identify the change set without it.

      ---
      Kris

      Adam The Developer                                9:56 PM (0 minutes ago)
      to Kris The Reviewer

      Kris,

      Ah yes. Sorry. It’s branched from my master branch.

      ---
      Adam
What

                            and

                                  Why?
The purpose of the review
Bruno “It will work”


      Usual feedback produced:
       •   Makes sense
       •   Works
       •   Syntactically correct
       •   Approved




One way of doing things…
Kris “The Master
                       Reviewer”

      Tools used:
      •   PHP linter
      •   PHP Code Sniffer
      •   PHPUnit
      •   phpDocumentor
      •   PHP Depend
      •   PHP Mess Detector
      •   Sonar


Being smarter…
$ php -l Libraries/Action.class.php
    No syntax errors detected in Libraries/Action.class.php


    $ php -l Libraries/Action.class.php
    Errors parsing Libraries/Action.class.php


    $ phpcs –standard=Zend Libraries/Action.class.php

    FILE: /Volumes/git/modules/AccountChange/Libraries/Action.class.php
    --------------------------------------------------------------------------------
    FOUND 2 ERROR(S) AND 1 WARNING(S) AFFECTING 3 LINE(S)
    --------------------------------------------------------------------------------
      44 | ERROR   | Protected member variable "arrOptions" must contain a leading
         |         | underscore
      66 | WARNING | Line exceeds 80 characters; contains 82 characters
      97 | ERROR   | Line exceeds maximum limit of 120 characters; contains 135
         |         | characters
    --------------------------------------------------------------------------------

    Time: 0 seconds, Memory: 5.75Mb




Speed up with automation - PHP linter and PHP CodeSniffer
$ phpunit
     PHPUnit 3.6.12 by Sebastian Bergmann.

     Configuration read from phpunit.xml.dist

     ..................IIII................IIIIIIIIIIIIIIIIIIIIIII.. 63 / 240 ( 26%)
     .............................................I.....I........... 126 / 240 ( 52%)
     ............................................................... 189 / 240 ( 78%)
     ...................................................

     Time: 02:01, Memory: 26.75Mb

     OK, but incomplete or skipped tests!
     Tests: 240, Assertions: 514, Incomplete: 29.




Verify whether the code works with PHPUnit
PHP_Depend 0.10.6 by Manuel Pichler

             Parsing source files:
             ....................                                     20

             Executing CyclomaticComplexity-Analyzer:
             .............                                           261

             Executing ClassLevel-Analyzer:
             ............                                            247

             Executing CodeRank-Analyzer:
             .                                                        28

             Executing Coupling-Analyzer:
             .............                                           267

             Executing Hierarchy-Analyzer:
             ............                                            246

             Executing Inheritance-Analyzer:
             .                                                        30

             Executing NPathComplexity-Analyzer:
             ..............                                          283

             Executing NodeCount-Analyzer:
             ........                                                174

             Executing NodeLoc-Analyzer:
             ..........                                              205

             Generating pdepend log files, this may take a moment.

             Time: 00:05; Memory: 25.50Mb


Static analysis and code quality with PHP Depend
Static analysis and code quality with PHP Mess Detector
Static analysis and code quality with Sonar
Static analysis and code quality with Sonar
Static analysis and code quality with Sonar
Static analysis and code quality with Sonar
Static analysis and code quality with Sonar
Static analysis and code quality with Sonar
Kris “The Master
                         Reviewer”

   Things checked:
    • clarity                         • duplications
    • performance                     • code quality
    • excessive complexity            • potential deployment
    • impact on other                   issues
      systems                         • design flaws
    • does the solution
      solves the problem



…by looking at things all important
• Knowledge sharing
   • Mentoring new starters
   • Find bugs/design flaws
     early
   • Improve overall code quality
   • Fostering collective code
     ownership




The benefits of a code review – they are for you!
DEVELOPERS
             • Understand and accept that you will make
               mistakes.

             • You are not your code.

             • No matter how much "karate" you know,
               someone else will always know more.

             • Don't rewrite code without consultation.




The soft side - developers
CODE REVIEWERS

                 • The only true authority stems from
                   knowledge, not from position.

                 • Critique code instead of people




The soft side – code reviewers
• Location of your changes




                                                    WHAT?
      – Repository name, branch name, branch base

   • Subject of your changes
      – What have you changed

   • Reason for the change
      – Why have you change it




Summary - what include in the code review
WHO?
        • Seek the experts
            – If you're not sure ask around

        • Question the solution
            – Make sure it fits the purpose




Summary - who assign the code review to?
WHERE?
     • Make it traceable
        – Bug trucking system, ie. Jira, Trac, Mantis, etc
        – Code review tool, ie. Fisheye/Crucible, gerrit

     • Conversation/Pair programming
        – Just make sure outcome is captured




Summary – where to raise a code review?
• Use tools, don’t be a tool
   • Check for duplications/




                                               HOW?
     complexity
   • Asses impact on other systems
   • Make sure code is clear and
     self-descriptive




Summary - how to perform a good code review?
Effective code reviews
http://www.atlassian.com/angrynerds/


       http://georgegant.deviantart.com/art/Angry-Nerds-217554774
       http://www.flickr.com/photos/dawgbyte77/3058349367/
       http://www.flickr.com/photos/zzpza/3269784239/
       http://www.flickr.com/photos/toolmantim/6170448143/
       http://www.flickr.com/photos/coyau/7630782996/
       http://www.flickr.com/photos/73885983@N02/6729908421/
       http://www.osnews.com/story/19266/WTFs_m




Credits…
The Ten Commandments of Egoless Programming: http://alturl.com/
 q4dpa

 The Code review: http://www.soulbroken.co.uk/blog/2010/07/the-code-
 review/

 Fisheye/Crucible: http://www.atlassian.com/software/crucible/overview

 Gerrit: http://code.google.com/p/gerrit/

 Github: https://github.com/

 PHPUnit: http://phpunit.de

 PHP CodeSniffer: http://pear.php.net/PHP_CodeSniffer

 PHP Depend: http://pdepend.org/

 PHP Mess Detector: http://phpmd.org/

 Sonar: http://www.sonarsource.org/


…and references
Questions?

      https://      /6947




Q&A

More Related Content

PDF
Effective code reviews
PPT
Code Review
PDF
Code-Review-Principles-Process-and-Tools (1)
PDF
Code Review
PPT
Code Review
PPTX
Static code analysis
PPTX
How To Improve Quality With Static Code Analysis
PPTX
Static Code Analysis
Effective code reviews
Code Review
Code-Review-Principles-Process-and-Tools (1)
Code Review
Code Review
Static code analysis
How To Improve Quality With Static Code Analysis
Static Code Analysis

What's hot (20)

PDF
TDD for APIs @ Europython 2015, Bilbao by Michael Kuehne
PDF
Measuring Code Quality in WTF/min.
PDF
Joomla Code Quality Control and Automation Testing
PDF
Continuous inspection with Sonar
PPTX
Sonar Review
PDF
5 levels of api test automation
PDF
Code Review for Teams Too Busy to Review Code - Atlassian Summit 2010
PPTX
Insprint automation, build the culture
PDF
ProbeDroid - Crafting Your Own Dynamic Instrument Tool on Android for App Beh...
ODP
The Professional Programmer
PDF
Concepts of Functional Programming for Java Brains (2010)
PDF
Continuous Inspection of Code Quality: SonarQube
PDF
Code metrics in PHP
PDF
Introduction to test_driven_development
ODP
Java code coverage with JCov. Implementation details and use cases.
PDF
Code Quality Lightning Talk
PPTX
Code Quality Assurance
PDF
Test Driven iOS Development (TDD)
PPTX
Safety on the Max: How to Write Reliable C/C++ Code for Embedded Systems
PDF
Be armed to the teeth to maintain a high quality iOS code
TDD for APIs @ Europython 2015, Bilbao by Michael Kuehne
Measuring Code Quality in WTF/min.
Joomla Code Quality Control and Automation Testing
Continuous inspection with Sonar
Sonar Review
5 levels of api test automation
Code Review for Teams Too Busy to Review Code - Atlassian Summit 2010
Insprint automation, build the culture
ProbeDroid - Crafting Your Own Dynamic Instrument Tool on Android for App Beh...
The Professional Programmer
Concepts of Functional Programming for Java Brains (2010)
Continuous Inspection of Code Quality: SonarQube
Code metrics in PHP
Introduction to test_driven_development
Java code coverage with JCov. Implementation details and use cases.
Code Quality Lightning Talk
Code Quality Assurance
Test Driven iOS Development (TDD)
Safety on the Max: How to Write Reliable C/C++ Code for Embedded Systems
Be armed to the teeth to maintain a high quality iOS code
Ad

Similar to Effective code reviews (20)

PPTX
Html5 devconf nodejs_devops_shubhra
PPTX
Effective C++
PPTX
Connect js nodejs_devops_shubhra
PDF
Scylla Summit 2022: Learning Rust the Hard Way for a Production Kafka+ScyllaD...
PDF
Rocket Fuelled Cucumbers
PDF
Sista: Improving Cog’s JIT performance
PDF
WWCode Dallas - Kubernetes: Learning from Zero to Production
PDF
Eclipse Day India 2015 - Java bytecode analysis and JIT
PDF
Abusing bleeding edge web standards for appsec glory
PDF
[cb22] Your Printer is not your Printer ! - Hacking Printers at Pwn2Own by A...
PDF
Kanban for Software Development and Kaizen Culture
PDF
Demystifying Binary Reverse Engineering - Pixels Camp
PPTX
PVS-Studio. Static code analyzer. Windows/Linux, C/C++/C#. 2017
PDF
Clearly, I Have Made Some Bad Decisions
PPTX
Code quality
PPTX
Jfokus 2016 - A JVMs Journey into Polyglot Runtimes
PPTX
Patching Windows Executables with the Backdoor Factory | DerbyCon 2013
PDF
[CB20] Vulnerabilities of Machine Learning Infrastructure by Sergey Gordeychik
PDF
SFBigAnalytics_20190724: Monitor kafka like a Pro
PPTX
Static Code Analysis PHP[tek] 2023
Html5 devconf nodejs_devops_shubhra
Effective C++
Connect js nodejs_devops_shubhra
Scylla Summit 2022: Learning Rust the Hard Way for a Production Kafka+ScyllaD...
Rocket Fuelled Cucumbers
Sista: Improving Cog’s JIT performance
WWCode Dallas - Kubernetes: Learning from Zero to Production
Eclipse Day India 2015 - Java bytecode analysis and JIT
Abusing bleeding edge web standards for appsec glory
[cb22] Your Printer is not your Printer ! - Hacking Printers at Pwn2Own by A...
Kanban for Software Development and Kaizen Culture
Demystifying Binary Reverse Engineering - Pixels Camp
PVS-Studio. Static code analyzer. Windows/Linux, C/C++/C#. 2017
Clearly, I Have Made Some Bad Decisions
Code quality
Jfokus 2016 - A JVMs Journey into Polyglot Runtimes
Patching Windows Executables with the Backdoor Factory | DerbyCon 2013
[CB20] Vulnerabilities of Machine Learning Infrastructure by Sergey Gordeychik
SFBigAnalytics_20190724: Monitor kafka like a Pro
Static Code Analysis PHP[tek] 2023
Ad

More from Sebastian Marek (15)

PDF
The Journey Towards Continuous Integration
PDF
CodeClub - Teaching the young generation programming
PDF
Praktyczne code reviews - PHPConPl
PDF
Managing and Monitoring Application Performance
PDF
Ten Commandments Of A Software Engineer
PDF
Continuous Inspection: Fight back the 7 deadly sins of a developer!
PDF
Test your code like a pro - PHPUnit in practice
PDF
PHP Forum Paris 2012: Magic behind the numbers. Software metrics in practice
PPTX
Ten Commandments Of A Software Engineer
PDF
PHP Benelux 2012: Magic behind the numbers. Software metrics in practice
PPTX
Magic behind the numbers - software metrics in practice
PDF
Back to basics - PHPUnit
ODP
Back to basics - PHP_Codesniffer
ODP
Sonar - the ring to rule them all
ODP
vfsStream - effective filesystem mocking
The Journey Towards Continuous Integration
CodeClub - Teaching the young generation programming
Praktyczne code reviews - PHPConPl
Managing and Monitoring Application Performance
Ten Commandments Of A Software Engineer
Continuous Inspection: Fight back the 7 deadly sins of a developer!
Test your code like a pro - PHPUnit in practice
PHP Forum Paris 2012: Magic behind the numbers. Software metrics in practice
Ten Commandments Of A Software Engineer
PHP Benelux 2012: Magic behind the numbers. Software metrics in practice
Magic behind the numbers - software metrics in practice
Back to basics - PHPUnit
Back to basics - PHP_Codesniffer
Sonar - the ring to rule them all
vfsStream - effective filesystem mocking

Recently uploaded (20)

PPTX
GROUP4NURSINGINFORMATICSREPORT-2 PRESENTATION
DOCX
search engine optimization ppt fir known well about this
PDF
UiPath Agentic Automation session 1: RPA to Agents
PDF
OpenACC and Open Hackathons Monthly Highlights July 2025
PPT
What is a Computer? Input Devices /output devices
PPTX
Configure Apache Mutual Authentication
PDF
Consumable AI The What, Why & How for Small Teams.pdf
PDF
Credit Without Borders: AI and Financial Inclusion in Bangladesh
PDF
Hybrid horned lizard optimization algorithm-aquila optimizer for DC motor
PPTX
AI IN MARKETING- PRESENTED BY ANWAR KABIR 1st June 2025.pptx
PDF
Flame analysis and combustion estimation using large language and vision assi...
PDF
Five Habits of High-Impact Board Members
PPTX
TEXTILE technology diploma scope and career opportunities
PDF
How IoT Sensor Integration in 2025 is Transforming Industries Worldwide
PPTX
2018-HIPAA-Renewal-Training for executives
PDF
sbt 2.0: go big (Scala Days 2025 edition)
PPTX
The various Industrial Revolutions .pptx
PDF
Architecture types and enterprise applications.pdf
PDF
Improvisation in detection of pomegranate leaf disease using transfer learni...
PPTX
Chapter 5: Probability Theory and Statistics
GROUP4NURSINGINFORMATICSREPORT-2 PRESENTATION
search engine optimization ppt fir known well about this
UiPath Agentic Automation session 1: RPA to Agents
OpenACC and Open Hackathons Monthly Highlights July 2025
What is a Computer? Input Devices /output devices
Configure Apache Mutual Authentication
Consumable AI The What, Why & How for Small Teams.pdf
Credit Without Borders: AI and Financial Inclusion in Bangladesh
Hybrid horned lizard optimization algorithm-aquila optimizer for DC motor
AI IN MARKETING- PRESENTED BY ANWAR KABIR 1st June 2025.pptx
Flame analysis and combustion estimation using large language and vision assi...
Five Habits of High-Impact Board Members
TEXTILE technology diploma scope and career opportunities
How IoT Sensor Integration in 2025 is Transforming Industries Worldwide
2018-HIPAA-Renewal-Training for executives
sbt 2.0: go big (Scala Days 2025 edition)
The various Industrial Revolutions .pptx
Architecture types and enterprise applications.pdf
Improvisation in detection of pomegranate leaf disease using transfer learni...
Chapter 5: Probability Theory and Statistics

Effective code reviews

  • 1. code reviews Effective ct h ite rc eA ar ftw So - k re Ma n s ti a ba Se
  • 2. • a Pole living in Sheffield • over 12 years in development • Pascal, C++, PHP, perl, python, Java • co-author of 2 PHP books • big fan of process automation • TDD and CI • occasionally contributes to open source projects • wants to be a knight https://joind.in/6947 @proofek
  • 3. Who does code reviews?
  • 4. All characters appearing in this presentation are fictitious. Any resemblance to real persons, living or dead, is purely coincidental. Disclaimer
  • 5. Tom “I Need It Now” – The Owner Harry “Just Get It Done” – The Manager The Team
  • 6. Adam “The Night Coder” – developer Kris “Hackety Hack” – master code reviewer Bruno “It Will Work” – apprentice reviewer The Team
  • 7. How much time do we need to get this project done? Well, design, coding, code reviews, testing… Do we really need to code review the code? You surely know how to code, and you have tested it and it works… Right? Scenario 1
  • 8. We're nearly done, just need to get this code reviewed. Hmmm… all the developers are busy, we have no one spare. Let's skip it and get it straight into QA… Scenario 2
  • 9. Hello Harry, I need John to review my code. John is busy, you can have Rob. But Rob is a junior developer, and he doesn't know this system. You want it code reviewed or not? Rob is all we've got! Scenario 3
  • 10. We do all these code review, spend a lot of time on this, but the code that hits production is still buggy. It's a waste of time! Scenario 4
  • 11. Code review Adam The Developer 9:31 PM (0 minutes ago) to Kris The Reviewer Kris, I got this code I need you to review. Can you do it for me please? The code is in my repository on problem-fix branch. Thanks --- Adam Click here to Reply or Forward
  • 12. No (e)mail! Raising a code review
  • 13. Bug tracking systems - JIRA - Bugtrak - Mantis Code review tools - Crucible/Fisheye - Gerrit - Github Raising a code review
  • 14. Code review Adam The Developer 9:31 PM (13 minutes ago) to Kris The Reviewer Kris, I got this code I need you to review. Can you do it for me please? The code is in my repository on problem-fix branch. Thanks --- Adam Kris The Reviewer 9:44 PM (0 minutes ago) to Adam The Developer Adam, No problem at all, but where did you branch the code from? I can’t identify the change set without it. --- Kris Click here to Reply or Forward
  • 15. Version control • Specific change sets • avoid specific commits • Reviewing patches risky, unless automated What to review
  • 16. Code review Adam The Developer 9:31 PM (25 minutes ago) Kris, I got this code I need you to review. Can you do it for me please? … Kris The Reviewer 9:44 PM (12 minutes ago) to Adam The Developer Adam, No problem at all, but where did you branch the code from? I can’t identify the change set without it. --- Kris Adam The Developer 9:56 PM (0 minutes ago) to Kris The Reviewer Kris, Ah yes. Sorry. It’s branched from my master branch. --- Adam
  • 17. What and Why? The purpose of the review
  • 18. Bruno “It will work” Usual feedback produced: • Makes sense • Works • Syntactically correct • Approved One way of doing things…
  • 19. Kris “The Master Reviewer” Tools used: • PHP linter • PHP Code Sniffer • PHPUnit • phpDocumentor • PHP Depend • PHP Mess Detector • Sonar Being smarter…
  • 20. $ php -l Libraries/Action.class.php No syntax errors detected in Libraries/Action.class.php $ php -l Libraries/Action.class.php Errors parsing Libraries/Action.class.php $ phpcs –standard=Zend Libraries/Action.class.php FILE: /Volumes/git/modules/AccountChange/Libraries/Action.class.php -------------------------------------------------------------------------------- FOUND 2 ERROR(S) AND 1 WARNING(S) AFFECTING 3 LINE(S) -------------------------------------------------------------------------------- 44 | ERROR | Protected member variable "arrOptions" must contain a leading | | underscore 66 | WARNING | Line exceeds 80 characters; contains 82 characters 97 | ERROR | Line exceeds maximum limit of 120 characters; contains 135 | | characters -------------------------------------------------------------------------------- Time: 0 seconds, Memory: 5.75Mb Speed up with automation - PHP linter and PHP CodeSniffer
  • 21. $ phpunit PHPUnit 3.6.12 by Sebastian Bergmann. Configuration read from phpunit.xml.dist ..................IIII................IIIIIIIIIIIIIIIIIIIIIII.. 63 / 240 ( 26%) .............................................I.....I........... 126 / 240 ( 52%) ............................................................... 189 / 240 ( 78%) ................................................... Time: 02:01, Memory: 26.75Mb OK, but incomplete or skipped tests! Tests: 240, Assertions: 514, Incomplete: 29. Verify whether the code works with PHPUnit
  • 22. PHP_Depend 0.10.6 by Manuel Pichler Parsing source files: .................... 20 Executing CyclomaticComplexity-Analyzer: ............. 261 Executing ClassLevel-Analyzer: ............ 247 Executing CodeRank-Analyzer: . 28 Executing Coupling-Analyzer: ............. 267 Executing Hierarchy-Analyzer: ............ 246 Executing Inheritance-Analyzer: . 30 Executing NPathComplexity-Analyzer: .............. 283 Executing NodeCount-Analyzer: ........ 174 Executing NodeLoc-Analyzer: .......... 205 Generating pdepend log files, this may take a moment. Time: 00:05; Memory: 25.50Mb Static analysis and code quality with PHP Depend
  • 23. Static analysis and code quality with PHP Mess Detector
  • 24. Static analysis and code quality with Sonar
  • 25. Static analysis and code quality with Sonar
  • 26. Static analysis and code quality with Sonar
  • 27. Static analysis and code quality with Sonar
  • 28. Static analysis and code quality with Sonar
  • 29. Static analysis and code quality with Sonar
  • 30. Kris “The Master Reviewer” Things checked: • clarity • duplications • performance • code quality • excessive complexity • potential deployment • impact on other issues systems • design flaws • does the solution solves the problem …by looking at things all important
  • 31. • Knowledge sharing • Mentoring new starters • Find bugs/design flaws early • Improve overall code quality • Fostering collective code ownership The benefits of a code review – they are for you!
  • 32. DEVELOPERS • Understand and accept that you will make mistakes. • You are not your code. • No matter how much "karate" you know, someone else will always know more. • Don't rewrite code without consultation. The soft side - developers
  • 33. CODE REVIEWERS • The only true authority stems from knowledge, not from position. • Critique code instead of people The soft side – code reviewers
  • 34. • Location of your changes WHAT? – Repository name, branch name, branch base • Subject of your changes – What have you changed • Reason for the change – Why have you change it Summary - what include in the code review
  • 35. WHO? • Seek the experts – If you're not sure ask around • Question the solution – Make sure it fits the purpose Summary - who assign the code review to?
  • 36. WHERE? • Make it traceable – Bug trucking system, ie. Jira, Trac, Mantis, etc – Code review tool, ie. Fisheye/Crucible, gerrit • Conversation/Pair programming – Just make sure outcome is captured Summary – where to raise a code review?
  • 37. • Use tools, don’t be a tool • Check for duplications/ HOW? complexity • Asses impact on other systems • Make sure code is clear and self-descriptive Summary - how to perform a good code review?
  • 39. http://www.atlassian.com/angrynerds/ http://georgegant.deviantart.com/art/Angry-Nerds-217554774 http://www.flickr.com/photos/dawgbyte77/3058349367/ http://www.flickr.com/photos/zzpza/3269784239/ http://www.flickr.com/photos/toolmantim/6170448143/ http://www.flickr.com/photos/coyau/7630782996/ http://www.flickr.com/photos/73885983@N02/6729908421/ http://www.osnews.com/story/19266/WTFs_m Credits…
  • 40. The Ten Commandments of Egoless Programming: http://alturl.com/ q4dpa The Code review: http://www.soulbroken.co.uk/blog/2010/07/the-code- review/ Fisheye/Crucible: http://www.atlassian.com/software/crucible/overview Gerrit: http://code.google.com/p/gerrit/ Github: https://github.com/ PHPUnit: http://phpunit.de PHP CodeSniffer: http://pear.php.net/PHP_CodeSniffer PHP Depend: http://pdepend.org/ PHP Mess Detector: http://phpmd.org/ Sonar: http://www.sonarsource.org/ …and references
  • 41. Questions? https:// /6947 Q&A