infinum android talks #19 - stop wasting time fixing bugs with tdd by domagoj korman

27
We're an independent design & development agency.

Upload: infinum

Post on 19-Feb-2017

112 views

Category:

Software


2 download

TRANSCRIPT

Page 1: Infinum Android Talks #19 - Stop wasting time fixing bugs with TDD by Domagoj Korman

We're an independent design & development agency.

Page 2: Infinum Android Talks #19 - Stop wasting time fixing bugs with TDD by Domagoj Korman

Stop wasting time fixing bugs with TDD

DOMAGOJ KORMAN

Page 3: Infinum Android Talks #19 - Stop wasting time fixing bugs with TDD by Domagoj Korman

PROBLEMS

Page 4: Infinum Android Talks #19 - Stop wasting time fixing bugs with TDD by Domagoj Korman
Page 5: Infinum Android Talks #19 - Stop wasting time fixing bugs with TDD by Domagoj Korman
Page 6: Infinum Android Talks #19 - Stop wasting time fixing bugs with TDD by Domagoj Korman
Page 7: Infinum Android Talks #19 - Stop wasting time fixing bugs with TDD by Domagoj Korman

SOLUTION

Page 8: Infinum Android Talks #19 - Stop wasting time fixing bugs with TDD by Domagoj Korman
Page 9: Infinum Android Talks #19 - Stop wasting time fixing bugs with TDD by Domagoj Korman
Page 10: Infinum Android Talks #19 - Stop wasting time fixing bugs with TDD by Domagoj Korman

WHAT WE USE

Page 11: Infinum Android Talks #19 - Stop wasting time fixing bugs with TDD by Domagoj Korman

Robolectric - mocks Android

Mock Web Server - web server for testing

Dagger - dependency injection

Page 12: Infinum Android Talks #19 - Stop wasting time fixing bugs with TDD by Domagoj Korman

THE NOOB

Page 13: Infinum Android Talks #19 - Stop wasting time fixing bugs with TDD by Domagoj Korman

Several months of experience

Never wrote a single Robolectric test

Robolectric was black magic

Page 14: Infinum Android Talks #19 - Stop wasting time fixing bugs with TDD by Domagoj Korman

“Hey Domagoj! You are starting on a new project

next week. Do you want to learn to write tests?”

Page 15: Infinum Android Talks #19 - Stop wasting time fixing bugs with TDD by Domagoj Korman

“Hey Domagoj! You are starting on a new project

next week and you will have to write tests.”

Page 16: Infinum Android Talks #19 - Stop wasting time fixing bugs with TDD by Domagoj Korman

PROJECT SPECIFICS

Dynamic layout based on API responses

Multiple user types

API still not ready

Page 17: Infinum Android Talks #19 - Stop wasting time fixing bugs with TDD by Domagoj Korman

FRUSTRATION BEGINS

How to setup Dagger for tests?

How to setup Robolectric?

How to write tests?

Page 18: Infinum Android Talks #19 - Stop wasting time fixing bugs with TDD by Domagoj Korman
Page 19: Infinum Android Talks #19 - Stop wasting time fixing bugs with TDD by Domagoj Korman

THE ENLIGHTENMENT

Page 20: Infinum Android Talks #19 - Stop wasting time fixing bugs with TDD by Domagoj Korman

HOW DID I DO IT?

1) Create layout 2) Write tests 3) Write application logic 4) Fix layouts 5) Profit

Page 21: Infinum Android Talks #19 - Stop wasting time fixing bugs with TDD by Domagoj Korman
Page 22: Infinum Android Talks #19 - Stop wasting time fixing bugs with TDD by Domagoj Korman
Page 23: Infinum Android Talks #19 - Stop wasting time fixing bugs with TDD by Domagoj Korman
Page 24: Infinum Android Talks #19 - Stop wasting time fixing bugs with TDD by Domagoj Korman
Page 25: Infinum Android Talks #19 - Stop wasting time fixing bugs with TDD by Domagoj Korman

REQUIREMENTS

Experience

API specification

Will to learn Robolectric

Page 26: Infinum Android Talks #19 - Stop wasting time fixing bugs with TDD by Domagoj Korman

TDD BEGINS

You can debug tests!

You can mock all possible responses!

You can test any screen in a matter of seconds!

Page 27: Infinum Android Talks #19 - Stop wasting time fixing bugs with TDD by Domagoj Korman

Any questions? [email protected]

Visit infinum.co or find us on social networks:

infinum.co infinumco infinumco infinum