Droid con 2013 workshop unit testing in android [robolectirc]
1. Unit Testing
Android Applications
Multunus Software Pvt. Ltd.
Leena SN
Krishnaprasad R
Agile Software Development
Head of Engineering
Software Architect
@multunus
@leenasn
@krikrn
6. Mocking is Hard because..
● Google has stripped all the classes with
android.jar with RuntimeException(“Stub”)
● Most classes and methods are final
● Non public constructors
● Lack of interfaces
● Many static methods
9. How it works
● Emulates Android SDK, modified to run it on
JVM Using
○ Shadow Objects
○ View and Resource Loading
10. What is Special
● Extending Robolectric is easy too
● Awesome Community Support
11. What Robolectric is NOT
● Never runs on actual device as it emulates
the environment
● It can test small units, so can not replace
automated integration tests
● The above are for purpose :)