DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration...
Transcript of DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration...
![Page 1: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/1.jpg)
CODE REVIEW AND CONTINUOUS INTEGRATION
DAVE LIDDAMENT
![Page 2: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/2.jpg)
![Page 3: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/3.jpg)
MORAL OF THE STORY
▸ We all make mistakes.
▸ If the mistakes are spotted and rectified quickly the consequences of the mistakes are minimal.
▸ We want to make mistakes easy to spot.
![Page 4: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/4.jpg)
HOW CAN WE REDUCE THE COST OF SOFTWARE DEVELOPMENT?
QUESTION
![Page 5: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/5.jpg)
COST OF A BUGCo
st
DESIGN WRITING CODE
TEST RELEASE MAINTENANCE
FIND BUGS SOONER
![Page 6: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/6.jpg)
WHY CODE REVIEW AND CONTINUOUS INTEGRATION
TYPES OF BUGS
▸ Code doesn’t work
▸ Code works but does the wrong thing
▸ Poor architecture / design
![Page 7: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/7.jpg)
COST OF A BADLY WRITTEN CODECo
st
Time
COST TO DEVELOP SIMILAR SIZED FEATURE OVER TIME
![Page 8: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/8.jpg)
WHY DO BUGS HAPPENRa
te o
f int
rodu
cing
bug
s
Experience / Skill
SKILL AND EXPERIENCE VS BUGS
![Page 9: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/9.jpg)
WHY THIS TALK
CODE REVIEW AND CI DONE WELL WILL REDUCE COST OF SOFTWARE DEVELOPMENT
▸ Fewer bugs
▸ Cheaper bugs
▸ Write code quicker (by making code easier to read)
▸ Providing opportunities to quickly up skill team members
![Page 10: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/10.jpg)
Pay attention!
@DaveLiddament
Dave Liddament @daveliddament
Lamp Bristol
15+ years software development (PHP, Java, Python, C)
Organise PHP-SW user group and Bristol PHP Training
![Page 11: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/11.jpg)
AGENDA
▸ Why
▸ Code review
▸ CI - Continuous Integration
▸ Branching strategies
▸ Github / Bitbucket setup
▸ CircleCI example
▸ Wrap up
![Page 12: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/12.jpg)
HOW
HOW ARE WE GOING TO REDUCE COSTS?
![Page 13: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/13.jpg)
HOW
HOW ARE WE GOING TO REDUCE COSTS?
▸ Code Review
▸ github
▸ bitbucket
▸ gerrit
![Page 14: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/14.jpg)
HOW
HOW ARE WE GOING TO REDUCE COSTS?
▸ Code Review
▸ github
▸ bitbucket
▸ gerrit
▸ Continuous Integration (CI)
▸ Jenkins
▸ CircleCI
▸ Travis CI
![Page 15: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/15.jpg)
CODE REVIEW
![Page 16: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/16.jpg)
QUESTIONS TO ASK IN CODE REVIEW
CODE REVIEW SHOULD FOCUS ON THINGS THAT CAN NOT BE AUTOMATED
![Page 17: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/17.jpg)
QUESTIONS TO ASK IN CODE REVIEW
DO THE TESTS TEST THE REQUIRED FUNCTIONALITY?
![Page 18: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/18.jpg)
QUESTIONS TO ASK IN CODE REVIEW
ARE THE TESTS ADEQUATE?
![Page 19: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/19.jpg)
ARE THERE ENOUGH TESTS
IS THIS ENOUGH TESTING?
Scenario: Navigation at T junction in a cave Given: I am coming up to a T. When: Before I pass the T junction. Then: I should drop a cookie.
![Page 20: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/20.jpg)
ARE THERE ENOUGH TESTS
HOW MANY TESTS DO WE NEED?
class Person {
/** * Returns true if the person is 18 or over */ public function isAdult(): bool {
.. some implementation .. }
}
![Page 21: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/21.jpg)
ARE THERE ENOUGH TESTS
HOW MANY TESTS DO WE NEED (2)?
/** * @param int $id * @return bool * @throws NotFoundException */ public function isAllowed(int $id): bool { .. some implementation .. }
![Page 22: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/22.jpg)
QUESTIONS TO ASK IN CODE REVIEW
WILL I UNDERSTAND THIS CODE IN 6 MONTHS TIME?
![Page 23: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/23.jpg)
COST OF WRITING CODE CODE
![Page 24: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/24.jpg)
“THE RATIO OF TIME SPENT READING VERSUS WRITING IS WELL OVER 10 TO 1. WE ARE CONSTANTLY READING OLD CODE AS PART OF THE EFFORT TO WRITE NEW CODE. … [THEREFORE,] MAKING IT EASY TO READ MAKES IT EASIER TO WRITE.”
Robert C. Martin (Clean Code)
COST OF WRITING CODE CODE
![Page 25: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/25.jpg)
HOW CAN WE REDUCE COST OF WRITING CODE
COST OF WRITING CODE
Reading Writing
![Page 26: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/26.jpg)
HOW CAN WE REDUCE COST OF WRITING CODE
COST OF WRITING CODE
Reading Writing
![Page 27: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/27.jpg)
HOW CAN WE REDUCE COST OF WRITING CODE
COST OF WRITING CODE
Reading Writing
![Page 28: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/28.jpg)
HOW CAN WE REDUCE COST OF WRITING CODE
COST OF WRITING CODE
Reading Writing
Code review + refactor
![Page 29: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/29.jpg)
WILL I UNDERSTAND THE CODE IN 6 MONTHS TIME?
WHAT DOES THIS CODE DO?
$userFields = [ 'Username', 'Email', 'FirstName', 'LastName', 'Phone', ];
foreach ($userFields as $key) { if ($userDetails->{'get'.$key}()) { $user->{'set'.$key}($userDetails->{'get'.$key}()); } }
![Page 30: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/30.jpg)
WILL I UNDERSTAND THE CODE IN 6 MONTHS TIME?
WHAT DOES THIS CODE DO? (2)
if ($userDetails->getUsername()) { $user->setUsername($userDetails->getUsername()); } if ($userDetails->getEmail()) { $user->setEmail($userDetails->getEmail()); } if ($userDetails->getFirstName()) { $user->setFirstName($userDetails->getFirstName()); } if ($userDetails->getLastName()) { $user->setLastName($userDetails->getLastName()); } if ($userDetails->getPhone()) { $user->setPhone($userDetails->getPhone()); }
![Page 31: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/31.jpg)
WILL I UNDERSTAND THE CODE IN 6 MONTHS TIME?
/** * Represents a location in the UK. (eg city, town, village) */ class Location {
… other methods …
private $url;
/** * @return string URL */ public function getUrl(): string {
return $this->url; }
![Page 32: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/32.jpg)
WILL I UNDERSTAND THE CODE IN 6 MONTHS TIME?
WHAT IS URL?/** * Represents a location in the UK. (eg city, town, village) */ class Location {
… other methods …
private $url;
/** * @return string URL */ public function getUrl(): string {
return $this->url; }
![Page 33: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/33.jpg)
WILL I UNDERSTAND THE CODE IN 6 MONTHS TIME?
if ($agent->getType() === 1) {
… do something …
}
![Page 34: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/34.jpg)
WILL I UNDERSTAND THE CODE IN 6 MONTHS TIME?
WHAT DOES 1 MEAN?
if ($agent->getType() === 1) {
… do something …
}
![Page 35: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/35.jpg)
QUESTIONS TO ASK IN CODE REVIEW
ARE WE FOLLOWING PROJECT CONVENTIONS?
![Page 36: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/36.jpg)
ARE WE FOLLOWING PROJECT CONVENTIONS
interface LocationRepository {
public function findClosestTo($point);
public function findByName($name);
public function findBySlug($slug);
public function searchForLocation($name, $type);
public function findAllByType($type);
}
![Page 37: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/37.jpg)
ARE WE FOLLOWING PROJECT CONVENTIONS
INCONSISTENT METHOD NAMEinterface LocationRepository {
public function findClosestTo($point);
public function findByName($name);
public function findBySlug($slug);
public function searchForLocation($name, $type);
public function findAllByType($type);
}
![Page 38: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/38.jpg)
![Page 39: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/39.jpg)
QUESTIONS TO ASK IN CODE REVIEW
IS CODE AS OBVIOUS AND EXPLICIT AS IT POSSIBLY CAN BE?
![Page 40: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/40.jpg)
IS THE CODE AS OBVIOUS AND EXPLICIT AS IT POSSIBLY CAN BE
HOW DO WE MAKE THIS MORE OBVIOUS
class MarketingCampaign {
public function addAddress($address) { .. some implementation .. }
}
![Page 41: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/41.jpg)
IS THE CODE AS OBVIOUS AND EXPLICIT AS IT POSSIBLY CAN BE
HOW DO WE MAKE THIS MORE OBVIOUS (2)
class MarketingCampaign {
public function addEmailAddress($emailAddress) { .. some implementation .. }
}
![Page 42: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/42.jpg)
IS THE CODE AS OBVIOUS AND EXPLICIT AS IT POSSIBLY CAN BE
HOW DO WE MAKE THIS MORE OBVIOUS (3)
class MarketingCampaign {
/** * Adds email address, person will then be messaged * as part of the campaign. */ public function addEmailAddress($emailAddress) { .. some implementation .. }
}
![Page 43: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/43.jpg)
IS THE CODE AS OBVIOUS AND EXPLICIT AS IT POSSIBLY CAN BE
HOW DO WE MAKE THIS MORE OBVIOUS (4)
class MarketingCampaign { /** * Add email address that should received campaign * messages. */ public function addEmailAddress(string $emailAddress ): void { .. some implementation .. }
}
![Page 44: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/44.jpg)
IS THE CODE AS OBVIOUS AND EXPLICIT AS IT POSSIBLY CAN BE
HOW DO WE MAKE THIS MORE OBVIOUS (5)
class MarketingCampaign { /** * Add email address that should received campaign * messages. */ public function addEmailAddress( EmailAddress $emailAddress ): void { .. some implementation .. }
}
![Page 45: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/45.jpg)
QUESTIONS TO ASK IN CODE REVIEW
CAN I UNDERSTAND THE FUNCTIONALITY OF THE CODE WITHOUT READING IT?
![Page 46: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/46.jpg)
![Page 47: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/47.jpg)
![Page 48: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/48.jpg)
QUESTIONS TO ASK IN CODE REVIEW
HAS DEFENSIVE CODING BEEN USED?
![Page 49: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/49.jpg)
HAS DEFENSIVE CODING BEEN USED
switch($status) {
case ‘started’: … do something … break;
case ‘finished’: … do something … break;
case ‘quit’: … do something … break; }
![Page 50: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/50.jpg)
HAS DEFENSIVE CODING BEEN USED
MISSING DEFAULTswitch($status) {
case ‘started’: … do something … break;
case ‘finished’: … do something … break;
case ‘quit’: … do something … break; }
![Page 51: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/51.jpg)
HAS DEFENSIVE CODING BEEN USED
/** * Set status (one of started|finished|quit) * * @param string $status */ public function setStatus(string $status): void { $this->status = $status; }
![Page 52: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/52.jpg)
HAS DEFENSIVE CODING BEEN USED
MISSING CHECK THAT STATUS IS A VALID VALUE/** * Set status (one of started|finished|quit) * * @param string $status */ public function setStatus(string $status): void { $this->status = $status; }
![Page 53: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/53.jpg)
QUESTIONS TO ASK IN CODE REVIEW
HAS TECHNICAL DEBT BEEN DOCUMENTED?
![Page 54: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/54.jpg)
HAS TECHNICAL DEBT BEEN DOCUMENTED
ALL TODO COMMENTS MUST REFERENCE A TICKET
// TODO: Refactor to method https://trello.com/c/Aaa123
… some hacky code …
![Page 55: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/55.jpg)
QUESTIONS TO ASK IN CODE REVIEW
CAN ARCHITECTURE BE IMPROVED? (E.G. SOLID)
![Page 56: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/56.jpg)
BENEFITS OF CODE REVIEW
![Page 57: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/57.jpg)
CODE REVIEW BENEFITS
SOMEONE IS WATCHING YOU
![Page 58: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/58.jpg)
CODE REVIEW BENEFITS
LEARNING AND UPSKILLING
![Page 59: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/59.jpg)
BENEFITS OF CODE REVIEW
COST OF WRITING CODE
Reading Writing
![Page 60: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/60.jpg)
BENEFITS OF CODE REVIEW
COST OF WRITING CODE
Reading Writing
Code review + refactor
![Page 61: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/61.jpg)
BENEFITS OF CODE REVIEWCo
st
Time
COST TO DEVELOP SIMILAR SIZED FEATURE OVER TIME
![Page 62: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/62.jpg)
BENEFITS OF CODE REVIEWCo
st
DESIGN WRITING CODE
TEST RELEASE MAINTENANCE
FIND BUGS SOONER
![Page 63: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/63.jpg)
BENEFITS OF CODE REVIEW
QUICK FEEDBACK LOOP
![Page 64: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/64.jpg)
WHO SHOULD CONDUCT CODE REVIEWS
EVERYONE SHOULD CODE REVIEW
![Page 65: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/65.jpg)
WHAT MAKES CODE EASY TO REVIEW?
![Page 66: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/66.jpg)
ASK PROGRAMMERS TO REVIEW 10 LINES OF CODE THEY’LL FIND 10 ISSUES…
Anyone who’s done code review
WHAT MAKES CODE EASY TO TO REVIEW
![Page 67: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/67.jpg)
ASK THEM TO DO 500 LINES THEY’LL SAY IT’S GOOD TO GO
Anyone who’s done code review
WHAT MAKES CODE EASY TO TO REVIEW
![Page 68: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/68.jpg)
GOOD REVIEW COMMENTS
![Page 69: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/69.jpg)
GOOD REVIEW COMMENTS
DON’T BE A ****
![Page 70: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/70.jpg)
GOOD REVIEW COMMENTS
NOT CRITICAL OF THE CODE AUTHOR
![Page 71: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/71.jpg)
GOOD REVIEW COMMENTS
STATE PROBLEM AND SUGGEST IMPROVEMENT
![Page 72: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/72.jpg)
GOOD REVIEW COMMENTS
LINK TO STACK OVERFLOW, BLOG, ETC
![Page 73: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/73.jpg)
GOOD REVIEW COMMENTS
USE: ‘LET’S CHAT’
![Page 74: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/74.jpg)
GOOD REVIEW COMMENTS
USE ‘QUESTION:’
![Page 75: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/75.jpg)
RECEIVING REVIEW COMMENTS
![Page 76: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/76.jpg)
RECEIVING REVIEW COMMENTS
DON’T BE A ****
![Page 77: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/77.jpg)
CONTINUOUS INTEGRATION
![Page 78: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/78.jpg)
TASKS FOR CONTINUOUS INTEGRATION
RUNNING TESTS
![Page 79: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/79.jpg)
TASKS FOR CONTINUOUS INTEGRATION
LINT (OR BETTER STILL PARALLEL LINT)
composer require —dev jakub-onderka/php-parallel-lint
vendor/bin/parallel-lint src
![Page 80: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/80.jpg)
TASKS FOR CONTINUOUS INTEGRATION
CODE STYLE CHECKERcomposer require —dev friendsofphp/php-cs-fixer
vendor/bin/php-cs-fixer fix —dry-run src
# Or locally to fix problems
vendor/bin/php-cs-fixer fix src
![Page 81: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/81.jpg)
TASKS FOR CONTINUOUS INTEGRATION
VAR DUMP CHECKER
composer require —dev jakub-onderka/php-var-dump-check
vendor/bin/php-var-dump-check —no-colors src
![Page 82: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/82.jpg)
TASKS FOR CONTINUOUS INTEGRATION
SYMFONY
bin/console lint:twig app
bin/console lint:yaml app
![Page 83: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/83.jpg)
TASKS FOR CONTINUOUS INTEGRATION
STATIC ANALYSIS TOOLS?
![Page 84: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/84.jpg)
BENEFITS OF CONTINUOUS INTEGRATION
QUICK FEEDBACK LOOP
![Page 85: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/85.jpg)
CODE REVIEW & CONTINUOUS INTEGRATION RECAP
![Page 86: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/86.jpg)
BRANCHING STRATEGIES
![Page 87: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/87.jpg)
IDEAL PROCESS
ESSENTIAL - CODE CAN ONLY BE DEPLOYED IF:
▸CI passes
▸Code review passes
![Page 88: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/88.jpg)
IDEAL PROCESS
IDEALLY - OTHERS ONLY DEVELOP WITH CODE THAT:
▸CI passes
▸Code review passes
![Page 89: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/89.jpg)
PULL REQUESTS
![Page 90: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/90.jpg)
PULL REQUEST METHOD
Master branch Feature branch
![Page 91: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/91.jpg)
PULL REQUEST METHOD
Master branch Pull Request (PR) based on Feature branch
CI pass
Code review sign off
![Page 92: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/92.jpg)
PULL REQUEST METHOD
Master branch
CI pass
Code review sign off
![Page 93: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/93.jpg)
PULL REQUEST METHOD
Master branch
CI fails
OR
Code review not signed off
![Page 94: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/94.jpg)
PULL REQUEST METHOD
Master branch
CI fails
OR
Code review not signed off
X X
![Page 95: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/95.jpg)
PULL REQUEST METHOD
Master branch
![Page 96: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/96.jpg)
PULL REQUEST METHOD
Master branch
![Page 97: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/97.jpg)
PULL REQUEST METHOD
Master branch
![Page 98: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/98.jpg)
PULL REQUEST METHOD
Master branch
![Page 99: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/99.jpg)
PULL REQUEST METHOD
Master branch
X X
![Page 100: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/100.jpg)
PULL REQUEST METHOD
Master branch
![Page 101: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/101.jpg)
PULL REQUEST METHOD
Master branch
![Page 102: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/102.jpg)
PULL REQUEST METHOD
Master branch
![Page 103: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/103.jpg)
LET’S SET THIS UP
![Page 104: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/104.jpg)
LET’S SET THIS UPPS It’s really easy
![Page 105: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/105.jpg)
THE PROCESS IS IMPORTANT NOT THE TOOLS
![Page 106: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/106.jpg)
GITHUB
![Page 107: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/107.jpg)
SETUP GITHUB
![Page 108: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/108.jpg)
SETUP GITHUB
![Page 109: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/109.jpg)
SETUP GITHUB
![Page 110: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/110.jpg)
SETUP GITHUB
![Page 111: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/111.jpg)
SETUP GITHUB
![Page 112: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/112.jpg)
SETUP GITHUB
![Page 113: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/113.jpg)
SETUP GITHUB
![Page 114: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/114.jpg)
SETUP GITHUB
![Page 115: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/115.jpg)
SETUP GITHUB
![Page 116: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/116.jpg)
SETUP GITHUB
![Page 117: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/117.jpg)
SETUP GITHUB
![Page 118: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/118.jpg)
SETUP GITHUB
![Page 119: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/119.jpg)
BITBUCKET
![Page 120: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/120.jpg)
SETUP BITBUCKET
![Page 121: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/121.jpg)
SETUP BITBUCKET
![Page 122: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/122.jpg)
SETUP BITBUCKET
![Page 123: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/123.jpg)
SETUP BITBUCKET
![Page 124: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/124.jpg)
SETUP BITBUCKET
![Page 125: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/125.jpg)
SETUP BITBUCKET
![Page 126: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/126.jpg)
SETUP BITBUCKET
![Page 127: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/127.jpg)
SETUP BITBUCKET
![Page 128: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/128.jpg)
SETUP BITBUCKET
![Page 129: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/129.jpg)
SETUP BITBUCKET
![Page 130: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/130.jpg)
SETUP BITBUCKET
![Page 131: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/131.jpg)
SETUP BITBUCKET
![Page 132: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/132.jpg)
SETUP BITBUCKET
![Page 133: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/133.jpg)
CIRCLE CI
![Page 134: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/134.jpg)
SETUP CIRCLE CI
![Page 135: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/135.jpg)
SETUP CIRCLE CI
![Page 136: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/136.jpg)
SETUP CIRCLE CI
![Page 137: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/137.jpg)
SETUP CIRCLE CI
![Page 138: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/138.jpg)
SETUP CIRCLE CI
![Page 139: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/139.jpg)
SETUP CIRCLE CI
![Page 140: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/140.jpg)
SETUP CIRCLE CI
![Page 141: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/141.jpg)
SETUP CIRCLE CI
![Page 142: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/142.jpg)
SETUP CIRCLE CI
![Page 143: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/143.jpg)
CIRCLE CI V1 OR V2
![Page 144: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/144.jpg)
CIRCLE.YML
![Page 145: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/145.jpg)
SETUP CIRCLE.YML
CIRCLE BUILD STAGES
▸ machine
▸ dependencies
▸ database
▸ compile
▸ test
▸ deploy
![Page 146: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/146.jpg)
SETUP CIRCLE.YML
STEPS WITHIN STAGE
▸ pre
▸ override
▸ post
![Page 147: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/147.jpg)
SETUP CIRCLE.YML
MACHINE
machine: timezone: Europe/London php: version: 5.6.22 environment: COMPOSER_CACHE_DIR: ~/.cache/composer
![Page 148: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/148.jpg)
SETUP CIRCLE.YML
MACHINE
machine: timezone: Europe/London php: version: 5.6.22 environment: COMPOSER_CACHE_DIR: ~/.cache/composer
![Page 149: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/149.jpg)
SETUP CIRCLE.YML
MACHINE
machine: timezone: Europe/London php: version: 5.6.22 environment: COMPOSER_CACHE_DIR: ~/.cache/composer
![Page 150: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/150.jpg)
SETUP CIRCLE.YML
MACHINE
machine: timezone: Europe/London php: version: 5.6.22 environment: COMPOSER_CACHE_DIR: ~/.cache/composer
![Page 151: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/151.jpg)
SETUP CIRCLE.YML
DEPENDENCIES
dependencies: cache_directories: - "~/.cache/composer" pre: - echo "date.timezone = Europe/London" >> \ /opt/circleci/php/$(phpenv global)/etc/php.ini
![Page 152: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/152.jpg)
SETUP CIRCLE.YML
DEPENDENCIES
dependencies: cache_directories: - "~/.cache/composer" pre: - echo "date.timezone = Europe/London" >> \ /opt/circleci/php/$(phpenv global)/etc/php.ini
![Page 153: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/153.jpg)
SETUP CIRCLE.YML
DEPENDENCIES
dependencies: cache_directories: - "~/.cache/composer" pre: - echo "date.timezone = Europe/London" >> \ /opt/circleci/php/$(phpenv global)/etc/php.ini
![Page 154: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/154.jpg)
SETUP CIRCLE.YML
DEPENDENCIES
dependencies: cache_directories: - "~/.cache/composer" pre: - echo "date.timezone = Europe/London" >> \ /opt/circleci/php/$(phpenv global)/etc/php.ini - cp app/config/parameters.yml.circle \ app/config/parameters.yml
![Page 155: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/155.jpg)
SETUP CIRCLE.YML
DATABASE
database: override: - mysql -u ubuntu -e "CREATE DATABASE testdb;" - createdb testdb2 - psql -c "CREATE EXTENSION postgis;" testdb2 - app/console doctrine:schema:create -—env=test
![Page 156: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/156.jpg)
SETUP CIRCLE.YML
DATABASE
database: override: - mysql -u ubuntu -e "CREATE DATABASE testdb;" - createdb testdb2 - psql -c "CREATE EXTENSION postgis;" testdb2 - app/console doctrine:schema:create -—env=test
![Page 157: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/157.jpg)
SETUP CIRCLE.YML
DATABASE
database: override: - mysql -u ubuntu -e "CREATE DATABASE testdb;" - createdb testdb2 - psql -c "CREATE EXTENSION postgis;" testdb2 - app/console doctrine:schema:create -—env=test
![Page 158: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/158.jpg)
SETUP CIRCLE.YML
DATABASE
database: override: - mysql -u ubuntu -e "CREATE DATABASE testdb;" - createdb testdb2 - psql -c "CREATE EXTENSION postgis;" testdb2 - app/console doctrine:schema:create -—env=test
![Page 159: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/159.jpg)
SETUP CIRCLE.YML
DATABASE
database: override: - mysql -u ubuntu -e "CREATE DATABASE testdb;" - createdb testdb2 - psql -c "CREATE EXTENSION postgis;" testdb2 - app/console doctrine:schema:create -—env=test
![Page 160: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/160.jpg)
SETUP CIRCLE.YML
COMPILE
compile: override: - bin/parallel-lint src - app/console lint:twig app - app/console lint:yaml app - bin/var-dump-check --no-colors src - bin/php-cs-fixer fix --dry-run src
![Page 161: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/161.jpg)
SETUP CIRCLE.YML
COMPILE
compile: override: - bin/parallel-lint src - app/console lint:twig app - app/console lint:yaml app - bin/var-dump-check --no-colors src - bin/php-cs-fixer fix --dry-run src
![Page 162: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/162.jpg)
SETUP CIRCLE.YML
TEST
test: pre: - mkdir -p $CIRCLE_TEST_REPORTS/phpunit override: - bin/phpunit -c app/phpunit.xml.dist \ -—log-junit $CIRCLE_TEST_REPORTS/phpunit/junit.xml \ -d memory_limit=512M
![Page 163: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/163.jpg)
SETUP CIRCLE.YML
TEST
test: pre: - mkdir -p $CIRCLE_TEST_REPORTS/phpunit override: - bin/phpunit -c app/phpunit.xml.dist \ -—log-junit $CIRCLE_TEST_REPORTS/phpunit/junit.xml \ -d memory_limit=512M
![Page 164: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/164.jpg)
SETUP CIRCLE.YML
TEST
test: pre: - mkdir -p $CIRCLE_TEST_REPORTS/phpunit override: - bin/phpunit -c app/phpunit.xml.dist \ -—log-junit $CIRCLE_TEST_REPORTS/phpunit/junit.xml \ -d memory_limit=512M
![Page 165: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/165.jpg)
SETUP CIRCLE.YML
TEST
test: pre: - mkdir -p $CIRCLE_TEST_REPORTS/phpunit override: - bin/phpunit -c app/phpunit.xml.dist \ -—log-junit $CIRCLE_TEST_REPORTS/phpunit/junit.xml \ -d memory_limit=512M
![Page 166: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/166.jpg)
SETUP CIRCLE.YML
DEPLOY
deployment: live: branch: master commands: - ssh [email protected] \ ”bash --login -c 'deploy "$CIRCLE_SHA1"'"
![Page 167: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/167.jpg)
SETUP CIRCLE.YML
DEPLOY
deployment: live: branch: master commands: - ssh [email protected] \ ”bash --login -c 'deploy "$CIRCLE_SHA1"'"
![Page 168: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/168.jpg)
SETUP CIRCLE.YML
DEPLOY
deployment: live: branch: master commands: - ssh [email protected] \ ”bash --login -c 'deploy "$CIRCLE_SHA1"'"
![Page 169: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/169.jpg)
SETUP CIRCLE.YML
DEPLOY
deployment: live: branch: master commands: - ssh [email protected] \ ”bash --login -c 'deploy "$CIRCLE_SHA1"'"
![Page 170: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/170.jpg)
SETUP CIRCLE.YML
DEPLOY
deployment: live: branch: master commands: - ssh [email protected] \ ”bash --login -c 'deploy "$CIRCLE_SHA1"'"
![Page 171: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/171.jpg)
SETUP CIRCLE.YML
DEPLOY
deployment: live: branch: master commands: - ssh [email protected] \ ”bash --login -c 'deploy "$CIRCLE_SHA1"'"
![Page 172: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/172.jpg)
WHEN YOU TRY THIS AT HOME
TIPS
![Page 173: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/173.jpg)
WHEN YOU TRY THIS AT HOME
TIPS
▸ https://github.com/DaveLiddament/circle_demo_project
▸ Branches called step-01, step-02, etc
![Page 174: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/174.jpg)
WHEN YOU TRY THIS AT HOME
TIPS
▸ https://github.com/DaveLiddament/circle_demo_project
▸ Branches called step-01, step-02, etc
▸ Build things up in steps.
▸ Run only unit tests first
▸ Then get integration tests running
![Page 175: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/175.jpg)
WHEN YOU TRY THIS AT HOME
TIPS
![Page 176: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/176.jpg)
WHEN YOU TRY THIS AT HOME
TIPS
![Page 177: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/177.jpg)
WRAP UP
SUMMARY
▸ Code review and CI done well reduce costs
▸ Fast feedback
▸ Fewer bugs
▸ Cleaner code (which means faster development)
▸ Quickly up skill new people to the project
▸ Tools today mean you can set up quickly
![Page 178: DAVE LIDDAMENT CODE REVIEW AND CONTINUOUS INTEGRATION · why code review and continuous integration types of bugs ... cost to develop similar sized feature over time. why do bugs](https://reader034.fdocuments.us/reader034/viewer/2022042803/5f4eef1b19badf3523203a07/html5/thumbnails/178.jpg)
QUESTIONS