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
8
4.7k
残して価値のあるテスト設計 / Test design by specification map
#gotanda.rb 第37回目 で発表したスライドです。
Yuji Imagawa
June 26, 2019
Tweet
Share
More Decks by Yuji Imagawa
See All by Yuji Imagawa
Web開発とその前にある大きな断崖と人生設計について / The difficulty of development and life plan of engineer
ug23
0
370
Other Decks in Programming
See All in Programming
Laravel や Symfony で手っ取り早く OpenAPI のドキュメントを作成する
azuki
2
120
Modular Monolith Monorepo ~シンプルさを保ちながらmonorepoのメリットを最大化する~
yuisakamoto
2
130
카카오페이는 어떻게 수천만 결제를 처리할까? 우아한 결제 분산락 노하우
kakao
PRO
0
110
EMになってからチームの成果を最大化するために取り組んだこと/ Maximize team performance as EM
nashiusagi
0
100
アジャイルを支えるテストアーキテクチャ設計/Test Architecting for Agile
goyoki
9
3.3k
NSOutlineView何もわからん:( 前編 / I Don't Understand About NSOutlineView :( Pt. 1
usagimaru
0
340
Kaigi on Rails 2024 〜運営の裏側〜
krpk1900
1
240
Enabling DevOps and Team Topologies Through Architecture: Architecting for Fast Flow
cer
PRO
0
340
Nurturing OpenJDK distribution: Eclipse Temurin Success History and plan
ivargrimstad
0
990
Macとオーディオ再生 2024/11/02
yusukeito
0
380
3 Effective Rules for Using Signals in Angular
manfredsteyer
PRO
0
120
どうして僕の作ったクラスが手続き型と言われなきゃいけないんですか
akikogoto
1
120
Featured
See All Featured
Automating Front-end Workflow
addyosmani
1366
200k
jQuery: Nuts, Bolts and Bling
dougneiner
61
7.5k
Into the Great Unknown - MozCon
thekraken
32
1.5k
Large-scale JavaScript Application Architecture
addyosmani
510
110k
Bash Introduction
62gerente
608
210k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
Put a Button on it: Removing Barriers to Going Fast.
kastner
59
3.5k
GraphQLとの向き合い方2022年版
quramy
43
13k
Agile that works and the tools we love
rasmusluckow
327
21k
Java REST API Framework Comparison - PWX 2021
mraible
PRO
28
8.2k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
665
120k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
27
840
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ςετέʔεʹ
མͱ͠ࠐΜͰ͍·͢