From naive to agile - software engineering approach

29
From Naive to Agile - SaaS – DEC/18 Stayman

Transcript of From naive to agile - software engineering approach

Page 1: From naive to agile - software engineering approach

From Naive to Agile - SaaS

– DEC/18 Stayman

Page 2: From naive to agile - software engineering approach

From Naive to Agile

● Two Scenarios● Naive Approach● Staging● Development● Testing● Agile

– New Feature → Test → Implement → Refactor

● Rails

Page 3: From naive to agile - software engineering approach

Two Scenarios – Non-SaaS is different

● Outsourcing Project– One-time Development

– Maintenance

– Improvement

– (Please Rectify)

● In-house Project– On-going Development

– Engaged Operations

– Bug Fixing

– New Feature

– Feedback

– Deprecated Feature

Page 4: From naive to agile - software engineering approach

Naive Approach

Internet

Prod Stack

WorkStation

dev in prod

over ftp

Page 5: From naive to agile - software engineering approach

Naive Approach

● Favor php over others● The Good

– Fast Delivery

● e.g. new news site

● The Bad– Bugs go to Prod

– Hard to find Bug

– Hard to fix Bug

– Large upfront cost and delayed feedback

– Blocking others dev

● e.g. down on change

Page 6: From naive to agile - software engineering approach

Staging

Internet

Prod StackWorkStation

push to prod

over ftp

Stag Stack

dev in stag

over ftp

Page 7: From naive to agile - software engineering approach

Staging

● The Good– Fast Delivery Get some

lags on your delivery (1 day)

● The Bad– Bugs go to Prod Get

some covers for bugs

– Hard to find Bug

– Hard to fix Bug

– Large upfront cost and delayed feedback

– Blocking others dev

Page 8: From naive to agile - software engineering approach

Staging

● The Problem– How to replicate the change to prod?

● Code● DB!● e.g. kpop shop

Page 9: From naive to agile - software engineering approach

How to replicate the change to prod - Code

Internet

Prod StackWorkStation

Stag Stack

dev in master branch

deliver in production branch

Central RepoPull master on change

Pull production on change

Page 10: From naive to agile - software engineering approach

How to replicate the change to prod - DB

Internet

Prod StackWorkStation

Stag Stack

dev in master branch

deliver in production branch

Central RepoPull master on change

Exec db migration

Pull production on changeExec db migration

Page 11: From naive to agile - software engineering approach

Staging

● The Good– Get some covers for

bugs

– e.g. It indeed prevents bugs

● The Bad

– Get some lags on your delivery (1 day)– Have to learn & setup version control– Have to learn DB migration tools– Have to make seed data– Either setup CI or use deployment tools– Hard to find Bug

– Hard to fix Bug

– Large upfront cost and delayed feedback

– Blocking others dev

– Blocking others delivery– e.g. it takes around 1 hour to make even a tiny change

– e.g. hard for designer to adopt

– e.g. wait for others staging

Page 12: From naive to agile - software engineering approach

Development

Internet

Prod Stack

WorkStation

Stag Stack

dev in master branchStage in master/stage branchdeliver in production branch

Central RepoPull master/stage on change

Exec db migration

Pull production on changeExec db migration

Dev Stack

Page 13: From naive to agile - software engineering approach

Development

● Must have for non-php● The Good

– Get some more covers for bugs

● The Bad– Get some lags on your delivery (1 day)

– Have to learn & setup version control

– Have to learn DB migration tools

– Have to make seed data

– Either setup CI or use deployment tools Learn more about CI and deployment

– Hard to find & fix Bug Able to use debug tools

– Large upfront cost and delayed feedback

– Blocking others dev Non-blocking dev– Blocking others delivery

– e.g. strace vs debugger

Page 14: From naive to agile - software engineering approach

Development

● The Problem– How to keep your environment similar?

● Dev vs Dev● Staging vs Prod● e.g. chef dev package upgrade

Page 15: From naive to agile - software engineering approach

●How to keep your environment similar? - Dev vs Dev

Internet

Prod StackWorkStation B

Stag Stack

dev in master branchStage in master/stage branch deliver in production branch

Central RepoPull master/stage on change

Exec db migration

Pull production on changeExec db migration

VagrantBox

WorkStation A

VagrantBox

Page 16: From naive to agile - software engineering approach

●How to keep your environment similar? - Staging vs Prod

Internet

Prod StackWorkStation B

Stag Stack

dev in master branchStage in master/stage branch deliver in production branch

Central RepoPull master/stage on change

Exec db migration

Pull production on changeExec db migration

VagrantBox

WorkStation A

VagrantBox

IT AutomationConfig Mngmnt

config

trigger

Page 17: From naive to agile - software engineering approach

Development

● Must have for non-php● The Good

– Able to use debug tools

– Non-blocking dev

● The Better– Get more covers for

bugs

● The Bad– Get some lags on your delivery (1 day)

– Have to learn & setup version control

– Have to learn DB migration tools

– Have to make seed data

– Have to learn IT Auto/Config Mngmnt

– Have to learn Vagrant/Docker– Large upfront cost and delayed feedback

– Environment Consistency– Blocking others delivery

● The Worse

– Learn more about CI and deployment

Page 18: From naive to agile - software engineering approach

Testing

Internet

Prod StackWorkStation B

Stag Stack

dev in master branchStage in master/stage branch deliver in production branch

Central RepoPull master/stage on change

Exec db migration

Pull production on changeExec db migration

VagrantBoxDev/test env

WorkStation A

VagrantBoxDev/test env

IT AutomationConfig Mngmnt

config

trigger

Test Stack

Page 19: From naive to agile - software engineering approach

Testing

● The Good– Able to use debug tools

– Find bug earlier

– Non-blocking dev

● The Better– Get more most covers for

bugs/security holes/low-quality code

– e.g. new association

– e.g. improve design pattern

● The Bad

– Get some more lags on your delivery (1 day hours to weeks)

– Have to learn & setup version control

– Have to learn DB migration tools

– Have to make seed data

– Have to write test code– Have to learn Vagrant/Docker

– Have to learn IT Auto/Config Mngmnt

– Large upfront cost and delayed feedback

– Environment Consistency

– Blocking others delivery

● The Worse– Learn more about CI and deployment

– e.g. months to test a project

Page 20: From naive to agile - software engineering approach

Testing

● The Problem– If test takes time?

– More lags typically doesn't work in our community

Page 21: From naive to agile - software engineering approach

Testing

● The Good– Able to use debug tools

– Find bug earlier

– Non-blocking dev

● The Best– Get most covers for

bugs/security holes/low-quality code

● The Bad– Have to learn & setup version control

– Have to learn DB migration tools

– Have to make seed data

– Have to write test code– Have to learn Vagrant/Docker

– Have to learn IT Auto/Config Mngmnt

– Large upfront cost and delayed feedback

– Environment Consistency

– Blocking others delivery

● The Worst– Learn most about CI and deployment

– Get more lags on your delivery (hours to weeks)

Page 22: From naive to agile - software engineering approach

Agile

Naive

Staging

Dev

Test

Agile

Develop

Deliver & Feedback

Develop

Deliver & Feedback

Bug

Build repo& stag env Develop DebugBug

Day 1: pending

Build repo& dev env

Buildstag env

Develop DebugBug

Deliver & Feedback

Build repo& dev env

Buildstag env

Develop DebugBug Test DebugBug

DeliverFeedback

Storyboard

FeedbackBuild repo& dev env

Test

Feedback

Develop Buildstag env

DeliverFeedback

Debug/Refactor

DeliverFeedback

Bug Bug Bug

DebugDay 2: Deliver & Feedback

Page 23: From naive to agile - software engineering approach

Agile

● The Good– Able to use debug tools

– Find bug earlier

– Non-blocking dev

● The Best– Get most covers for

bugs/security holes/low-quality code

● The Bad– Have to learn & setup version control

– Have to learn DB migration tools

– Have to make seed data

– Have to write test code

– Have to learn Vagrant/Docker

– Have to learn IT Auto/Config Mngmnt

– Large Low upfront cost and delayed early feedback

– Environment Consistency

– Blocking others delivery

● The Worst– Learn most about CI and deployment

– Get more less lags on your delivery (hours)

– e.g. my latest rails project

Page 24: From naive to agile - software engineering approach

Agile

● The Good– Able to use debug tools

– Find bug earlier

– Non-blocking dev

– Low upfront cost and early feedback

● The Best– Get most covers for

bugs/security holes/low-quality code

● The Bad– Have to learn & setup version control

– Have to learn DB migration tools

– Have to make seed data

– Have to write test code

– Have to learn Vagrant/Docker

– Have to learn IT Auto/Config Mngmnt

– Environment Consistency

– Blocking others delivery

– Get less lags on your delivery (hours)

● The Worst– Learn most about CI and deployment

Should NOT be a problem

Page 25: From naive to agile - software engineering approach

Agile

● The Good– Able to use debug tools

– Find bug earlier

– Non-blocking dev

– Low upfront cost and early feedback

● The Best– Get most covers for

bugs/security holes/low-quality code

● The Bad

– Have to make seed data

– Have to write test code

– Environment Consistency

– Blocking others delivery

– Get less lags on your delivery (hours)

Page 26: From naive to agile - software engineering approach

Rails

● Php– Flyway

– N/A

– PhpUnit

– Cucumber

– N/A

– ...

– Fabric

– N/A

● Rails– Rake db

– Rake asset

– Rspec

– Cucumber

– Brakeman

– Rubocop

– Capistrano

– Byebug

Page 27: From naive to agile - software engineering approach

Conclusion

● No Best. find the one fits your needs

Page 28: From naive to agile - software engineering approach

My case

● MockingBird● Ruby on Rails● Vagrant● RVM● Cucumber● Rspec● Brakeman● Rubocop

● Chef● Kitchen-ec2● Nginx● Passenger● MariaDB● Gitlab● Capistrano● Jenkins● Staging & Prod in one box

Page 29: From naive to agile - software engineering approach

Thank You

Questions?