Top Banner
Android test LiMO-TAXI Korea Jung Kyungho
32

Android MVVM TDD

Jul 15, 2015

Download

Engineering

KyungHo Jung
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Android MVVM TDD

Android testLiMO-TAXI Korea Jung Kyungho

Page 2: Android MVVM TDD

Introduce speaker

Page 3: Android MVVM TDD

Android test is difficult.

Page 4: Android MVVM TDD
Page 5: Android MVVM TDD
Page 6: Android MVVM TDD

We can test business logic. How about UI?

Page 7: Android MVVM TDD

But it’s too slow..

Page 8: Android MVVM TDD
Page 9: Android MVVM TDD
Page 10: Android MVVM TDD

I don’t want to be dependent on the view.

Page 11: Android MVVM TDD

I want to write test easily.

Page 12: Android MVVM TDD
Page 13: Android MVVM TDD

frustrated angry

I don’t want to be

Page 14: Android MVVM TDD

I want to be

Page 15: Android MVVM TDD

• I must to divide and conquer.

• I must to reduce dependency.

• I must to make a class for single responsibility.

• I want to make test easily.

Page 16: Android MVVM TDD

Testability(Modular) Architecture

Page 17: Android MVVM TDD
Page 18: Android MVVM TDD

Interface

Module

Page 19: Android MVVM TDD

MVVM(Model View ViewModel)

Page 20: Android MVVM TDD

It has a view reference It has a view referenceTestability!

Page 21: Android MVVM TDD
Page 22: Android MVVM TDD
Page 23: Android MVVM TDD
Page 24: Android MVVM TDD

https://github.com/moltak/android_mvvm_for_pt

Page 25: Android MVVM TDD

Live coding

retrofit

Page 26: Android MVVM TDD

Live coding

Page 27: Android MVVM TDD

Live coding

Page 28: Android MVVM TDD

Live coding

RxJava

Page 29: Android MVVM TDD

http://robobinding.github.io/RoboBinding/

RoboBinding is a data-binding Presentation Model framework for the Android platform. RoboBinding helps you write UI code that is easier to read, test and

maintain.

Page 30: Android MVVM TDD
Page 31: Android MVVM TDD

Views and unit tests are just two different types of ViewModel consumers.

create request notify execute

Page 32: Android MVVM TDD

Reference

https://msdn.microsoft.com/ko-kr/magazine/dd419663.aspx#id0090006

http://martinfowler.com/eaaDev/PresentationModel.html

https://code.google.com/p/hamcrest/wiki/Tutorial

https://github.com/ReactiveX/RxJava/wiki/Blocking-Observable-Operators

https://github.com/ReactiveX/RxAndroid

http://square.github.io/retrofit/

http://jsonplaceholder.typicode.com/users

https://github.com/RoboBinding

http://robobinding.github.io/RoboBinding/getting_started.html

https://github.com/pedrovgs/EffectiveAndroidUI

http://jakewharton.github.io/butterknife/

http://square.github.io/otto/

Books: Effective unit Testing