Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
残して価値のあるテスト設計 / Test design by specification map
Search
Yuji Imagawa
June 26, 2019
Programming
5k
8
Share
残して価値のあるテスト設計 / Test design by specification map
#gotanda.rb 第37回目 で発表したスライドです。
Yuji Imagawa
June 26, 2019
More Decks by Yuji Imagawa
See All by Yuji Imagawa
Web開発とその前にある大きな断崖と人生設計について / The difficulty of development and life plan of engineer
ug23
0
440
Other Decks in Programming
See All in Programming
AgentCore Optimizationを始めよう!
licux
3
200
Building on Bluesky's AT Protocol with Ruby
mackuba
0
100
Spec Driven Development | AI Summit Vilnius
danielsogl
PRO
1
140
HTML-Aware ERB: The Path to Reactive Rendering @ RubyKaigi 2026, Hakodate, Japan
marcoroth
0
640
Import assertionsが消えた日~ECMAScriptの仕様はどう決まり、なぜ覆るのか~
bicstone
2
180
Kubernetesを使わない環境にもCloud Nativeなデプロイを実現する / Enabling Cloud Native deployments without the complexity of Kubernetes
linyows
3
290
Surviving Black Friday: 329 billion requests with Falcon!
ioquatix
0
2.8k
From Formal Specification to Property Based Test
ohbarye
0
710
実用!Hono RPC2026
yodaka
2
300
How We Practice Exploratory Testing in Iterative Development( #scrumniigata ) / 反復開発の中で、探索的テストをどう実施しているか
teyamagu
PRO
3
700
書き換えて学ぶTemporal #fukts
pirosikick
2
350
20260514_its_the_context_window_stupid.pdf
heita
0
430
Featured
See All Featured
Designing Experiences People Love
moore
143
24k
Agile Leadership in an Agile Organization
kimpetersen
PRO
0
140
Java REST API Framework Comparison - PWX 2021
mraible
34
9.3k
Build The Right Thing And Hit Your Dates
maggiecrowley
39
3.1k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
22k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
231
23k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1.3k
Believing is Seeing
oripsolob
1
120
Why Our Code Smells
bkeepers
PRO
340
58k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
1.9k
The Straight Up "How To Draw Better" Workshop
denniskardys
239
140k
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
0
130
Transcript
ͯ͠Ձͷ͋Δ ςετઃܭ 2019-06-26 @ gotanda.rb # 37 Yuji Imagawa (
@ug23_ )
εϚʔτΩϟϯϓͷࠓͰ͢ • ࠓ༟࢜ @ug23_ • ΤϯδχΞ4 • લ৬͕QAΤϯδχΞ • ͍·RailsΔ͠VueΔ͠ΠϯϑϥΔ
• #tddyyχ ͷͳ͔ͷͻͱ • ؾʹͳ͍ͬͯΔ͜ͱ: Sorbet
ࠓि͔ΒΦϑΟεҠస͠·ͨ͠
We are hiring! ࣄۀΛΓ͍ͨΤϯδχΞืूதͰ͢ [εϚʔτΩϟϯϓ ΤϯδχΞ] [ݕࡧ]
ࠓͷςʔϚ RSpec ͱ ςετ
ࢲͷ ςετઃܭͷͷ΄͏͕ ϝΠϯͰ͢
͓͠ͳ͕͖ • QAΤϯδχΞ࣌ͷ • Α͍ͬͯ͘Δςετઃܭ • RSpecʹԠ༻͢Δ
QAΤϯδχΞ࣌ͷ
ςετͷϨϏϡʔ͍͠ • ϨϏϡʔͯ͠ʂͱ͞ΕΔExcel • ্Լʹ͘ηϧ݁߹͞ΕͨΧςΰϦ • ҧ͍͕Θ͔Βͳ͍ࣅͨςετέʔε
ࢥͬͨ͜ͱ Excelͷςετέʔε ϨϏϡʔ͢Δͷ͕͍͠
ࢥͬͨ͜ͱ ExcelʹͳΔલʹϨϏϡʔ͍ͨ͠
ͨͲΓண͍ͨ͑ • ϚΠϯυϚοϓ͔Β࢝ΊΔ ιϑτΣΞςετ • ా ڿ (ஶ), ླ ࡾل
(ஶ) • ϚΠϯυϚοϓͷ ࡉׂ͔͍Ѫ͠·͢
ϚΠϯυϚοϓͷΑ͍ͱ͜Ζ • ॻ͘աఔͰ಄ΛཧͰ͖Δ • ݟΔଆจষΑΓݟ͍͢ • πϦʔͳͷͰࣗͷݟΔతʹΑͬͯ ୳ࡧ๏ΛબͰ͖Δ • ਂ͞༏ઌ
or ෯༏ઌ • ༿·ͰݟΔ or ͋Δ֊͚ͩ͏ ※ޮՌʹݸਓ͕ࠩ͋Γ·͢
Α͍ͬͯ͘Δςετઃܭ
ϚΠϯυϚοϓΛ͍·͢ • ํେ·͔ͳέʔεΛߟ͑Δ࣌ ϚΠϯυϚοϓΛॻ͖·͢ • ޙ͔ΒRSpecॻ࣌͘ͱ͔ɺखಈͷγεςϜςετʹͳΔ߹ • ͚ࣗͩͷͱ͖εέονϒοΫʹ ඳ͖·͕͢Gitʹ͋͛ΒΕͳ͍…
GitͰཧͰ͖ΔϚΠϯυϚοϓΛ࡞Δ • Markdown→ϚΠϯυϚοϓԽ͢Δ • ࣗ Atomͷ Markdown Mindmap Λར༻͍ͯ͠·͢
σϞ
ςετઃܭ༻ϚΠϯυϚοϓͷॻ͖ํ • ֊ߟ͑ͳ͍ • ͷͼͷͼॻ͘ʂ • ը໘ΛΠϝʔδ͍͍ͯ͠͠ Ϋϥεผͷ୯ҐΛΠϝʔδͯ͠ྑ͍ • ༿ͷཁૉ͕1ͭҎ্ͷςετέʔεʹ
ରԠ͢ΔΑ͏ʹॻ͘
͍ํ • ςετέʔεͷϨϏϡʔ࣌ʹ͏ • ৽ϝϯόʔ͕ೖͬͨ࣌ͳͲ ͦͷγεςϜͷ༷Ұཡͱͯ͠ݟͤΔ • ΈΜͳͰख͚ͯ͠ಈ࡞֬ೝ͍ͨ࣌͠ ʮ͜ͷลͬͯʯͱ͔ਤࣔ͢Δ •
ػೳ͕େ͖͘มΘͬͨΒϓϧϦΫग़͢
෭࡞༻ͱͯ͠ γεςϜͷػೳΛࣔͨ͠ ਤʹͳΔ
RSpecʹԠ༻͢Δ
ͦͦRSpec • ͱͱBDDπʔϧ • ࢲୡSpecificationΛॻ͍͍ͯΔ • "rpsec --format documentation" ͱ
࣮ߦͯ͠Έͯ΄͍͠ • ڵຯΛ࣋ͬͨํ ʰςετۦಈ։ൃʱ(ΦʔϜࣾ)ͷC
RSpecΛ༷ॻͰ͋Δ͔ͷΑ͏ʹॻ͖͍ͨ • ςετΛ࣮ߦͯ݁͠ՌΛಡΉͱ ͦͷ෦ͷίʔυͷ༷͕Θ͔ΔΑ͏ʹ ͍͖͍ͯͨ͠ • ͖ͬ͞ͷϚΠϯυϚοϓͱؔ࿈͚Δ
࣮ࡍʹͬͯΈͨ • FizzBuzzͰྫʹͯ͠Έͨ
࣮ • ݟͤ·͢ • Gistʹ͋͛·ͨ͠ • https://gist.github.com/ ug23/9aafd9e7666ffaa9a1aaba3640d6 d5d8
rspec࣮ߦ݁Ռ fizzbuzz indexΛදࣔจࣈྻʹม͢Δ 3ͷഒͷͱ͖Fizz 5ͷഒͷͱ͖Buzz 15ͷഒͷͱ͖FizzBuzz 3ͷഒͰ5ͷഒͰͳ͍ͱ͖ͦͷ·· ग़ྗ͢Δ index:1ͷͱ͖ͷදࣔจࣈྻΛվߦ۠ΓͰඪ४ग़ྗ͢Δ index:15ͷͱ͖ͷදࣔจࣈྻΛվߦ۠ΓΛඪ४ग़ྗ͢Δ
ճ͢Δ 1͔Β100·ͰͰग़ྗ͢Δ
ҙ • ͳʹ͔ΛΞτϓοτ͢Δࡍʹ ϚΠϯυϚοϓΛϕʔεʹ͢ΔΠϝʔδ • ٯ͋·Γߟ͍͑ͯ·ͤΜ ٯʹ໘ʹͳΔ͔͠Ε·ͤΜ • ͬͱ͍͍͍ํ͋Εڭ͍͑ͯͩ͘͞
·ͱΊ
·ͱΊ • ςετઃܭͷखஈͱͯ͠ ϚΠϯυϚοϓΛར༻ͯ͠·͢ • ςετઃܭͷϚΠϯυϚοϓ͕ ͦͷ··ػೳҰཡʹͳͬͯ ͍Ζ͍Ζ͑·͢ • ͦͷ··RSpecςετέʔεʹ
མͱ͠ࠐΜͰ͍·͢