Scala from the Trenches

12
Kfir Bloch Scala From The Trenches Head of Backend Engineering @ Wix @kfirondev Introduction to TDD and clean code

Transcript of Scala from the Trenches

Page 1: Scala from the Trenches

Kfir Bloch

Scala From The Trenches

Head of Backend Engineering @ Wix @kfirondev

Introduction to TDD and clean code

Page 2: Scala from the Trenches

Kfir Bloch

Your pic here

• Head of backend engineering @ Wix

• 17 years experience as hands-on developer

• Joined Wix 5 years ago linkedin/in/blochkfir github.com/kfiron@[email protected]

Page 3: Scala from the Trenches

Definitions

01

Page 4: Scala from the Trenches

@kfirondev

The essence of TDD

Page 5: Scala from the Trenches

@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

Page 6: Scala from the Trenches

TDD & Clean code “Buzzwords”

Unit Test

Fakes

Collaborators

Stubs Matchers

IntegrationTests

Refactoring

Mocks

Contract tests

www.maplecityrubber.com@kfirondev

Page 7: Scala from the Trenches

Use Case

02

Page 8: Scala from the Trenches

QuizPrize server Database

Get - prizeGet - prize

OKOK

Get - prizeGet - prize

Already played

Already played

Get - prizeGet - prize

Get - prizeGet - prize

Get - prize

Get - prizeGet - prize

Get - prizeGet - prize

Get - prize

Already p.Already p.

Already p.Already p.

Already p.

Already p.Already p.

Already p.Already p.

Already p.

Database

Page 9: Scala from the Trenches

QuizPrize server Database

Get - prizeGet - prize

OKOK

Get - prize

Already played

Get - prizeGet - prize

Get - prizeGet - prize

Get - prizeAlready p.

Already p.Already p.

Already p.Already p.

Fail fast pattern

THROTTLER

Rolling window key (IP) Throttler

Page 10: Scala from the Trenches

Live Coding

03

Page 11: Scala from the Trenches

Q&Alinkedin/in/blochkfir github.com/kfiron@[email protected]

Kfir Bloch

Page 12: Scala from the Trenches

Thank YouWix Engineering Blog http://engineering.wix.com/

We are hiring http://jobs.wix.com

Kfir Bloch @kfirondev

[email protected]