Test Driven in Mobile Application
Development
Nggak Confidance
dengan aplikasinya sendiri?
Break pada fungsi yang lain?
Rumit dengna coding-an
sendiri
Traditional vs Test driven development cycle
design test code
test code design
test code refactor
Traditional
Test driven
development
VS
Lasse Koskela
Delivering the required functionality
- more time for cleaning up our code base
- getting up to speed the latest development in tools an technology
- more time to imporve quality, confidence and speed
Running tests on an Android
emulator or device is slow!
Building, deploying, and launching
the app often takes a minute or
more. That’s no way to do TDD.
There must be a better way.
Android instrumentation test are slow
Robolectric is a unit test framework that de-fangs the Android SDK jar so you can
test-drive the development of your Android app. Tests run inside the JVM on your
workstation in seconds
Java
Project
Android.jar
Robolectric
.xxx.jar
Run Tests Outside of the Emulator
No Dexing
No Packaging
● Iterate quickly
● Write black box style of teste
● Test behaviour instead of implementation
Robolectric lets us..........
Study Case!!
Requirement
User bisa menjumlah dan mengurangkan dua angka.
User juga bisa meliat halaman about
✔ input,button and output should not be null
✔ set default input1 and input2 as zero
✔ perform plus action
✔ perform minus action
✔ perform go to about page
To be tested
LIVE CODE!!
Set up envionment
create android project
create java project

Android Test Driven Development