slimming down with rails - o'reilly mediaassets.en.oreilly.com/1/event/40/get lean_ slimming...

101
Get Lean Slimming Down with Rails Marty Haught @mghaught http://martyhaught.com http://github.com/mghaught/getlean

Upload: vuongmien

Post on 16-Aug-2018

218 views

Category:

Documents


0 download

TRANSCRIPT

Get LeanSlimming Down with Rails

Marty Haught@mghaught

http://martyhaught.com

http://github.com/mghaught/getlean

tutorial’s goal

• introduce lean concepts

• discuss the how and why

• demonstrate Rails-specific techniques

• give you a starting place to go further

• questions are welcome at any point

• let’s be interactive

• encourage conversations

• we’ll have breaks

session guidelines

• limited resources (time & money)

• uncertain of solution

• unknown market

context for today

outline

1. lean overview

2. rails basics

3. focusing on value

4. minimize effort

5. measuring

6. delivering fast

tutorial material

http://github.com/mghaught/getlean

flingr!

http://flingr.martyhaught.com

http://ciflingr.martyhaught.com

tutorial/install.md

Longmont, Colorado

Boulder Ruby

why lean?

consulting entrepreneurship

other reasons

• bloated, inefficient agile projects

• building software no one wants or uses

rockin with ramen

(pictured with Dokken)

1. lean overview

“from manufacturing to software”

discovering lean

Mary Poppendieckhttp://www.poppendieck.com/

history of lean

• emerged from manufacturing in the 50s

• Toyota production system

• translated for software projects in 90s

• influenced agile thinking

lean startups

“translating your startup vision into a successful business as quickly and efficiently as possible”

Eric Ries

http://www.startuplessonslearned.com/

customer development

Steve Blank

http://steveblank.com/

new ‘translation’

http://www.custdev.com/

changed my view

• much like when I discovered XP in 2004

• think just as much about the business as the technical

• engineers should ‘own’ the business side

2. rails stack

“preaching to the choir”

why rails/sinatra

• great for prototyping

• can be minimal or full stack

• change is easy

• start simple but can grow

community assets

• helpful

• easy to pick up new resources

• constantly improving

automation

• automated testing

• continuous integration

• data migrations

• deployment

• notifications

master your stack

• practice your art to get faster

• use plugins and gems for common functionality

• anything to let you focus more on what’s important

context is king

• pick the right amount of process

• start simple and add on as you go

• know when not to use lean

“A solar death ray assembler would likely need more testing and process than a twitter-based web app.”

context changes

• what worked for the start of the project may not fit once you enter into maintenance mode

• the larger the organization, the more the process

• accept that you will likely have to re-evaluate

3. focusing on value

“work on the right things”

defining your product

• knowing your vision

• clarify and agree as a team

• what is your value?

• why are you creating this software?

business value

• how do you define success?

• how do you measure it?

• will people use it?

• who?

agile’s customer

• dev team takes direction from client

• no questioning of business motives in feature requests

• engineers don’t ‘own’ the business side

ice cream glove

drinking your kool-aid?

webbchange story

of excess

of too many features

valuing web content

demo time

everything but ...

Getting in all the features before launching

Built too much?!?

my mistake

will people use it?

got eyeballs on it

too complex

ran out of money

lessons learned

• start simple and launch early

• validate against real use

• get out of the building and talk to people

minimum viable product

• rails rumble or startup weekend

• starting place for validated learning with the least effort

• should be embarrassing

• early adopters see the potential

mvp exercise

• what is flingr’s mvp?

• what about webbchange?

learning process

• make progress by reaching users

• don’t just execute a plan

• use feedback

• pivot as you learn

Eric Ries’ feedback loop

4. minimize effort

“less is more”

• strip features to the essence that achieves value

• spiking large features

• “do the simplest thing that could possibly work”

simplicity

• pushing off decisions, commitment until the last possible moment

• yagni - you ain’t going to need it

• no really, be militant about pushing things off

delay commitment

reducing waste

• core value of lean, eliminating waste

• does your current task add business value?

• eliminate activity that doesn’t contribute to progress

• re-evaluate the value of what you’re doing

seven wastes of lean

Overproduction Extra FeaturesDevelop only for the current

story

Inventory Backlog, RequirementsStory cards are detailed only

for the current iteration

Extra Processing Extra Steps Code directly from stories

Motion Finding InformationHave everyone in the same room; customer included

Defects Defects not caught by testsTest first; including acceptance

tests

Waiting Waiting, Including Customers Deliver in small increments

Transportation HandoffsDevelopers work directly with

customers

5. measuring

“know when you’re making progress”

pirate metrics

not vanity metrics

must be actionable

“should help you make decisions”

AARRR!by Dave McClure

• acquisition

• activation

• retention

• referral

• revenue

http://www.slideshare.net/dmc500hats/startup-metrics-for-pirates-long-version

flingr metrics

• unique visits (acquisition)

• signups (activation)

• repeat use (retention)

• fling backs (referral)

• pro upgrade (revenue)

skip services for now

• Google Analytics http://www.google.com/analytics

• MixPanel http://mixpanel.com/

• KISSMetrics http://kissmetrics.com/

• others

diy metrics

• you control the data

• can track any event in your system

• good enough for actionable metrics

• start simple, 5 at most

metrics exercise

tutorial/metrics.md

what to measure?

• will the new story add value?

• how will you measure progress?

• define when new stories are created

• best when it’s one of your core metrics

split testing

“presenting two or more variations and measuring user behavior to determine value”

benefits

• best mechanism to truly measure progress

• can answer internal debates

pitfalls

• can lead to a mess if not well-guided

• may not get conclusive reports

• don’t go overboard

• don’t let it replace your vision

split test exercise

tutorial/abingo.md

tutorial/vanity.md

take away

• limited to a single metric/conversion

• best when you can analyze all aarrr metrics

6. delivering fast

“speed wins”

small batches

• reduce to smallest, meaningful chunks

• reduces integration costs

• helps avoid overproduction

• think hours not days

“amount of finished work that can be shipped”

kanban

• a pull-based system for continuous flow of work

• expression of just in time

• emphasis on flow

http://www.limitedwipsociety.org/

science behind it

• queueing theory

• theory of constraints

• proven in world of manufacturing

• working in software projects

• fixed time box, such as two weeks

• IPM to cover a set of stories

• make estimates

• velocity to determine what fits

agile’s iteration

reducing waste

• no need to estimate

• no need to force stories to fit

• just in time meetings

• no big batch of stories

kanban exercise

kanban benefits

• simple, less process

• limit work in progress, maximize throughput

• more easily spot bottlenecks

• easy to change direction

• less inventory of requirements/stories

• less time in meetings

why not?

• cultural

• green or undisciplined team

• other reasons?

kanban-tracker hybrid

• one week iterations

• ultra light weight complexity ‘estimates’

• continuously add stories to backlog as needed

• no ipm, just in time discussions

• deploy stories when complete

kanban

continuous deployment

continuous deployment

“automatic flow of completed features”

• batch up all stories for iteration

• separate integration step

• explicit sign off process

• qa -- staging -- production

agile way

“the larger the gap between ‘trunk’ and production, the heavier the process”

not lean

classic stack

• source control with commit hook

• continuous integration

• deploy/rollback script

• real time alerts

• root cause analysis

Commit

Test

Deploy

Monitor

go lighter

• deploy to a ‘dev’ instance

• no monitoring

faking it

• nothing’s automated

• once you commit a feature, deploy

monitoring

• pingdom

• nagios with business metrics

• stop the line on alert

five whys

• determine source of issue

• take small steps to prevent

benefits

• eliminates waste on shipping code

• features go live sooner

• reduce shelf time for finished work

• find integration issues quickly in isolation

cd exercise

tutorial/contdeploy.md

take away

• deliver code faster

• focus on features, not integration

• reduces fear of pushing to production

• quality does not have to decline

why we test exercise

?

test all the f ’n time?

• don’t blindly follow some guideline

• does 100% coverage have business value?

• are all tests valuable?

• cost of writing/maintaining all tests?

• cost of failure/bugs?

value of testing

• not all project phases value testing equally

• larger the team, the greater the need

• context really matters

phases of a startup

Kent Beckhttp://www.threeriversinstitute.org/blog/?p=251

1. Taxi (find a need)

2. Takeoff (validate need has a problem)

3. Climb (scaling)

4. Cruise (manage)

lean up your tests

• consider business value of features tested

• view tests as a garden, must prune

• strong integration layer

• test interesting/tricky business logic

• look for high value, small footprint tests

• skip rarely used areas like admin UI

takeaway

• really understand value for your project

• focus on tasks that add value

• ship early and continuous

• automate all that you can

• minimize effort to get feedback asap

go forth and rock!

Long's Peak - http://www.flickr.com/photos/17972620@N00/2956076614/Pile of Money - http://www.flickr.com/photos/ironrodart/3841677517/Bowl of Ramen - http://www.flickr.com/photos/billselak/2388252659/George Lynch - http://www.rollingstone.com/artists/dokken/photos/collection/photo/1Lean Overview - http://pffc-online.com/mag/paper_latitudes_lean/Rails Stack - http://www.building-your-model-railroad.com/model-railroad-operation.htmlGold Heart - http://www.flickr.com/photos/cryodigital/3060730616/Ice Cream Glove by Ali G - Sacha Baron CohenKool-Aid - http://www.flickr.com/photos/dyannafstop/2025899850/Various Black and Whites - http://blackandwtf.tumblr.com/Hammock - http://www.flickr.com/photos/wisdoc/3212710310/Seven Deadly Sins - Painter Hieronymus BoschMeasuring - http://www.flickr.com/photos/captkodak/272746539Motley Crue - http://www.laughinsam.com/1980Images/MotleyCrue.jpgRunning Dog - http://www.flickr.com/photos/wisdoc/123640339/Chocolate Peanut Butter Cups - http://chocolateheaven.orgRandy Rhoads - www.rudysarzo.com/images/bio/Randy-Rhoads.jpg

image credits