Slide 1

Slide 1 text

Better, Faster 
 Code Reviews In an Agile World Marius Constantin Stanojko Markovik a.k.a Tancho

Slide 2

Slide 2 text

Facts about code reviews: Pros: • They're important for the team • They help educate • They help spot bugs early • They improve estimates Cons: • They take time • They can cause fights • They’re difficult to explain to management • They slow down progress

Slide 3

Slide 3 text

Have you ever had this in the morning ?

Slide 4

Slide 4 text

Ok, reviewing this code will take 2 hours. 
 Easily… 
 
 Oh joy…

Slide 5

Slide 5 text

Have you ever had this in the morning ?

Slide 6

Slide 6 text

Requirements • Early feedback From Code Reviewers From PR owner • Quick to review • Easy test coverage overview • Follow our coding style rules

Slide 7

Slide 7 text

Let’s take a practical example Let’s assume we have a story in our sprint in which we want to be able to configure our application parameters and behavior remotely. Story subtasks: • Fetch and persist the Config. • Make the application behavior configurable according with the config file

Slide 8

Slide 8 text

How this looks in our JIRA board

Slide 9

Slide 9 text

feat/mobile-724/mobile-725/fetch.. feat/mobile-724/mobile-726/make.. feat/mobile-724/app-config master App-config PR1 PR2 PR3 Hot fix Hot fix Cherrypick Hot fix

Slide 10

Slide 10 text

Some Guidelines • Rebase subtask PRs and merge them to keep the history in the feature branch • Squash to master = 1 commit = 1 feature • Use a TDD approach to refactor your code without introducing any bug in your current logic • Use a lot of tooling and learn to trust it

Slide 11

Slide 11 text

• How do you split a big PR • How do you keep your history • How do you end up with a feature per commit Enter Jenkins… Quick Summary until this point What else can we do before the actual review?

Slide 12

Slide 12 text

Some Tooling Magic

Slide 13

Slide 13 text

Start End Fetch code Run unit - tests Analyze Checkstyle Findbugs Lint Pmd Sonar Sloccount Assemble Compile: SDK Demo apps Integration Tests Running Espresso Tests Publish Artifacts Save: sdk_aar files ProGuard files demo_apps_apks Maven Deploy Publish Reports Publish Analysis Reports on GitHub PRs page Our Pipeline Only on release Branches

Slide 14

Slide 14 text

Jenkins approves Sonar reviews Why Is This Important?

Slide 15

Slide 15 text

Last but not least: Train your team, And reinforce code reviews 
 on a daily basis.

Slide 16

Slide 16 text

Thank you ! Enjoy the rest of 
 Android Makers…