Slide 1

Slide 1 text

Continuous Integration: Catch Bugs and Improve Team Communication Jordan Jozwiak, eero

Slide 2

Slide 2 text

First, let’s agree on some values

Slide 3

Slide 3 text

It’s better to automate processes than do them manually

Slide 4

Slide 4 text

It’s better to have consistent code style than mix multiple styles

Slide 5

Slide 5 text

It’s better to catch bugs during development than during the QA process

Slide 6

Slide 6 text

It’s better to automate routine communication than rely on individuals

Slide 7

Slide 7 text

Is this really Continuous Integration? What can I do? When can I do these things? How can I do these things? Guiding Questions

Slide 8

Slide 8 text

This isn’t really Continuous Integration

Slide 9

Slide 9 text

This isn’t really Continuous Integration continuous integration (CI) is the practice of merging all developer working copies to a shared mainline several times a day.

Slide 10

Slide 10 text

This isn’t really Continuous Integration continuous integration (CI) is the practice of merging all developer working copies to a shared mainline several times a day. build automation is the process of automating the creation of a software build and the associated processes including: compiling computer source code into binary code … and running automated tests.

Slide 11

Slide 11 text

This isn’t really Continuous Integration I’m talking about a larger scope and a longer timeframe

Slide 12

Slide 12 text

Is this really Continuous Integration? What checks can I do? When can I do these checks? How can I do these checks?

Slide 13

Slide 13 text

Is this really Continuous Integration? What checks can I do? (Scope) When can I do these checks? How can I do these checks?

Slide 14

Slide 14 text

Is this really Continuous Integration? What checks can I do? (Scope) When can I do these checks? (Timeframe) How can I do these checks?

Slide 15

Slide 15 text

Checks you can do (Scope)

Slide 16

Slide 16 text

Checks you can do (Scope) • Tests

Slide 17

Slide 17 text

Checks you can do (Scope) • Tests • Unit tests

Slide 18

Slide 18 text

Checks you can do (Scope) • Tests • Unit tests • Instrumentation tests

Slide 19

Slide 19 text

Checks you can do (Scope) • Tests • Unit tests • Instrumentation tests • Test coverage

Slide 20

Slide 20 text

Checks you can do (Scope) • Tests • Unit tests • Instrumentation tests • Test coverage • Style checks

Slide 21

Slide 21 text

Checks you can do (Scope) • Tests • Unit tests • Instrumentation tests • Test coverage • Style checks • Code arrangement

Slide 22

Slide 22 text

Checks you can do (Scope) • Tests • Unit tests • Instrumentation tests • Test coverage • Style checks • Code arrangement • Code formatting

Slide 23

Slide 23 text

Checks you can do (Scope) • Tests • Unit tests • Instrumentation tests • Test coverage • Style checks • Code arrangement • Code formatting • Method count

Slide 24

Slide 24 text

Checks you can do (Scope) • Tests • Unit tests • Instrumentation tests • Test coverage • Style checks • Code arrangement • Code formatting • Method count • APK size

Slide 25

Slide 25 text

Checks you can do (Scope) • Tests • Unit tests • Instrumentation tests • Test coverage • Style checks • Code arrangement • Code formatting • Method count • APK size • Static code analysis

Slide 26

Slide 26 text

Checks you can do (Scope) • Tests • Unit tests • Instrumentation tests • Test coverage • Style checks • Code arrangement • Code formatting • Method count • APK size • Static code analysis • Code duplication

Slide 27

Slide 27 text

Checks you can do (Scope) • Tests • Unit tests • Instrumentation tests • Test coverage • Style checks • Code arrangement • Code formatting • Method count • APK size • Static code analysis • Code duplication • Code complexity

Slide 28

Slide 28 text

Checks you can do (Scope) • Tests • Unit tests • Instrumentation tests • Test coverage • Style checks • Code arrangement • Code formatting • Method count • APK size • Static code analysis • Code duplication • Code complexity • Profiling

Slide 29

Slide 29 text

Checks you can do (Scope) • Tests • Unit tests • Instrumentation tests • Test coverage • Style checks • Code arrangement • Code formatting • Method count • APK size • Static code analysis • Code duplication • Code complexity • Profiling • Memory profiling

Slide 30

Slide 30 text

Checks you can do (Scope) • Tests • Unit tests • Instrumentation tests • Test coverage • Style checks • Code arrangement • Code formatting • Method count • APK size • Static code analysis • Code duplication • Code complexity • Profiling • Memory profiling • Start-up time profiling

Slide 31

Slide 31 text

Checks you can do (Scope) • Tests • Unit tests • Instrumentation tests • Test coverage • Style checks • Code arrangement • Code formatting • Method count • APK size • Static code analysis • Code duplication • Code complexity • Profiling • Memory profiling • Start-up time profiling • Frame rate profiling

Slide 32

Slide 32 text

Checks you can do (Scope) • Tests • Unit tests • Instrumentation tests • Test coverage • Style checks • Code arrangement • Code formatting • Method count • APK size • Static code analysis • Code duplication • Code complexity • Profiling • Memory profiling • Start-up time profiling • Frame rate profiling • And more…

Slide 33

Slide 33 text

When can I do these checks?

Slide 34

Slide 34 text

Normal timeline

Slide 35

Slide 35 text

Normal timeline

Slide 36

Slide 36 text

Save Code Normal timeline

Slide 37

Slide 37 text

Save Code Normal timeline Commit Locally

Slide 38

Slide 38 text

Save Code Normal timeline Commit Locally Open Pull Request

Slide 39

Slide 39 text

Save Code Normal timeline Commit Locally Open Pull Request Merge code

Slide 40

Slide 40 text

Save Code Normal timeline Commit Locally Open Pull Request Merge code QA

Slide 41

Slide 41 text

Save Code Normal timeline Commit Locally Open Pull Request Merge code QA Release

Slide 42

Slide 42 text

Work that you do Work done automatically Save Code Commit Locally Open Pull Request Merge code QA Release

Slide 43

Slide 43 text

Work that you do Work done automatically Save Code Commit Locally Open Pull Request Merge code QA Release Local Development Code Review After Merge

Slide 44

Slide 44 text

Assessing cost and value of running a check Quality Bar Time

Slide 45

Slide 45 text

Normal timeline Automatically hook into events Editor hooks git hooks Save Code Commit Locally Open Pull Request Merge code QA Release GitHub PR hooks GitHub hooks

Slide 46

Slide 46 text

Normal timeline Available time and expected quality little time low quality little time med quality Save Code Commit Locally Open Pull Request Merge code QA Release med time high quality more time highest quality

Slide 47

Slide 47 text

Normal timeline For example… catch bugs early Reformat & rearrange code FindBugs PMD Lint Save Code Commit Locally Open Pull Request Merge code QA Release Tests & Static Code Analysis Automation Tests

Slide 48

Slide 48 text

Normal timeline and improve communication! Save Code Commit Locally Open Pull Request Merge code QA Release Update ticket statuses Generate release notes

Slide 49

Slide 49 text

This isn’t really Continuous Integration

Slide 50

Slide 50 text

Build, Test, Analysis, and Communication Process spanning entire development cycle

Slide 51

Slide 51 text

Totally Awesome Development Process™

Slide 52

Slide 52 text

How can I do these checks?

Slide 53

Slide 53 text

Build • Jenkins • Travis • Circle CI • TeamCity

Slide 54

Slide 54 text

Build • Jenkins • Travis • Circle CI • TeamCity VCS • GitHub • BitBucket

Slide 55

Slide 55 text

Static Code Analysis • CheckStyle • Findbugs • PMD • SonarQube Build • Jenkins • Travis • Circle CI • TeamCity VCS • GitHub • BitBucket

Slide 56

Slide 56 text

Static Code Analysis • CheckStyle • Findbugs • PMD • SonarQube Unit Testing • JUnit • Robolectric Build • Jenkins • Travis • Circle CI • TeamCity VCS • GitHub • BitBucket

Slide 57

Slide 57 text

Static Code Analysis • CheckStyle • Findbugs • PMD • SonarQube Unit Testing • JUnit • Robolectric Build • Jenkins • Travis • Circle CI • TeamCity VCS • GitHub • BitBucket Instrumentation Testing • Espresso • Spoon

Slide 58

Slide 58 text

Static Code Analysis • CheckStyle • Findbugs • PMD • SonarQube Unit Testing • JUnit • Robolectric Build • Jenkins • Travis • Circle CI • TeamCity VCS • GitHub • BitBucket Instrumentation Testing • Espresso • Spoon Crash Reporting • Crashlytics • Firebase

Slide 59

Slide 59 text

Static Code Analysis • CheckStyle • Findbugs • PMD • SonarQube Unit Testing • JUnit • Robolectric Build • Jenkins • Travis • Circle CI • TeamCity VCS • GitHub • BitBucket Instrumentation Testing • Espresso • Spoon Crash Reporting • Crashlytics • Firebase Distribution • Fabric

Slide 60

Slide 60 text

Static Code Analysis • CheckStyle • Findbugs • PMD • SonarQube Unit Testing • JUnit • Robolectric Build • Jenkins • Travis • Circle CI • TeamCity VCS • GitHub • BitBucket Instrumentation Testing • Espresso • Spoon Crash Reporting • Crashlytics • Firebase Distribution • Fabric Multi- functional • BuddyBuild

Slide 61

Slide 61 text

Static Code Analysis • CheckStyle • Findbugs • PMD • SonarQube Unit Testing • JUnit • Robolectric Build • Jenkins • Travis • Circle CI • TeamCity VCS • GitHub • BitBucket Instrumentation Testing • Espresso • Spoon Crash Reporting • Crashlytics • Firebase Distribution • Fabric Multi- functional • BuddyBuild and so many more

Slide 62

Slide 62 text

A Totally Awesome Development Process™ is

Slide 63

Slide 63 text

A Totally Awesome Development Process™ is Reliable 24/7

Slide 64

Slide 64 text

A Totally Awesome Development Process™ is Reliable Comprehensive 24/7

Slide 65

Slide 65 text

A Totally Awesome Development Process™ is Reliable Comprehensive Informative 24/7

Slide 66

Slide 66 text

How we do things at eero a mostly free option using popular services

Slide 67

Slide 67 text

Services used at eero

Slide 68

Slide 68 text

Services used at eero GitHub Industry standard Free public repos

Slide 69

Slide 69 text

Services used at eero GitHub Industry standard Free public repos SonarQube Duplication, coverage, complexity, history, assignment, etc.

Slide 70

Slide 70 text

Services used at eero GitHub Industry standard Free public repos Jenkins Free, customizable, large community SonarQube Duplication, coverage, complexity, history, assignment, etc.

Slide 71

Slide 71 text

Services used at eero GitHub Industry standard Free public repos Jenkins Free, customizable, large community SonarQube Duplication, coverage, complexity, history, assignment, etc. Fabric Convenient, includes release notes

Slide 72

Slide 72 text

Services used at eero GitHub Industry standard Free public repos Jenkins Free, customizable, large community JIRA Specialized for bug and task tracking Has API for updating ticket status SonarQube Duplication, coverage, complexity, history, assignment, etc. Fabric Convenient, includes release notes

Slide 73

Slide 73 text

Let’s dive into an example! inspired by the eero timeline

Slide 74

Slide 74 text

Save Code Commit Locally Open Pull Request Merge code QA Release Local Development Code Review After Merge

Slide 75

Slide 75 text

Save Code Commit Locally Open Pull Request Merge code QA Release Local Development Code Review After Merge

Slide 76

Slide 76 text

Save Code Commit Locally Local Development Services

Slide 77

Slide 77 text

Save Code Commit Locally Local Development Services Android Studio

Slide 78

Slide 78 text

Save Code Commit Locally Local Development Services Android Studio git

Slide 79

Slide 79 text

Save Code Commit Locally Local Development Services Android Studio git SonarQube

Slide 80

Slide 80 text

Android Studio • Helpful Plugins • SonarLint • FindBugs, PMD, Checkstyle • Share settings for formatting and arrangement • Shortcut for optimizing imports, formatting, and arranging

Slide 81

Slide 81 text

git • git hooks

Slide 82

Slide 82 text

SonarQube • Static code analysis at its best. An ultimate combination of PMD, FindBugs, Checkstyle, Android Lint, and more! • Tech debt, complexity analysis, code duplication, test coverage • History to track project quality • Caveat: the Android Lint plugin is woefully out of date. It’s still on 22.0 when the latest is >25

Slide 83

Slide 83 text

SonarQube • Helpful plugins • GitHub Plugin • Android Lint Plugin • XML Plugin

Slide 84

Slide 84 text

No content

Slide 85

Slide 85 text

Save Code Commit Locally Local Development Demo

Slide 86

Slide 86 text

Save Code Commit Locally Local Development

Slide 87

Slide 87 text

Save Code Commit Locally Open Pull Request Local Development Code Review

Slide 88

Slide 88 text

Save Code Commit Locally Open Pull Request Local Development Code Review Services

Slide 89

Slide 89 text

Save Code Commit Locally Open Pull Request Local Development Code Review GitHub Services

Slide 90

Slide 90 text

Save Code Commit Locally Open Pull Request Local Development Code Review GitHub Jenkins Services

Slide 91

Slide 91 text

Save Code Commit Locally Open Pull Request Local Development Code Review GitHub Jenkins SonarQube Services

Slide 92

Slide 92 text

GitHub • Show the results of external tasks on a commit or pull request

Slide 93

Slide 93 text

GitHub

Slide 94

Slide 94 text

Jenkins • Helpful plugins • GitHub Plugin • GitHub Pull Request Builder • JUnit Plugin • Gradle Plugin • JIRA Plugin

Slide 95

Slide 95 text

Jenkins • Useful jobs • Pull Request Builder • Job that builds all changes to development branch • Nightly builder

Slide 96

Slide 96 text

Jenkins • APK size • Method count

Slide 97

Slide 97 text

No content

Slide 98

Slide 98 text

SonarQube • Run an incremental analysis on just the changes • Publish results to GitHub

Slide 99

Slide 99 text

Save Code Commit Locally Open Pull Request Local Development Code Review Demo

Slide 100

Slide 100 text

The case for an all-in-one solution

Slide 101

Slide 101 text

• No setup to build pull requests • No setup to run tests • Includes crash reporting • Integrate SDK so users can send screenshots of issues • Easily distribute builds to team • Publish directly to the app store

Slide 102

Slide 102 text

No content

Slide 103

Slide 103 text

Save Code Commit Locally Local Development Open Pull Request Code Review

Slide 104

Slide 104 text

Save Code Commit Locally Local Development Open Pull Request Code Review Merge code QA Release After Merge

Slide 105

Slide 105 text

Merge code QA Release After Merge

Slide 106

Slide 106 text

Merge code QA Release After Merge Services

Slide 107

Slide 107 text

Merge code QA Release After Merge Services

Slide 108

Slide 108 text

Merge code QA Release After Merge Fabric Services

Slide 109

Slide 109 text

• Integrate with Jenkins to automatically update tickets statuses

Slide 110

Slide 110 text

No content

Slide 111

Slide 111 text

Fabric • Distribute build to team • Include release notes based on the changes since the last Jenkins build

Slide 112

Slide 112 text

Fabric

Slide 113

Slide 113 text

Fabric

Slide 114

Slide 114 text

Merge code QA Release After Merge Demo

Slide 115

Slide 115 text

The reality

Slide 116

Slide 116 text

The reality all this requires work and maintenance

Slide 117

Slide 117 text

The reality all this requires work and maintenance and that can be frustrating

Slide 118

Slide 118 text

The reality

Slide 119

Slide 119 text

The struggle

Slide 120

Slide 120 text

The struggle • Build server breaks

Slide 121

Slide 121 text

The struggle • Build server breaks • Wait time for tests and checks to complete

Slide 122

Slide 122 text

The struggle • Build server breaks • Wait time for tests and checks to complete • Pre-commit checks are annoying

Slide 123

Slide 123 text

The struggle • Build server breaks • Wait time for tests and checks to complete • Pre-commit checks are annoying • False-positives in checks

Slide 124

Slide 124 text

The struggle • Build server breaks • Wait time for tests and checks to complete • Pre-commit checks are annoying • False-positives in checks • Rules don’t always apply (e.g. parentheses for improved readability)

Slide 125

Slide 125 text

it’s easy to get started but configuring everything to your needs is harder

Slide 126

Slide 126 text

enforcing rules improves quality but it requires maturity and discipline

Slide 127

Slide 127 text

the journey is hard but it’s worth it when you get there

Slide 128

Slide 128 text

I asked some other companies what they do

Slide 129

Slide 129 text

Do what’s best for your team

Slide 130

Slide 130 text

Do what’s best for your team by catching bugs early and improving communication

Slide 131

Slide 131 text

Questions? [email protected]