Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
@kfirondev
Scala from the Trenches
@kfirondev
Introduction to TDD and clean code
Kfir Bloch
Head of Backend Engineering
@kfirondev
KFIR BLOCH
● Head of backend engineering @ Wix
● Hands-on developer above 17 years
● Joined Wix 5 years ago
lin...
@kfirondev
BASICS
@kfirondev@kfirondev
THE ESSENCE
OF TDD
REFACTOR
MAKE THE
TEST PASS
WRITE A
FAILING TEST
@kfirondev@kfirondev
Great software is something to marvel at:
powerful, elegant, functional, a pleasure to work
with as b...
@kfirondev@kfirondev
TDD is based on a simple idea:
Write tests for your code before you write the
code itself. However, t...
@kfirondev@kfirondev
Unit Test FakesCollaborators
Stubs
Matchers
Integration
Tests
Mocks
Contract
tests
www.maplecityrubbe...
@kfirondev
USE
CASE
@kfirondev@kfirondev
Get - prize Get - prize
OK OK
Get - prize Get - prize
Already wonAlready played
Get - prize
Get - pri...
@kfirondev@kfirondev
Get - prize Get - prize
OK OK
Get - prize
Already played
Get - prize
Get - prize
Get - prize
Get - pr...
@kfirondev
LET’S
CODE
@kfirondev
• TDD & Clean code definitions
• DOS attack use case
• Developed rolling window throttler
• Wire the throttler ...
@kfirondev
• ~120 backend developers
• Zero QA engineers
• ~100 deployments per day
It works for us
projectlifemastery.com
@kfirondev
• Throttler code ->
https://github.com/kfiron/tdd-clean-code-workshop-result
• Demo app code ->
https://github....
@kfirondev
linkedin/in/blochkfir github.com/kfiron@kfirondevkfirb@wix.com
Kfir Bloch
Head of Backend Engineering
Q&A
@kfirondev
Thank YouWix Engineering Blog
http://engineering.wix.com/
We are hiring
http://jobs.wix.com
email
jobs@wix.com
...
Upcoming SlideShare
Loading in …5
×

Scala from the Trenches - Java One 2016

196 views

Published on

My live coding in Java one

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Scala from the Trenches - Java One 2016

  1. 1. @kfirondev Scala from the Trenches @kfirondev Introduction to TDD and clean code Kfir Bloch Head of Backend Engineering
  2. 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
  3. 3. @kfirondev BASICS
  4. 4. @kfirondev@kfirondev THE ESSENCE OF TDD REFACTOR MAKE THE TEST PASS WRITE A FAILING TEST
  5. 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. 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. “ “
  7. 7. @kfirondev@kfirondev Unit Test FakesCollaborators Stubs Matchers Integration Tests Mocks Contract tests www.maplecityrubber.com TDD & CLEAN CODE “BUZZWORDS” Refactoring
  8. 8. @kfirondev USE CASE
  9. 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. 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
  11. 11. @kfirondev LET’S CODE
  12. 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. 13. @kfirondev • ~120 backend developers • Zero QA engineers • ~100 deployments per day It works for us projectlifemastery.com
  14. 14. @kfirondev • Throttler code -> https://github.com/kfiron/tdd-clean-code-workshop-result • Demo app code -> https://github.com/kfiron/java-one-demo-app Resources github.com/kfiron
  15. 15. @kfirondev linkedin/in/blochkfir github.com/kfiron@kfirondevkfirb@wix.com Kfir Bloch Head of Backend Engineering Q&A
  16. 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

×