34
testdouble/suture 2016/10/26 Shinjuku.rb #42 @treby006

reading suture

  • Upload
    treby

  • View
    204

  • Download
    0

Embed Size (px)

Citation preview

Page 1: reading suture

testdouble/suture2016/10/26 Shinjuku.rb #42 @treby006

Page 2: reading suture

• Hiroaki Ninomiya / treby (@treby006)

• Web (2016.7 )

• Shinjuku.rb

• Rails Vue.js Django

Page 3: reading suture

Rails, InfluxDB(Heroku)Ruby (Sakura VPS)

( )

Page 4: reading suture

• 12/17(Sat)@

• https://github.com/imas/hackathon

Page 5: reading suture

http://lineblog.me/treby

Page 6: reading suture

• Code Analysis and Metrics

• testdouble/suture

• → gem

• gem

Page 7: reading suture

testdouble/suture

• gem

• suture ……

• RubyKaigi2016 searl

Page 8: reading suture

suture

1. (seam)

2.

3.

4.

5.

Page 9: reading suture

(1), (2) /

• (Seam) • • •

Page 10: reading suture

(1), (2) /

Page 11: reading suture

(3)

Page 12: reading suture

(3)

SUTURE_RECORD_CALLS=true

SQLite

Page 13: reading suture

(3)

record in/out

Page 14: reading suture

(4)

record in/out

Page 15: reading suture

(5)

write new code

Page 16: reading suture

(5)

Page 17: reading suture

(5)

verify in/out

Page 18: reading suture

(5)

• raise_on_result_mismatch: false

• return_old_on_result_mismatch

(default false)

Page 19: reading suture
Page 20: reading suture

Glided Rose kata

• https://github.com/testdouble/suture/tree/master/example/rails_app

Page 21: reading suture

Gem

• create

• verify

• delete

• config

• reset

Page 22: reading suture

Suture.create

• suture

• plan surgeon

• plan ……

• surgeon …… strategy

Page 23: reading suture

Suture.create

Page 24: reading suture

Suture.create

• create

• BuildsPlan

• ValidatesPlan

• ChoosesSurgeon

• PerformsSurgery

Page 25: reading suture

create -

1. BuildsPlan -> ValidatesPlan (1)

2. ChoosesSurgeon (3)

3. PerformSurgery (2)

Page 26: reading suture

create - BuildsPlan

• config

• ValidatesPlan

Page 27: reading suture

create - PerformSurgery

• ChoosesSurgeon( ) surgeon

operate

• Strategy

Page 28: reading suture

create - ChoosesSurgeon

• …… plan Strategy

• 4 surgeon

• Observer

• Auditor

• Remediator

• NoOp

Page 29: reading suture

Scalpel

• surgeon

• plan location(old/new)

Page 30: reading suture

surgeon - Observer

• dictaphone( )

• Scalpel cut record

Image from https://commons.wikimedia.org/wiki/File:2007-12-29_Sony_dictaphone_M-727V.jpg

Page 31: reading suture

surgeon - Auditor

Page 32: reading suture

surgeon - Remediator

Page 33: reading suture

surgeon - NoOp

Page 34: reading suture

• gem

• suture

• gem