1. @kfirondev
Scala from the Trenches
@kfirondev
Introduction to TDD and clean code
Kfir Bloch
Head of Backend Engineering
2. @kfirondev
KFIR BLOCH
● Head of backend engineering @ Wix
● Hands-on developer above 17 years
● Joined Wix 5 years ago
linkedin/in/blochkfir github.com/kfiron@kfirondevkfirb@wix.com
5. @kfirondev@kfirondev
Great software is something to marvel at:
powerful, elegant, functional, a pleasure to work
with as both a developer and as a user.
Great software isn’t written by machines.
It is written by professionals with an unshakable
commitment to craftsmanship.
“
“
6. @kfirondev@kfirondev
TDD is based on a simple idea:
Write tests for your code before you write the
code itself. However, this "simple" idea takes
skill and judgment to do well.
Now there's a practical guide to TDD that takes
you beyond the basic concepts.
“
“
9. @kfirondev@kfirondev
Get - prize Get - prize
OK OK
Get - prize Get - prize
Already wonAlready played
Get - prize
Get - prize
Get - prize
Get - prize
Get - prize
Get - prize
Get - prize
Get - prize
Get - prize
Get - prize
Already won
Already won
Already won
Already won
Already won
Already won
Already won
Already won
Already won
Already won
USER QUIZ PRIZE
SERVER
DATABASE
10. @kfirondev@kfirondev
Get - prize Get - prize
OK OK
Get - prize
Already played
Get - prize
Get - prize
Get - prize
Get - prize
Get - prize
Already won
Already won
Already won
Already won
Already won
USER QUIZ PRIZE
SERVER
DATABASE
FAIL FAST PATTERN
T
H
R
O
T
T
L
E
R
ROLLING WINDOW KEY (user-id) THROTTLER
12. @kfirondev
• TDD & Clean code definitions
• DOS attack use case
• Developed rolling window throttler
• Wire the throttler to pre-baked service
Summary of what we did
13. @kfirondev
• ~120 backend developers
• Zero QA engineers
• ~100 deployments per day
It works for us
projectlifemastery.com
16. @kfirondev
Thank YouWix Engineering Blog
http://engineering.wix.com/
We are hiring
http://jobs.wix.com
email
jobs@wix.com
@kfirondev
Kfir Bloch
Head of Backend Engineering
Editor's Notes
The first case is degradation of service
Inspire me and drive how I do TDD
Many people thinks that code before tests, it is just unit tests
I will try to show you some of it in the live coding