Android MVVM TDD

Preview:

Citation preview

Android testLiMO-TAXI Korea Jung Kyungho

Introduce speaker

Android test is difficult.

We can test business logic. How about UI?

But it’s too slow..

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

I want to write test easily.

frustrated angry

I don’t want to be

I want to be

• 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.

Testability(Modular) Architecture

Interface

Module

MVVM(Model View ViewModel)

It has a view reference It has a view referenceTestability!

https://github.com/moltak/android_mvvm_for_pt

Live coding

retrofit

Live coding

Live coding

Live coding

RxJava

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.

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

create request notify execute

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

Recommended