starting fresh every morning building a new development image every morning

41
Starting fresh every morning Building a new Building a new development image development image every morning every morning

Upload: collin-bradford

Post on 18-Jan-2016

218 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Starting fresh every morning Building a new development image every morning

Starting fresh every morning

Building a new Building a new development image every development image every

morningmorning

Page 2: Starting fresh every morning Building a new development image every morning

$> whoami

Page 3: Starting fresh every morning Building a new development image every morning

What We Are Talking About

Page 4: Starting fresh every morning Building a new development image every morning

What We Aren’t Talking About

Page 5: Starting fresh every morning Building a new development image every morning

Introducing the Beast

Kapital has been actively developed since 1995

Kapital has more than 22000 classes (VW with ENVY has 2200)

Kapital is more than 70 developers pushing changes everyday!

Every development cycle we change 5000 classes

Each day, we change from 60 to 150 classes

Page 6: Starting fresh every morning Building a new development image every morning

Why Change My Image ?

Resynchronizing the code base with the other developers

Avoiding important splits from the main branch Checking prerequesites Avoiding unknown dependencies

Page 7: Starting fresh every morning Building a new development image every morning

Why Change My Image ?

Resynchronizing the code base with the other developers

Avoiding important splits from the main branch Checking prerequesites Avoiding unknown dependencies

Page 8: Starting fresh every morning Building a new development image every morning

Resynchronizing the Code Base

The sooner you merge, the better Everyday, 60 to 150 classes are changed Everyday, 25 change sets are applied

Average size of a change set = 5-8 classes 25*5 = 125 25*8 = 200

Avoiding multiple implementations for a single piece of functionality

Page 9: Starting fresh every morning Building a new development image every morning

Why Change My Image ?

Resynchronizing the code base with the other developers

Avoiding important splits from the main branch Checking prerequesites Avoiding unknown dependencies

Page 10: Starting fresh every morning Building a new development image every morning

Avoiding Important Splits

Decompose code changes into smaller, more manageable steps

Page 11: Starting fresh every morning Building a new development image every morning

Why Change My Image ?

Resynchronizing the code base with the other developers

Avoiding important splits from the main branch Checking prerequesites Avoiding unknown dependencies

Page 12: Starting fresh every morning Building a new development image every morning

Checking Prerequisites

Always make ENVY happy

Page 13: Starting fresh every morning Building a new development image every morning

Why Change My Image ?

Resynchronizing the code base with the other developers

Avoiding important splits from the main branch Checking prerequesites Avoiding unknown dependencies

Page 14: Starting fresh every morning Building a new development image every morning

Avoiding Unknown Dependencies

#{MyClassOrGlobalVariable}

ifDefinedDo: [ :thing | thing doStuff].

THIS IS NOT GOOD !!!

Page 15: Starting fresh every morning Building a new development image every morning

How We do it in Kapital

Loading the top level map Validating the build A fresh image every time Dangers of savedowns

Page 16: Starting fresh every morning Building a new development image every morning

Introducing ENVY/Developer

Applications and configuration maps Granularity = methods (class,

application, config map) Great flexibility (ENVY boy talking )

Page 17: Starting fresh every morning Building a new development image every morning

How We do it in Kapital

Loading the top level map Validating the build A fresh image every time Dangers of savedowns

Page 18: Starting fresh every morning Building a new development image every morning

Loading the Top Level Map

Kapital benefits from base ENVY functionality

BEWARE! ENVY is known to bite developers!

Page 19: Starting fresh every morning Building a new development image every morning

How we do it in Kapital

Loading the top level map Validating the build A fresh image every time Dangers of savedowns

Page 20: Starting fresh every morning Building a new development image every morning

Validating the build

Two types of testing systems Code driven = specific code items (SUnit

style) Data driven = end-to-end testing

(“SmokeTest”)

Page 21: Starting fresh every morning Building a new development image every morning

How we do it in Kapital

Loading the top level map Validating the build A fresh image every time Dangers of savedowns

Page 22: Starting fresh every morning Building a new development image every morning

A fresh image every time

Always ensure your code loads in a fresh image

Of course, there are times where the image is wrong

Page 23: Starting fresh every morning Building a new development image every morning

How We do it in Kapital

Loading the top level map Validating the build A fresh image every time Dangers of savedowns

Page 24: Starting fresh every morning Building a new development image every morning

Dangers of Savedowns

Building an image is great but…

IT TAKES TIME!

Page 25: Starting fresh every morning Building a new development image every morning

Breaking the Build …

It will happen! Don’t let the build process become a

burden It’s nothing more than a failing sanity

check

Page 26: Starting fresh every morning Building a new development image every morning

… Identifying the Issue …

3 types of failures Successful build, but failing tests Uncompleted build Successful build, but failed load

Page 27: Starting fresh every morning Building a new development image every morning

… Identifying the Issue …

3 types of failures Successful build, but failing tests Uncompleted build Successful build, but failed load

Page 28: Starting fresh every morning Building a new development image every morning

Successful Build, but Failing Tests

Is your code wrong ?

Is your data wrong ?

Page 29: Starting fresh every morning Building a new development image every morning

… Identifying the Issue …

3 types of failures Successful build, but failing tests Uncompleted build Successful build, but failed load

Page 30: Starting fresh every morning Building a new development image every morning

Uncompleted Build

This is Smalltalk, you can debug

Find the offending code change first

Typically it’s a prerequisite issue. A method not yet introduced, a class (or variable) not yet declared

Page 31: Starting fresh every morning Building a new development image every morning

… Identifying the Issue …

3 types of failures Successful build, but failing tests Uncompleted build Successful build, but failed load

Page 32: Starting fresh every morning Building a new development image every morning

Successful Build, but Failed Load

The code didn’t load all the way

Revealed by the tests run on the image (missing code)

Know your SCM system well! ENVY does this for overrides

Page 33: Starting fresh every morning Building a new development image every morning

… And Fixing the Build!

Always find the error before fixing it

You must fix the build before you can validate today’s code base

Page 34: Starting fresh every morning Building a new development image every morning

… And Fixing the Build! (2)

3 types of errors can be introduced by code changes: Calling a method not yet present Depending on code not yet released Clashing code

Page 35: Starting fresh every morning Building a new development image every morning

… And Fixing the Build! (2)

3 types of errors can be introduced by code changes: Calling a method not yet present Depending on code not yet released Clashing code

Page 36: Starting fresh every morning Building a new development image every morning

Calling a Method Not Yet Present

Page 37: Starting fresh every morning Building a new development image every morning

… And Fixing the Build! (2)

3 types of errors can be introduced by code changes: Calling a method not yet present Depending on code not yet released Clashing code

Page 38: Starting fresh every morning Building a new development image every morning

Depending on Code Not Yet Released

Page 39: Starting fresh every morning Building a new development image every morning

… And Fixing the Build! (2)

3 types of errors can be introduced by code changes: Calling a method not yet present Depending on code not yet released Clashing code

Page 40: Starting fresh every morning Building a new development image every morning

Clashing Code

a.k.a mismerged code

Because some classes are centers of high activity

Page 41: Starting fresh every morning Building a new development image every morning

Questions ?

[email protected]