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
Test-Driven Development
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Sam Starling
December 07, 2012
Programming
150
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Test-Driven Development
Sam Starling
December 07, 2012
More Decks by Sam Starling
See All by Sam Starling
Dashing
samstarling
0
92
Scala Patterns in the Linked Data Writer
samstarling
0
120
University of Manchester – Careers Talk
samstarling
0
99
Other Decks in Programming
See All in Programming
AmebaブログはKMPから卒業します
kmars0605
0
180
機械に任せるテスト、人が見るテスト ⽣成AIで引き直した、運⽤保守フェーズの線引き
dske104
0
190
sbt 2.0: takeoff
eed3si9n
0
160
自サークルのIdPからログアウトできるようになるまで
taiseiue
1
140
ChromeでローカルLLM
ryu1013
0
140
カツオ、ご期待ください
suneo3476
0
190
Event is what happens
moro
2
770
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
180
contenteditable と日本語入力に向き合う
colorful12
0
200
なぜCTOを降りてFDEを選んだのか?〜なぜプロダクト企業がFDEで顧客の現場に踏み込むのか〜
gonta
1
210
Railsのためのパスキー実践入門 〜マルチテナントSaaSでの意思決定〜
utakaha
2
540
Unity6 URPによる海底をテーマにしたVJシステムの解説 | Unity Shader 完全に理解した 勉強会
gam0022
0
370
Featured
See All Featured
16th Malabo Montpellier Forum Presentation
akademiya2063
PRO
0
410
Java REST API Framework Comparison - PWX 2021
mraible
34
9.8k
A Guide to Academic Writing Using Generative AI - A Workshop
ks91
PRO
1
520
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
6
1.2k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
38
3.1k
HDC tutorial
michielstock
2
960
Building a A Zero-Code AI SEO Workflow
portentint
PRO
0
780
Noah Learner - AI + Me: how we built a GSC Bulk Export data pipeline
techseoconnect
PRO
0
460
Exploring anti-patterns in Rails
aemeredith
4
540
Building Better People: How to give real-time feedback that sticks.
wjessup
370
20k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
22k
New Earth Scene 8
popppiees
4
2.7k
Transcript
Sam Starling, BBC Future Media Test-Driven Development
Does it work the way it should? Have I broken
anything on the way? Is this task done yet?
Does it work the way it should? Have I broken
anything on the way? Is this task done yet?
Does it work the way it should? Have I broken
anything on the way? Is this task done yet?
Have I done everything I needed to? Does everything I’ve
done still work? Can I go to the pub yet?
Have I done everything I needed to? Does everything I’ve
done still work? Can I go to the pub yet?
Have I done everything I needed to? Does everything I’ve
done still work? Can I go to the pub yet?
How do you test-drive code?
RED Write a failing test GREEN Make the test pass
REFACTOR Make any changes
Why do you test-drive code?
1: Confidence
2: Documentation
function sum(a, b) { return a + b }
public function getBeacon($seedRandom = false) { // toggle a seeded
random number for unit testing if ($seedRandom) { mt_srand(0); } $beaconTokens = array( 's' => 'News', 't' => ($this->getBeaconToken() ?: 0), 'i' => ($this->getAssetId() ?: 0), 'p' => ($this->getSectionId() ?: 0), 'a' => ($this->getEdition() ?: 0), 'u' => ($this->getAsseturi() ?: 0), 'r' => 0, // http_referrer 'q' => 0, // query_string 'z' => mt_rand(1, 10000)); foreach ($beaconTokens as $key => $value) { $this->beacon .= sprintf('~RS~%s~RS~%s', $key, $value); } return $this->beacon . '~RS~'; }
itStoresABeaconValue() itUpdatesABeaconValue() itCanOverrideABeaconValue() ...
3: Coupling & Cohesion
4: Cleaner Code
Growing Object-Oriented Software Guided by Tests
It’s a skill! Learn it by using it
bbc.co.uk/jobs/digitalmediascheme Graduate Scheme
[email protected]