Upgrade to Pro — share decks privately, control downloads, hide ads and more …

There's More to Code Reviews than You Might Thi...

There's More to Code Reviews than You Might Think ✩

Given at Re:Develop conference, October 2016.

Daniel Shaw

October 14, 2016
Tweet

More Decks by Daniel Shaw

Other Decks in Programming

Transcript

  1. ☐ Check code style ☐ Review the configuration ☐ Check

    forwards compatibility ☐ Review the documentation ☐ Review the commit message ☐ Double check the code ☐ Double check the tests Code review checklist
  2. Check code style Automate if you can. Bad news can

    be better received by
 a cruel and lifeless script
  3. Review the commit message Update UsefulTool lib Wider company policy

    dictates that the latest UsefulTool v1 should be used. Update Composer config to reflect this. [MYCOOLAPP-1234]
  4. Double check the code $permitted = ['2', '4', '5', 'cake'];

    $input = 0; if (in_array($input, $permitted)) { echo "I'm in!"; }
  5. Double check the code function is_allowed_access($input, $expected) { if (in_array($input,

    $expected), true) { return true; } else { return false; } }
  6. Double check the code function is_allowed_access($input, $expected) { if (in_array($input,

    $expected), true) { return true; } else { return false; } } function testCheckAccess() { $input = 2; $expected = ['2', '4', '5']; assertTrue( $class->is_allowed_access( $input, $expected ); }
  7. Double check the tests function is_allowed_access($input, $expected) { if (in_array($input,

    $expected), true) { return true; } else { return false; } } function testCheckAccess() { $input = 2; $expected = ['2', '4', '5']; assertTrue( $class->is_allowed_access( $input, $expected ); }
  8. Double check the tests function testCheckAccess() { $input = 2;

    $expected = ['2', '4', '5']; assertTrue( $class->is_allowed_access( $input, $expected ); } function testCheckAccess_isStrict() { $input = 0; $expected = ['2', '4', '5', 'cake']; assertFalse( $class->is_allowed_access( $input, $expected ); }
  9. ☑ Check code style ☑ Review the configuration ☑ Check

    forwards compatibility ☑ Review the documentation ☑ Review the commit message ☑ Double check the code ☑ Double check the tests Code review checklist