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
Testing @socialstudios.tv
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Ran Tavory
December 27, 2012
Programming
0
110
Testing @socialstudios.tv
An introduction talk to testing.
Really high level. Some best practices etc.
Python and JavaScript
Ran Tavory
December 27, 2012
Tweet
Share
More Decks by Ran Tavory
See All by Ran Tavory
go-grpc-channelz: a Go based UI for gRPC's channelz
rantav
0
630
Code Review (Navy Hackathon)
rantav
0
93
Infrastructure Testing Using Kubernetes And Golang
rantav
0
110
Infrastructure testing using Kubernetes
rantav
0
570
Interview Workshop - Technical Questions
rantav
0
360
Code Review Best Practices
rantav
0
110
Code Review @ AppsFlyer
rantav
0
100
GraphQL at Yodas
rantav
2
180
Git for champs
rantav
0
170
Other Decks in Programming
See All in Programming
2026年 エンジニアリング自己学習法
yumechi
0
130
CSC307 Lecture 03
javiergs
PRO
1
490
CSC307 Lecture 08
javiergs
PRO
0
670
AIで開発はどれくらい加速したのか?AIエージェントによるコード生成を、現場の評価と研究開発の評価の両面からdeep diveしてみる
daisuketakeda
1
2.5k
Honoを使ったリモートMCPサーバでAIツールとの連携を加速させる!
tosuri13
1
180
開発者から情シスまで - 多様なユーザー層に届けるAPI提供戦略 / Postman API Night Okinawa 2026 Winter
tasshi
0
200
プロダクトオーナーから見たSOC2 _SOC2ゆるミートアップ#2
kekekenta
0
210
humanlayerのブログから学ぶ、良いCLAUDE.mdの書き方
tsukamoto1783
0
190
AI によるインシデント初動調査の自動化を行う AI インシデントコマンダーを作った話
azukiazusa1
1
720
OCaml 5でモダンな並列プログラミングを Enjoyしよう!
haochenx
0
140
React 19でつくる「気持ちいいUI」- 楽観的UIのすすめ
himorishige
11
7.4k
Oxlintはいいぞ
yug1224
5
1.3k
Featured
See All Featured
Information Architects: The Missing Link in Design Systems
soysaucechin
0
770
The Director’s Chair: Orchestrating AI for Truly Effective Learning
tmiket
1
96
New Earth Scene 8
popppiees
1
1.5k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
37
6.3k
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
Reflections from 52 weeks, 52 projects
jeffersonlam
356
21k
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
2.3k
Unsuck your backbone
ammeep
671
58k
DBのスキルで生き残る技術 - AI時代におけるテーブル設計の勘所
soudai
PRO
62
49k
A brief & incomplete history of UX Design for the World Wide Web: 1989–2019
jct
1
300
エンジニアに許された特別な時間の終わり
watany
106
230k
Exploring the relationship between traditional SERPs and Gen AI search
raygrieselhuber
PRO
2
3.6k
Transcript
Testing @socialstudios.tv Thursday, December 27, 12
Debugging Sucks Testing Rocks Thursday, December 27, 12
Types of tests unit tests functional tests integration tests behavioral
tests UI testing monkey testing stress testing smoke testing usability testing production testing ... Thursday, December 27, 12
Today’s Focus: Unit Tests Thursday, December 27, 12
The nice thing Testable == Readable == Reusable == Documented
== Modular == Robust == Maintainable Thursday, December 27, 12
Observation: Tests == Documentation Good tests document the code they
are testing If the test passes ⇒ Documentation is up to date They also server as examples Thursday, December 27, 12
TDD 1. Write test first 2. Test fails 3. Write
code 4. Test passes 5. Commit Red - Green testing Thursday, December 27, 12
Good tests are Repeatable Fast Short Test only one thing
High coverage Thursday, December 27, 12
Bad test are Slow Depend on externals (fb, other websites,
db) Require a lot of setup Sometimes pass, sometimes fail Produce a lot of output Have exceptions in the log Thursday, December 27, 12
Side Effects are hard to test Good: def f(x): return
x * 2 Bad: def g(x): self.y = x * 2 Thursday, December 27, 12
Hard to test global variables current time / timing dependent
impl untested assumption (such as file load ordering) External state (database) Thursday, December 27, 12
External dependencies How do you test facebook? How do you
test a DAO (data access object) Thursday, December 27, 12
Mocks Use mocks (spies) instead of externals Thursday, December 27,
12
UI Testing It’s hard ⇒ only if you must! Use
selenium? We have to think about this... Thursday, December 27, 12
JavaScript: Jasmine Thursday, December 27, 12
Python: unittest2 + nose Thursday, December 27, 12
CI Server I’ll work on it... Thursday, December 27, 12
test.sh A single file to run them all Thursday, December
27, 12
Every Commit must be tested New code: TDD or not
it’s your choice. But you have to submit tested code Legacy code: First wrap with tests Then modify Thursday, December 27, 12
Resources http://googletesting.blogspot.com http://docs.python.org/2/library/ doctest.html http://pivotal.github.com/jasmine/ http://www.voidspace.org.uk/python/ mock/ Thursday, December 27,
12