Code Review and other aspects of project organization

Code Review
and other aspects of project organization – a case study of SAOS
(www.saos.org.pl)
Łukasz Dumiszewski, ICM, University of Warsaw, XI.2014
Plan of the presentation
 Code Review – theory
 Code Review in SAOS
 Conclusions
Duration: about 1h
Helpful knowledge: git, GitHub (at least superficial)
Code Review - definition
From wikipedia:
Code review is systematic examination (sometimes
referred to as peer review) of computer source code. It is
intended to find mistakes overlooked in the initial
development phase, improving the overall quality of
software.
Code Review – pros
 Fewer errors
 Better code design
 Code standardization (tests, comments)
 Code clarity (division into sections, sensible variable names, short
methods)
 Code and meaning of every module known to everyone
 Improvement of programming skills
 Better team collaboration
Code Review – cons
 Longer time of functionality delivery (but maybe it only seems so)
 Negative emotions (arguments, creator’s ego hurt)
 Revising someone else’s code may be dull/ frustrating
Code Review – different approaches
 Formal code review
 Lightweight code review
Code Review – formal
Formal code review
Meetings, line-by-line code inspection by the whole team
Pros:
Better code: cleaner, fewer errors, sensibly designed
Cons:
Takes long time, possible negative emotions
Code Review – lightweight
Lightweight code review
over-the-shoulder/ e-mail/ tool-assisted/ pair-programming
Pros:
Better code: cleaner, fewer errors, sensibly designed and takes less
time than the formal method
Cons:
Some time still needed, negative emotions can also appear
Code Review – good practices
Smart Bear
http://smartbear.com/SmartBear/media/pdfs/best-kept-secrets-of-peer-code-review.pdf
http://smartbear.com/SmartBear/media/pdfs/WP-CC-11-Best-Practices-of-Peer-Code-
Review.pdf
1. Review fewer than 200-400 lines of code at a time
2. Aim for your inspection rate of less than 300-500 LOC/hour
3. Take enough time for a proper, slow review, but not more than 60-90 minutes.
4. Authors should annotate source code before the review begins.
5. Establish quantifiable goals for code review and capture metrics so you can improve your
processes.
6. Checklists substantially improve results for both authors and reviewers.
7. Verify that defects are actually fixed!
8. Managers must foster a good code review culture in which finding defects is viewed
positively.
9. Beware the “Big Brother” effect.
10. The Ego Effect: Do at least some code review, even if you don’t have time to review it all
11. Lightweight-style code reviews are efficient, practical, and effective at finding bugs.
Code Review in SAOS – what is SAOS?
SAOS is an online Polish Court Judgment Analysis System that
gathers judgment data from different indpendent court
applications, and allows for searching, browsing and analysing
the data through the web user interface or RESTful API.
See:
www.saos.org.pl
www.github.com/CeON/saos
Code Review in SAOS – motivation
 Pluses as mentioned before
 Wish to familiarize ourselves with CR practices
 Wish to see if it really works
Code Review in SAOS – technique
 Methodology: Scrum
 Approach: Lightweight / tool-assisted /
 Tool: GitHub pull requests
Scrum methodology – short definition
Iterative and incremental agile methodology of
managing product development.
In this methodology the development of a product is
divided into smaller consecutive iterations; lasting
max one month, called sprints.
The Scrum methodology in SAOS
 One week sprints
 Daily scrum meetings
 Summing up the previous day
 Plans for the next
 Weekly sprint meeting
 Summing up the sprint
 Choosing tasks for the next week
 Assigning CR partners to one another
The Scrum methodology in SAOS – details
 Tasks and sprints are GitHub’s issues and milestones
 Each task takes max 2 days
 While planning a sprint the time for the Code Review (20%) is
taken into account
 Code Review has the highest priority (so the colleague
doesn’t have to wait)
 Every task must pass the Code Review
The 4 lasts points are preconditions of successful CR
Lightweight CR in SAOS – core principles
 There is not ‘commit’ without CR
 Rotation of CR partners
 CR has the highest priority
 One CR for one task
 And… we take it seriously
Lightweight CR in SAOS in practice
1. Review fewer than 200-400 lines of code at a time
One CR for one task and each task is short (no more than 2 days)
2. Aim for your inspection rate of less than 300-500 LOC/hour
Depends on the programmer, generally met.
3. Take enough time for a proper, slow review, but not more than 60-90
minutes.
20% of time devoted to CR.
4. Authors should annotate source code before the review begins.
We don’t do it.
5. Establish quantifiable goals for code review and capture metrics so you can
improve your processes.
We don’t do it. Better tool needed.
6. Checklists substantially improve results for both authors and reviewers.
https://github.com/CeON/saos/wiki/Code-review#the-code-review-
common-checklist
Lightweight CR in SAOS – in practice cont.
7. Verify that defects are actually fixed!
Met. A task is not accepted until all remarks are closed.
8. Managers must foster a good code review culture in which finding defects is
viewed positively.
CR is just one of the tasks. Finding bugs is considered to be a positive
characteristic, every bug corrected is one step to closer to perfection. They who
make not mistakes make nothing 
9. Beware the “Big Brother” effect.
We know each other’s skills. This is a code review and not a code writer review.
10. The Ego Effect: Do at least some code review, even if you don’t have time to
review it all
More time devoted to code clarity, checking the test coverage.
11. Lightweight-style code reviews are efficient, practical, and effective at
finding bugs.
Some bugs avoided. More in the conclusion.
GitHub pull requests - definition
GitHub functionality that allows to compare and see the
code differences between two branches or repositories.
Main features:
 Preview of changes (all or a selected commit)
 Commenting on changes
 Statuses (closed, open)
GitHub pull requests - approaches
 Fork repository model
A programmer works on a cloned repo. They are not permitted to
make changes in the main repo – some designated people may do
this.
OK for large teams or open-source projects.
 Shared repository model
Everybody works directly on the main repo. New functionalities are
developed on separate branches.
OK for small teams.
GitHub pull requests – fork repository model
Repo
Repo
clone
Local
Repo
LOCAL
Pull Request
REMOTE
(gitHub)
Pull
Pull/ Push
GitHub pull requests – shared repo model
Description of this process: https://github.com/CeON/saos/wiki/Code-review
LOCAL
Pull Request
REMOTE
(gitHub)
Push
master feature
master feature
Repo
Repo
1
2
3
4
5
6
Code Review in SAOS - observations
 CR only makes sense if the team treats it as part of its
responsibilites (motivation, strict rules)
 CR takes time, about 20%, 1 day a week
 Minor problems with starting a new task can occur if the task is
related to another one just passed to CR
 To a high degree CR relies on a reviewer’s skills, their knowledge of
a given domain.
 Tasks have to be short (we decreased the max time for a task from
original 3 to 2 days, to make it shorter and thus easier to revise)
Code Review w SAOS – observations cont.
 No significant problems related to negative emotions occurred.
Some positive ones have: „I have learned something new”, „I didn’t
know you can do it this way” or „It’s good to know somebody will
take a look at this.”
 The pros listed at the beginning of the presentation proved to be
true. In particular: code standardization, observance of rules
(writing tests etc.), familiarity of each programmer with the whole
code.
Code Review in SAOS – observations cont.
 The time devoted to CR has not been wasted, it has paid off
(cleaner, faster & easier to extend and more reliable code;
programmers know the whole system)
 In the longer term CR has had very positive influence on the
team collaboration and programmers’ skills.
1 of 25

Recommended

Peer Code Review An Agile Process by
Peer Code Review An Agile ProcessPeer Code Review An Agile Process
Peer Code Review An Agile Processgsporar
8.7K views71 slides
Code review in practice by
Code review in practiceCode review in practice
Code review in practiceEdorian
1.9K views157 slides
11 best practices_for_peer_code_review by
11 best practices_for_peer_code_review11 best practices_for_peer_code_review
11 best practices_for_peer_code_reviewSmartBear Software
962 views12 slides
Agile code quality metrics by
Agile code quality metricsAgile code quality metrics
Agile code quality metricsGil Nahmias
10K views12 slides
Code review process with JetBrains UpSource by
Code review process with JetBrains UpSourceCode review process with JetBrains UpSource
Code review process with JetBrains UpSourceOleksii Prohonnyi
2.7K views19 slides
Code Review: How and When by
Code Review: How and WhenCode Review: How and When
Code Review: How and WhenPaul Gower
326 views76 slides

More Related Content

What's hot

Static Analysis of Your OSS Project with Coverity by
Static Analysis of Your OSS Project with CoverityStatic Analysis of Your OSS Project with Coverity
Static Analysis of Your OSS Project with CoveritySamsung Open Source Group
1.7K views41 slides
[India Merge World Tour] Coverity by
[India Merge World Tour] Coverity[India Merge World Tour] Coverity
[India Merge World Tour] CoverityPerforce
659 views35 slides
Slides for Houston iPhone Developers' Meetup (April 2012) by
Slides for Houston iPhone Developers' Meetup (April 2012)Slides for Houston iPhone Developers' Meetup (April 2012)
Slides for Houston iPhone Developers' Meetup (April 2012)lqi
396 views30 slides
How To Improve Quality With Static Code Analysis by
How To Improve Quality With Static Code Analysis How To Improve Quality With Static Code Analysis
How To Improve Quality With Static Code Analysis Perforce
892 views29 slides
Code Review: How and When by
Code Review: How and WhenCode Review: How and When
Code Review: How and WhenPaul Gower
687 views77 slides
Automating good coding practices by
Automating good coding practicesAutomating good coding practices
Automating good coding practicesKevin Peterson
1.5K views42 slides

What's hot(20)

[India Merge World Tour] Coverity by Perforce
[India Merge World Tour] Coverity[India Merge World Tour] Coverity
[India Merge World Tour] Coverity
Perforce659 views
Slides for Houston iPhone Developers' Meetup (April 2012) by lqi
Slides for Houston iPhone Developers' Meetup (April 2012)Slides for Houston iPhone Developers' Meetup (April 2012)
Slides for Houston iPhone Developers' Meetup (April 2012)
lqi396 views
How To Improve Quality With Static Code Analysis by Perforce
How To Improve Quality With Static Code Analysis How To Improve Quality With Static Code Analysis
How To Improve Quality With Static Code Analysis
Perforce892 views
Code Review: How and When by Paul Gower
Code Review: How and WhenCode Review: How and When
Code Review: How and When
Paul Gower687 views
Automating good coding practices by Kevin Peterson
Automating good coding practicesAutomating good coding practices
Automating good coding practices
Kevin Peterson1.5K views
Agile Austin - Peer Code Review An Agile Process by gsporar
Agile Austin -  Peer Code Review An Agile ProcessAgile Austin -  Peer Code Review An Agile Process
Agile Austin - Peer Code Review An Agile Process
gsporar1.8K views
Agile principles and practices by Vipin Jose
Agile principles and practicesAgile principles and practices
Agile principles and practices
Vipin Jose306 views
Test driven development_continuous_integration by haochenglee
Test driven development_continuous_integrationTest driven development_continuous_integration
Test driven development_continuous_integration
haochenglee3.6K views
A new Codemodel for Codemetrics by Max Kleiner
 A new Codemodel for Codemetrics A new Codemodel for Codemetrics
A new Codemodel for Codemetrics
Max Kleiner244 views
Code Review for Teams Too Busy to Review Code - Atlassian Summit 2010 by Atlassian
Code Review for Teams Too Busy to Review Code - Atlassian Summit 2010Code Review for Teams Too Busy to Review Code - Atlassian Summit 2010
Code Review for Teams Too Busy to Review Code - Atlassian Summit 2010
Atlassian2.8K views
Solving the 3 Biggest Questions in Continuous Testing by Perfecto by Perforce
Solving the 3 Biggest Questions in Continuous TestingSolving the 3 Biggest Questions in Continuous Testing
Solving the 3 Biggest Questions in Continuous Testing
Joe Cisar - Everything I Know About TDD - Agile Midwest 2019 by Jason Tice
Joe Cisar - Everything I Know About TDD - Agile Midwest 2019Joe Cisar - Everything I Know About TDD - Agile Midwest 2019
Joe Cisar - Everything I Know About TDD - Agile Midwest 2019
Jason Tice132 views
DDT Testing Library for Android by Ahmed Misbah
DDT Testing Library for AndroidDDT Testing Library for Android
DDT Testing Library for Android
Ahmed Misbah129 views
Agile vs. DevOps for Continuous Testing: How to Optimize Your Pipeline by Perfecto by Perforce
Agile vs. DevOps for Continuous Testing: How to Optimize Your PipelineAgile vs. DevOps for Continuous Testing: How to Optimize Your Pipeline
Agile vs. DevOps for Continuous Testing: How to Optimize Your Pipeline
SCA in an Agile World | June 2010 by Klocwork
SCA in an Agile World | June 2010SCA in an Agile World | June 2010
SCA in an Agile World | June 2010
Klocwork636 views

Viewers also liked

Programming in Spark - Lessons Learned in OpenAire project by
Programming in Spark - Lessons Learned in OpenAire projectProgramming in Spark - Lessons Learned in OpenAire project
Programming in Spark - Lessons Learned in OpenAire projectŁukasz Dumiszewski
355 views17 slides
df: Dataframe on Spark by
df: Dataframe on Sparkdf: Dataframe on Spark
df: Dataframe on SparkAlpine Data
3.3K views20 slides
Apache Spark Core by
Apache Spark CoreApache Spark Core
Apache Spark CoreGirish Khanzode
2.9K views100 slides
Spark Scala project by
Spark Scala project Spark Scala project
Spark Scala project Utkarsh Jadhav
335 views12 slides
Elaboration on world war 2 by
Elaboration on world war 2Elaboration on world war 2
Elaboration on world war 2gilani syeda
977 views37 slides
Variance in scala by
Variance in scalaVariance in scala
Variance in scalaLyleK
579 views44 slides

Viewers also liked(20)

Programming in Spark - Lessons Learned in OpenAire project by Łukasz Dumiszewski
Programming in Spark - Lessons Learned in OpenAire projectProgramming in Spark - Lessons Learned in OpenAire project
Programming in Spark - Lessons Learned in OpenAire project
df: Dataframe on Spark by Alpine Data
df: Dataframe on Sparkdf: Dataframe on Spark
df: Dataframe on Spark
Alpine Data3.3K views
Elaboration on world war 2 by gilani syeda
Elaboration on world war 2Elaboration on world war 2
Elaboration on world war 2
gilani syeda977 views
Variance in scala by LyleK
Variance in scalaVariance in scala
Variance in scala
LyleK579 views
Types by Adform Research, Saulius Valatka by Vasil Remeniuk
Types by Adform Research, Saulius ValatkaTypes by Adform Research, Saulius Valatka
Types by Adform Research, Saulius Valatka
Vasil Remeniuk730 views
Python in real world. by Alph@.M
Python in real world.Python in real world.
Python in real world.
Alph@.M1.4K views
Spark & Cassandra at DataStax Meetup on Jan 29, 2015 by Sameer Farooqui
Spark & Cassandra at DataStax Meetup on Jan 29, 2015 Spark & Cassandra at DataStax Meetup on Jan 29, 2015
Spark & Cassandra at DataStax Meetup on Jan 29, 2015
Sameer Farooqui3.9K views
Telco analytics at scale by datamantra
Telco analytics at scaleTelco analytics at scale
Telco analytics at scale
datamantra992 views
Introduction to Spark Training by Spark Summit
Introduction to Spark TrainingIntroduction to Spark Training
Introduction to Spark Training
Spark Summit1.4K views
Python programming - Everyday(ish) Examples by Ashish Sharma
Python programming - Everyday(ish) ExamplesPython programming - Everyday(ish) Examples
Python programming - Everyday(ish) Examples
Ashish Sharma1.5K views
Learning spark ch06 - Advanced Spark Programming by phanleson
Learning spark ch06 - Advanced Spark ProgrammingLearning spark ch06 - Advanced Spark Programming
Learning spark ch06 - Advanced Spark Programming
phanleson509 views
Neo, Titan & Cassandra by johnrjenson
Neo, Titan & CassandraNeo, Titan & Cassandra
Neo, Titan & Cassandra
johnrjenson4.7K views
казка про кошеня by larisa1987
казка про кошеняказка про кошеня
казка про кошеня
larisa1987104 views
чудеса світу by larisa1987
чудеса світучудеса світу
чудеса світу
larisa1987156 views

Similar to Code Review and other aspects of project organization

Code Review by
Code ReviewCode Review
Code ReviewRavi Raj
2.9K views30 slides
Automated Code Reviews with AI and ML - DevOps Next by
Automated Code Reviews with AI and ML - DevOps NextAutomated Code Reviews with AI and ML - DevOps Next
Automated Code Reviews with AI and ML - DevOps NextPerfecto by Perforce
263 views23 slides
Software Defect Prevention via Continuous Inspection by
Software Defect Prevention via Continuous InspectionSoftware Defect Prevention via Continuous Inspection
Software Defect Prevention via Continuous InspectionJosh Gough
1.6K views49 slides
Code review best practice by
Code review best practiceCode review best practice
Code review best practiceOren Digmi
120 views28 slides
Code review by
Code reviewCode review
Code reviewdqpi
2K views19 slides
Xen Project Contributor Training - Part 1 introduction v1.0 by
Xen Project Contributor Training - Part 1 introduction v1.0Xen Project Contributor Training - Part 1 introduction v1.0
Xen Project Contributor Training - Part 1 introduction v1.0The Linux Foundation
12.3K views48 slides

Similar to Code Review and other aspects of project organization(20)

Code Review by Ravi Raj
Code ReviewCode Review
Code Review
Ravi Raj2.9K views
Software Defect Prevention via Continuous Inspection by Josh Gough
Software Defect Prevention via Continuous InspectionSoftware Defect Prevention via Continuous Inspection
Software Defect Prevention via Continuous Inspection
Josh Gough1.6K views
Code review best practice by Oren Digmi
Code review best practiceCode review best practice
Code review best practice
Oren Digmi120 views
Code review by dqpi
Code reviewCode review
Code review
dqpi2K views
Xen Project Contributor Training - Part 1 introduction v1.0 by The Linux Foundation
Xen Project Contributor Training - Part 1 introduction v1.0Xen Project Contributor Training - Part 1 introduction v1.0
Xen Project Contributor Training - Part 1 introduction v1.0
The Linux Foundation12.3K views
Code-Review-Principles-Process-and-Tools (1) by Aditya Bhuyan
Code-Review-Principles-Process-and-Tools (1)Code-Review-Principles-Process-and-Tools (1)
Code-Review-Principles-Process-and-Tools (1)
Aditya Bhuyan1.1K views
It's all about feedback - code review as a great tool in the agile toolbox by Stefan Lay
It's all about feedback - code review as a great tool in the agile toolboxIt's all about feedback - code review as a great tool in the agile toolbox
It's all about feedback - code review as a great tool in the agile toolbox
Stefan Lay2.5K views
Problems of testing 64-bit applications by PVS-Studio
Problems of testing 64-bit applicationsProblems of testing 64-bit applications
Problems of testing 64-bit applications
PVS-Studio481 views
Improving Code Quality In Medical Software Through Code Reviews - Vincit Teat... by VincitOy
Improving Code Quality In Medical Software Through Code Reviews - Vincit Teat...Improving Code Quality In Medical Software Through Code Reviews - Vincit Teat...
Improving Code Quality In Medical Software Through Code Reviews - Vincit Teat...
VincitOy1.6K views
Agile_SDLC_Node.js@Paypal_ppt by Hitesh Kumar
Agile_SDLC_Node.js@Paypal_pptAgile_SDLC_Node.js@Paypal_ppt
Agile_SDLC_Node.js@Paypal_ppt
Hitesh Kumar404 views
CODE REVIEW AND COOPERATIVE PAIR PROGRAMMING BEST PRACTICE by ijseajournal
CODE REVIEW AND COOPERATIVE PAIR PROGRAMMING BEST PRACTICECODE REVIEW AND COOPERATIVE PAIR PROGRAMMING BEST PRACTICE
CODE REVIEW AND COOPERATIVE PAIR PROGRAMMING BEST PRACTICE
ijseajournal51 views
Traps detection during migration of C and C++ code to 64-bit Windows by PVS-Studio
Traps detection during migration of C and C++ code to 64-bit WindowsTraps detection during migration of C and C++ code to 64-bit Windows
Traps detection during migration of C and C++ code to 64-bit Windows
PVS-Studio718 views
Testers in product development code review phase by Chetan Giridhar
Testers in product development   code review phaseTesters in product development   code review phase
Testers in product development code review phase
Chetan Giridhar786 views
Software Development Standard Operating Procedure by rupeshchanchal
Software Development Standard Operating Procedure Software Development Standard Operating Procedure
Software Development Standard Operating Procedure
rupeshchanchal2.4K views
Measuring Your Code by Nate Abele
Measuring Your CodeMeasuring Your Code
Measuring Your Code
Nate Abele1.6K views

Recently uploaded

DSD-INT 2023 Baseline studies for Strategic Coastal protection for Long Islan... by
DSD-INT 2023 Baseline studies for Strategic Coastal protection for Long Islan...DSD-INT 2023 Baseline studies for Strategic Coastal protection for Long Islan...
DSD-INT 2023 Baseline studies for Strategic Coastal protection for Long Islan...Deltares
10 views30 slides
Citi TechTalk Session 2: Kafka Deep Dive by
Citi TechTalk Session 2: Kafka Deep DiveCiti TechTalk Session 2: Kafka Deep Dive
Citi TechTalk Session 2: Kafka Deep Diveconfluent
17 views60 slides
DSD-INT 2023 Dam break simulation in Derna (Libya) using HydroMT_SFINCS - Prida by
DSD-INT 2023 Dam break simulation in Derna (Libya) using HydroMT_SFINCS - PridaDSD-INT 2023 Dam break simulation in Derna (Libya) using HydroMT_SFINCS - Prida
DSD-INT 2023 Dam break simulation in Derna (Libya) using HydroMT_SFINCS - PridaDeltares
17 views9 slides
DSD-INT 2023 3D hydrodynamic modelling of microplastic transport in lakes - J... by
DSD-INT 2023 3D hydrodynamic modelling of microplastic transport in lakes - J...DSD-INT 2023 3D hydrodynamic modelling of microplastic transport in lakes - J...
DSD-INT 2023 3D hydrodynamic modelling of microplastic transport in lakes - J...Deltares
7 views24 slides
DSD-INT 2023 - Delft3D User Days - Welcome - Day 3 - Afternoon by
DSD-INT 2023 - Delft3D User Days - Welcome - Day 3 - AfternoonDSD-INT 2023 - Delft3D User Days - Welcome - Day 3 - Afternoon
DSD-INT 2023 - Delft3D User Days - Welcome - Day 3 - AfternoonDeltares
11 views43 slides
SAP FOR CONTRACT MANUFACTURING.pdf by
SAP FOR CONTRACT MANUFACTURING.pdfSAP FOR CONTRACT MANUFACTURING.pdf
SAP FOR CONTRACT MANUFACTURING.pdfVirendra Rai, PMP
11 views2 slides

Recently uploaded(20)

DSD-INT 2023 Baseline studies for Strategic Coastal protection for Long Islan... by Deltares
DSD-INT 2023 Baseline studies for Strategic Coastal protection for Long Islan...DSD-INT 2023 Baseline studies for Strategic Coastal protection for Long Islan...
DSD-INT 2023 Baseline studies for Strategic Coastal protection for Long Islan...
Deltares10 views
Citi TechTalk Session 2: Kafka Deep Dive by confluent
Citi TechTalk Session 2: Kafka Deep DiveCiti TechTalk Session 2: Kafka Deep Dive
Citi TechTalk Session 2: Kafka Deep Dive
confluent17 views
DSD-INT 2023 Dam break simulation in Derna (Libya) using HydroMT_SFINCS - Prida by Deltares
DSD-INT 2023 Dam break simulation in Derna (Libya) using HydroMT_SFINCS - PridaDSD-INT 2023 Dam break simulation in Derna (Libya) using HydroMT_SFINCS - Prida
DSD-INT 2023 Dam break simulation in Derna (Libya) using HydroMT_SFINCS - Prida
Deltares17 views
DSD-INT 2023 3D hydrodynamic modelling of microplastic transport in lakes - J... by Deltares
DSD-INT 2023 3D hydrodynamic modelling of microplastic transport in lakes - J...DSD-INT 2023 3D hydrodynamic modelling of microplastic transport in lakes - J...
DSD-INT 2023 3D hydrodynamic modelling of microplastic transport in lakes - J...
Deltares7 views
DSD-INT 2023 - Delft3D User Days - Welcome - Day 3 - Afternoon by Deltares
DSD-INT 2023 - Delft3D User Days - Welcome - Day 3 - AfternoonDSD-INT 2023 - Delft3D User Days - Welcome - Day 3 - Afternoon
DSD-INT 2023 - Delft3D User Days - Welcome - Day 3 - Afternoon
Deltares11 views
DSD-INT 2023 Simulation of Coastal Hydrodynamics and Water Quality in Hong Ko... by Deltares
DSD-INT 2023 Simulation of Coastal Hydrodynamics and Water Quality in Hong Ko...DSD-INT 2023 Simulation of Coastal Hydrodynamics and Water Quality in Hong Ko...
DSD-INT 2023 Simulation of Coastal Hydrodynamics and Water Quality in Hong Ko...
Deltares10 views
Consulting for Data Monetization Maximizing the Profit Potential of Your Data... by Flexsin
Consulting for Data Monetization Maximizing the Profit Potential of Your Data...Consulting for Data Monetization Maximizing the Profit Potential of Your Data...
Consulting for Data Monetization Maximizing the Profit Potential of Your Data...
Flexsin 15 views
Upgrading Incident Management with Icinga - Icinga Camp Milan 2023 by Icinga
Upgrading Incident Management with Icinga - Icinga Camp Milan 2023Upgrading Incident Management with Icinga - Icinga Camp Milan 2023
Upgrading Incident Management with Icinga - Icinga Camp Milan 2023
Icinga36 views
Advanced API Mocking Techniques by Dimpy Adhikary
Advanced API Mocking TechniquesAdvanced API Mocking Techniques
Advanced API Mocking Techniques
Dimpy Adhikary18 views
Cycleops - Automate deployments on top of bare metal.pptx by Thanassis Parathyras
Cycleops - Automate deployments on top of bare metal.pptxCycleops - Automate deployments on top of bare metal.pptx
Cycleops - Automate deployments on top of bare metal.pptx
2023-November-Schneider Electric-Meetup-BCN Admin Group.pptx by animuscrm
2023-November-Schneider Electric-Meetup-BCN Admin Group.pptx2023-November-Schneider Electric-Meetup-BCN Admin Group.pptx
2023-November-Schneider Electric-Meetup-BCN Admin Group.pptx
animuscrm11 views
El Arte de lo Possible by Neo4j
El Arte de lo PossibleEl Arte de lo Possible
El Arte de lo Possible
Neo4j34 views
Elevate your SAP landscape's efficiency and performance with HCL Workload Aut... by HCLSoftware
Elevate your SAP landscape's efficiency and performance with HCL Workload Aut...Elevate your SAP landscape's efficiency and performance with HCL Workload Aut...
Elevate your SAP landscape's efficiency and performance with HCL Workload Aut...
HCLSoftware6 views
DSD-INT 2023 Simulating a falling apron in Delft3D 4 - Engineering Practice -... by Deltares
DSD-INT 2023 Simulating a falling apron in Delft3D 4 - Engineering Practice -...DSD-INT 2023 Simulating a falling apron in Delft3D 4 - Engineering Practice -...
DSD-INT 2023 Simulating a falling apron in Delft3D 4 - Engineering Practice -...
Deltares6 views
DSD-INT 2023 HydroMT model building and river-coast coupling in Python - Bove... by Deltares
DSD-INT 2023 HydroMT model building and river-coast coupling in Python - Bove...DSD-INT 2023 HydroMT model building and river-coast coupling in Python - Bove...
DSD-INT 2023 HydroMT model building and river-coast coupling in Python - Bove...
Deltares15 views
Neo4j y GenAI by Neo4j
Neo4j y GenAI Neo4j y GenAI
Neo4j y GenAI
Neo4j35 views
Geospatial Synergy: Amplifying Efficiency with FME & Esri ft. Peak Guest Spea... by Safe Software
Geospatial Synergy: Amplifying Efficiency with FME & Esri ft. Peak Guest Spea...Geospatial Synergy: Amplifying Efficiency with FME & Esri ft. Peak Guest Spea...
Geospatial Synergy: Amplifying Efficiency with FME & Esri ft. Peak Guest Spea...
Safe Software391 views
DSD-INT 2023 Delft3D FM Suite 2024.01 2D3D - New features + Improvements - Ge... by Deltares
DSD-INT 2023 Delft3D FM Suite 2024.01 2D3D - New features + Improvements - Ge...DSD-INT 2023 Delft3D FM Suite 2024.01 2D3D - New features + Improvements - Ge...
DSD-INT 2023 Delft3D FM Suite 2024.01 2D3D - New features + Improvements - Ge...
Deltares16 views

Code Review and other aspects of project organization

  • 1. Code Review and other aspects of project organization – a case study of SAOS (www.saos.org.pl) Łukasz Dumiszewski, ICM, University of Warsaw, XI.2014
  • 2. Plan of the presentation  Code Review – theory  Code Review in SAOS  Conclusions Duration: about 1h Helpful knowledge: git, GitHub (at least superficial)
  • 3. Code Review - definition From wikipedia: Code review is systematic examination (sometimes referred to as peer review) of computer source code. It is intended to find mistakes overlooked in the initial development phase, improving the overall quality of software.
  • 4. Code Review – pros  Fewer errors  Better code design  Code standardization (tests, comments)  Code clarity (division into sections, sensible variable names, short methods)  Code and meaning of every module known to everyone  Improvement of programming skills  Better team collaboration
  • 5. Code Review – cons  Longer time of functionality delivery (but maybe it only seems so)  Negative emotions (arguments, creator’s ego hurt)  Revising someone else’s code may be dull/ frustrating
  • 6. Code Review – different approaches  Formal code review  Lightweight code review
  • 7. Code Review – formal Formal code review Meetings, line-by-line code inspection by the whole team Pros: Better code: cleaner, fewer errors, sensibly designed Cons: Takes long time, possible negative emotions
  • 8. Code Review – lightweight Lightweight code review over-the-shoulder/ e-mail/ tool-assisted/ pair-programming Pros: Better code: cleaner, fewer errors, sensibly designed and takes less time than the formal method Cons: Some time still needed, negative emotions can also appear
  • 9. Code Review – good practices Smart Bear http://smartbear.com/SmartBear/media/pdfs/best-kept-secrets-of-peer-code-review.pdf http://smartbear.com/SmartBear/media/pdfs/WP-CC-11-Best-Practices-of-Peer-Code- Review.pdf 1. Review fewer than 200-400 lines of code at a time 2. Aim for your inspection rate of less than 300-500 LOC/hour 3. Take enough time for a proper, slow review, but not more than 60-90 minutes. 4. Authors should annotate source code before the review begins. 5. Establish quantifiable goals for code review and capture metrics so you can improve your processes. 6. Checklists substantially improve results for both authors and reviewers. 7. Verify that defects are actually fixed! 8. Managers must foster a good code review culture in which finding defects is viewed positively. 9. Beware the “Big Brother” effect. 10. The Ego Effect: Do at least some code review, even if you don’t have time to review it all 11. Lightweight-style code reviews are efficient, practical, and effective at finding bugs.
  • 10. Code Review in SAOS – what is SAOS? SAOS is an online Polish Court Judgment Analysis System that gathers judgment data from different indpendent court applications, and allows for searching, browsing and analysing the data through the web user interface or RESTful API. See: www.saos.org.pl www.github.com/CeON/saos
  • 11. Code Review in SAOS – motivation  Pluses as mentioned before  Wish to familiarize ourselves with CR practices  Wish to see if it really works
  • 12. Code Review in SAOS – technique  Methodology: Scrum  Approach: Lightweight / tool-assisted /  Tool: GitHub pull requests
  • 13. Scrum methodology – short definition Iterative and incremental agile methodology of managing product development. In this methodology the development of a product is divided into smaller consecutive iterations; lasting max one month, called sprints.
  • 14. The Scrum methodology in SAOS  One week sprints  Daily scrum meetings  Summing up the previous day  Plans for the next  Weekly sprint meeting  Summing up the sprint  Choosing tasks for the next week  Assigning CR partners to one another
  • 15. The Scrum methodology in SAOS – details  Tasks and sprints are GitHub’s issues and milestones  Each task takes max 2 days  While planning a sprint the time for the Code Review (20%) is taken into account  Code Review has the highest priority (so the colleague doesn’t have to wait)  Every task must pass the Code Review The 4 lasts points are preconditions of successful CR
  • 16. Lightweight CR in SAOS – core principles  There is not ‘commit’ without CR  Rotation of CR partners  CR has the highest priority  One CR for one task  And… we take it seriously
  • 17. Lightweight CR in SAOS in practice 1. Review fewer than 200-400 lines of code at a time One CR for one task and each task is short (no more than 2 days) 2. Aim for your inspection rate of less than 300-500 LOC/hour Depends on the programmer, generally met. 3. Take enough time for a proper, slow review, but not more than 60-90 minutes. 20% of time devoted to CR. 4. Authors should annotate source code before the review begins. We don’t do it. 5. Establish quantifiable goals for code review and capture metrics so you can improve your processes. We don’t do it. Better tool needed. 6. Checklists substantially improve results for both authors and reviewers. https://github.com/CeON/saos/wiki/Code-review#the-code-review- common-checklist
  • 18. Lightweight CR in SAOS – in practice cont. 7. Verify that defects are actually fixed! Met. A task is not accepted until all remarks are closed. 8. Managers must foster a good code review culture in which finding defects is viewed positively. CR is just one of the tasks. Finding bugs is considered to be a positive characteristic, every bug corrected is one step to closer to perfection. They who make not mistakes make nothing  9. Beware the “Big Brother” effect. We know each other’s skills. This is a code review and not a code writer review. 10. The Ego Effect: Do at least some code review, even if you don’t have time to review it all More time devoted to code clarity, checking the test coverage. 11. Lightweight-style code reviews are efficient, practical, and effective at finding bugs. Some bugs avoided. More in the conclusion.
  • 19. GitHub pull requests - definition GitHub functionality that allows to compare and see the code differences between two branches or repositories. Main features:  Preview of changes (all or a selected commit)  Commenting on changes  Statuses (closed, open)
  • 20. GitHub pull requests - approaches  Fork repository model A programmer works on a cloned repo. They are not permitted to make changes in the main repo – some designated people may do this. OK for large teams or open-source projects.  Shared repository model Everybody works directly on the main repo. New functionalities are developed on separate branches. OK for small teams.
  • 21. GitHub pull requests – fork repository model Repo Repo clone Local Repo LOCAL Pull Request REMOTE (gitHub) Pull Pull/ Push
  • 22. GitHub pull requests – shared repo model Description of this process: https://github.com/CeON/saos/wiki/Code-review LOCAL Pull Request REMOTE (gitHub) Push master feature master feature Repo Repo 1 2 3 4 5 6
  • 23. Code Review in SAOS - observations  CR only makes sense if the team treats it as part of its responsibilites (motivation, strict rules)  CR takes time, about 20%, 1 day a week  Minor problems with starting a new task can occur if the task is related to another one just passed to CR  To a high degree CR relies on a reviewer’s skills, their knowledge of a given domain.  Tasks have to be short (we decreased the max time for a task from original 3 to 2 days, to make it shorter and thus easier to revise)
  • 24. Code Review w SAOS – observations cont.  No significant problems related to negative emotions occurred. Some positive ones have: „I have learned something new”, „I didn’t know you can do it this way” or „It’s good to know somebody will take a look at this.”  The pros listed at the beginning of the presentation proved to be true. In particular: code standardization, observance of rules (writing tests etc.), familiarity of each programmer with the whole code.
  • 25. Code Review in SAOS – observations cont.  The time devoted to CR has not been wasted, it has paid off (cleaner, faster & easier to extend and more reliable code; programmers know the whole system)  In the longer term CR has had very positive influence on the team collaboration and programmers’ skills.