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-Driven Development
Search
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
91
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
「寝てても仕事が進む」Claude Codeで組む第二の脳
tomoyafujita2016
0
360
関東Kaggler会_NVIDIA_Nemotron_コンペ_振り返り
rick_ds
0
730
ALB ログから Trace を気合で繋げる技術
fohte
7
740
Hello, Hiroshima Geospatial Data! — Exploring DoboX with Python
ra0kley
0
110
書籍「プロフェッショナルAI駆動開発」紹介スライド
juntaromatsumoto
0
730
【QA Test Talk Vol.8】AI-DLC による Whole Team Approach の加速
pkshadeck
PRO
0
250
コンパウンドプロダクト開発のためのローカルプロセスマネージャー再発明 #layerxgo
izumin5210
0
390
S3 を使うアプリケーションをローカル完結で動かすことに全力を注いでみた / Running S3 Apps Offline
contour_gara
0
660
リアルな遅延を測る仕様
kota_yata
1
130
How I Won Prize Money at a Hackathon Using Codex and Symphony Alpha
yasei_no_otoko
0
130
Claude Code全社展開のためにやったことn選~プラグイン302個・コミッター271人を支えるために~
kenchan
5
1.8k
片田舎のおっさん、 Swift Buildのダイアモンド問題解決の不具合修正PRを出すが、解決方法がキャッシュをしないようにすることであり、ビルド時間が伸びると言われてマージされないので高速化もする/swiftbuild
yimajo
0
300
Featured
See All Featured
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.8k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
22k
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
1
1.3k
Dominate Local Search Results - an insider guide to GBP, reviews, and Local SEO
greggifford
PRO
0
310
Building a Scalable Design System with Sketch
lauravandoore
463
34k
HU Berlin: Industrial-Strength Natural Language Processing with spaCy and Prodigy
inesmontani
PRO
0
670
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
1
6.1k
Kristin Tynski - Automating Marketing Tasks With AI
techseoconnect
PRO
0
480
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
The Anti-SEO Checklist Checklist. Pubcon Cyber Week
ryanjones
0
220
Designing Dashboards & Data Visualisations in Web Apps
destraynor
232
55k
Ethics towards AI in product and experience design
skipperchong
2
350
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]