Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
TDD/BDD
Search
Shintaro Kaneko
October 23, 2014
Programming
130
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
TDD/BDD
Test-Driven Development
Shintaro Kaneko
October 23, 2014
More Decks by Shintaro Kaneko
See All by Shintaro Kaneko
How to keep growing SRE team at Eureka
kaneshin
3
9.8k
Go - CLI Tools Design
kaneshin
0
7.1k
Summer Internship 2018 - The principle of the eureka summer internship 2018
kaneshin
2
140
Summer Internship 2018 - The eureka summer internship 2018
kaneshin
0
150
Summer Internship 2018 - How to develop a product
kaneshin
0
130
How to write Go code
kaneshin
8
8.6k
Go Package Guidelines
kaneshin
1
1.2k
net/http package ~GoConference 2017 Spring~
kaneshin
1
3.1k
Essentials of Golang
kaneshin
5
14k
Other Decks in Programming
See All in Programming
App Storeの外へ──日本のiOSサイドローディング入門 for iOSDC Japan 2026
yuukiw00w
0
170
RSSとCodexを使ってX投稿自動化してみた
ochtum
0
110
ALB ログから Trace を気合で繋げる技術
fohte
7
880
WebMCP Challenge に星空観察アプリで参加した話
okajun35
0
130
初心者DevRelとして参加者だった私が、DevRel Talks!#2に登壇するまでにしてきたこと
sokohirai
0
360
20260914 AIエージェント時代のPlatform Engineering LLM基盤とプロダクトの責務境界線
kanfab1
2
760
How I Stole PSI from Android Studio - DroidKaigi2026
worker8
0
110
[GoCon2026] When Goroutines Are Not Enough: Runtime Locality in High-Throughput Go
takehaya
6
1.9k
個人開発基盤をまるごとCloudflareに引っ越して爆速で総合的体験を向上させた話
tinykitten
0
160
AIの中の人になってみる
htkym
0
170
Deep dive into the select statement (GopherCon UK)
jespino
0
170
思考垂れ流し開発 ~音声入力 × AIエージェント × 開発ハーネスによる試行錯誤~
npostring
0
1.1k
Featured
See All Featured
Paper Plane
katiecoart
PRO
3
53k
The World Runs on Bad Software
bkeepers
PRO
72
12k
DBのスキルで生き残る技術 - AI時代におけるテーブル設計の勘所
soudai
PRO
68
57k
Between Models and Reality
mayunak
4
450
Balancing Empowerment & Direction
lara
6
1.3k
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
270
More Than Pixels: Becoming A User Experience Designer
marktimemedia
3
520
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
270
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
3k
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.5k
What Being in a Rock Band Can Teach Us About Real World SEO
427marketing
0
1.1k
Reflections from 52 weeks, 52 projects
jeffersonlam
356
21k
Transcript
TDD / BDD Introducing with Objective-C using XCTest © kaneshin,
2014 1
Agenda 4 What is TDD? 4 TDD life-cycle 4 How
to play TDD? (Demo) 4 What is BDD? 4 What is the difference between BDD and TDD? 4 How to manipulate BDD? (Demo) © kaneshin, 2014 2
What is TDD? © kaneshin, 2014 3
TDD means Test-Driven Development. 4 Ensure your source code. 4
Understand the feature's specification/s and requirement/s. 4 Easily to adopt Agile for your project. 4 ... © kaneshin, 2014 4
TDD is NOT about testing. 4 TDD is about Development.
4 It's all about expressing intent. 4 Specifically, improving your project. 4 Covering unit tests powerfully. © kaneshin, 2014 5
TDD life-cycle © kaneshin, 2014 6
1. Write a test (Test-First) 2. Run the test (Should
be FAILED) 3. Write code (Make the test pass) 4. Run all tests 5. Refactor (Clean up code) Repeat © kaneshin, 2014 7
1. Write a test and confirm failure 2. Write code
to pass all tests 3. Clean up code Repeat © kaneshin, 2014 8
For example Just Adding Calculator Add A to B ©
kaneshin, 2014 9
Write a test. - (void)testAdd3To4 { Calc *calc = [Calc
new]; XCTAssertEqualWithAccuracy( [calc add:3 to:4], 7, .001 ); } 4 Should be failed on build because there is no implementation. © kaneshin, 2014 10
Write code @interface Calc : NSObject - (double)add:(double)a to:(double)b; @end
@implementation Calc - (double)add:(double)a to:(double)b { return 0.; } @end © kaneshin, 2014 11
Make the test pass @implementation Calc - (double)add:(double)a to:(double)b {
return 7.; } @end 4 Just enough code to pass. © kaneshin, 2014 12
Refine the code @implementation Calc - (double)add:(double)a to:(double)b { return
a + b; } @end 4 Run all tests. © kaneshin, 2014 13
Got it? 4 Memorize the figure 4 Test-First 4 Should
be failed 4 Refactor, Refactor, Refactor © kaneshin, 2014 14
How to play TDD? Demo (Japanese) © kaneshin, 2014 15
Wizard Role-Play ຐ๏͍ͷϩʔϧϓϨΠ © kaneshin, 2014 16
Wizard Spec (ຐ๏͍) 4 Level 1 : ௨ৗ߈ܸ͕Ͱ͖Δ (Attack: 1
Damage) 4 Level 3 : Ϊϥ͕͑Δ (Sizz: 2 Damage) 4 Level 5 : ϝϥϛ͕͑Δ (Frizzle: 2 Damage) 4 Level up ʹExp 30͕ҰͰඞཁ (؆ศͷͨΊ) © kaneshin, 2014 17
Slime Spec (εϥΠϜ) 4 Life: 2, Exp: 10 Goblin Spec
(ΰϒϦϯ) 4 Life: 5, Exp: 30 ※ϞϯελʔҰܦݧΛऔಘ͞ΕΔͱExp0ͱͳΔ © kaneshin, 2014 18
What is BDD? © kaneshin, 2014 19
BDD means Behavior-Driven Development. 4 Basically, it is based on
TDD. © kaneshin, 2014 20
What is the difference between BDD and TDD? © kaneshin,
2014 21
The difference between BDD and TDD? 4 TDD is focused
How on code. 4 Just satisfied spec/s and requirement/s. 4 We wanna confirm a state transition. 4 A State is transitioning every-time. 4 Test-suites might have scenes on conditions. 4 BDD can check the validity of scenes. © kaneshin, 2014 22
How to manipulate BDD? Demo (Japanese) © kaneshin, 2014 23
Thanks © kaneshin, 2014 24