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
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
600
Code Review (Navy Hackathon)
rantav
0
82
Infrastructure Testing Using Kubernetes And Golang
rantav
0
88
Infrastructure testing using Kubernetes
rantav
0
550
Interview Workshop - Technical Questions
rantav
0
330
Code Review Best Practices
rantav
0
90
Code Review @ AppsFlyer
rantav
0
90
GraphQL at Yodas
rantav
2
170
Git for champs
rantav
0
150
Other Decks in Programming
See All in Programming
CSC305 Lecture 06
javiergs
PRO
0
250
uniqueパッケージの内部実装を支えるweak pointerの話
magavel
0
1k
Leading Effective Engineering Teams in the AI Era
addyosmani
7
450
What Spring Developers Should Know About Jakarta EE
ivargrimstad
0
190
bootcamp2025_バックエンド研修_WebAPIサーバ作成.pdf
geniee_inc
0
110
PHPに関数型の魂を宿す〜PHP 8.5 で実現する堅牢なコードとは〜 #phpcon_hiroshima / phpcon-hiroshima-2025
shogogg
1
240
他言語経験者が Golangci-lint を最初のコーディングメンターにした話 / How Golangci-lint Became My First Coding Mentor: A Story from a Polyglot Programmer
uma31
0
200
オープンソースソフトウェアへの解像度🔬
utam0k
16
3k
XP, Testing and ninja testing ZOZ5
m_seki
3
700
Domain-centric? Why Hexagonal, Onion, and Clean Architecture Are Answers to the Wrong Question
olivergierke
3
900
2分台で1500examples完走!爆速CIを支える環境構築術 - Kaigi on Rails 2025
falcon8823
3
3.7k
スマホから Youtube Shortsを見られないようにする
lemolatoon
27
33k
Featured
See All Featured
Faster Mobile Websites
deanohume
310
31k
Site-Speed That Sticks
csswizardry
13
910
Practical Orchestrator
shlominoach
190
11k
Being A Developer After 40
akosma
91
590k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
48
9.7k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
34
2.3k
Writing Fast Ruby
sferik
629
62k
jQuery: Nuts, Bolts and Bling
dougneiner
65
7.9k
The Cult of Friendly URLs
andyhume
79
6.6k
Testing 201, or: Great Expectations
jmmastey
45
7.7k
KATA
mclloyd
32
15k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
230
22k
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