reading suture
Post on 16-Apr-2017
202 Views
Preview:
TRANSCRIPT
testdouble/suture2016/10/26 Shinjuku.rb #42 @treby006
• Hiroaki Ninomiya / treby (@treby006)
• Web (2016.7 )
• Shinjuku.rb
•
• Rails Vue.js Django
Rails, InfluxDB(Heroku)Ruby (Sakura VPS)
( )
• Code Analysis and Metrics
• testdouble/suture
• → gem
• gem
testdouble/suture
• gem
• suture ……
• RubyKaigi2016 searl
•
•
suture
1. (seam)
2.
3.
4.
5.
(1), (2) /
• (Seam) • • •
(1), (2) /
(3)
•
(3)
SUTURE_RECORD_CALLS=true
SQLite
(3)
record in/out
(4)
record in/out
(5)
write new code
(5)
(5)
verify in/out
(5)
•
• raise_on_result_mismatch: false
• return_old_on_result_mismatch
(default false)
Glided Rose kata
•
• https://github.com/testdouble/suture/tree/master/example/rails_app
Gem
•
• create
• verify
• delete
• config
• reset
Suture.create
• suture
• plan surgeon
• plan ……
• surgeon …… strategy
Suture.create
Suture.create
• create
• BuildsPlan
• ValidatesPlan
• ChoosesSurgeon
• PerformsSurgery
create -
1. BuildsPlan -> ValidatesPlan (1)
2. ChoosesSurgeon (3)
3. PerformSurgery (2)
create - BuildsPlan
• config
• ValidatesPlan
create - PerformSurgery
•
• ChoosesSurgeon( ) surgeon
operate
• Strategy
create - ChoosesSurgeon
• …… plan Strategy
• 4 surgeon
• Observer
• Auditor
• Remediator
• NoOp
Scalpel
•
• surgeon
• plan location(old/new)
surgeon - Observer
•
• dictaphone( )
• Scalpel cut record
•
Image from https://commons.wikimedia.org/wiki/File:2007-12-29_Sony_dictaphone_M-727V.jpg
surgeon - Auditor
•
•
•
•
surgeon - Remediator
•
•
•
surgeon - NoOp
•
•
• gem
• suture
• gem
•
top related