Nov 2013
25 Mon
26 Tue
27 Wed
28 Thu 10:45 AM – 05:30 PM IST
29 Fri 10:45 AM – 06:45 PM IST
30 Sat
1 Sun
This workshop is for giving an overview on how to write faster, maintainable and behavioural tests using Robolectric, an Android Unit Testing Framework. At the end of the session, the attendees should be able to:
Android SDK comes with a testing framework called Android Instrumentation Runner which is written on top of JUnit. The problem with it is that it is slow as it requires dexing (i.e. converting into Dalvik Executable), packaging and installing on the actual device or emulator. This can become a bottleneck as unit tests are expected to run fast.
Running the tests in the JVM is not possible by just mocking because, the actual class definitions are available only in Dalvik and not in android.jar which the SDK provides. The android.jar throws RuntimeException for all the methods, and its tough to mock or extend because of the way the Android SDK is designed.
Robolectric on the other hand has rewritten Android SDK classes so they can run in the JVM. It also handles inflation of views (i.e. creating views from the xml file), resource loading, and lots of other stuff that’s implemented in native C code on Android devices. This allows tests to do most things you could do on a real device. It’s easy to provide our own implementation for specific SDK methods too, if needed.
The workshop is intended for anyone who wants to write Android Unit Tests as FIRST (Fast, Isolated, Repeatable, Self-Veifying and Timely)
Leena is the Head of Engineering @ Multunus. She was bitten by the TDD bug a couple of years ago. Since then she’s moved onto Continuous Delivery (CD) in a big way - even spoke about CD at DroidCon India 2011 and AgileIndia 2012. Having done enough TDD in Ruby/Rails, Javascript/Backbone/Angular - she’s now keen on conquering the Android world.
Krishnaprasad, alias KP, is the Senior Software Architect @ Multunus. His technical expertise ranges from J2EE, Ruby On Rails on the Webapp technologies to Android Native and Hybrid apps. He is a big fan of TDD too. He has also spoken at Droidcon India 2011. He is all set to educate the world with his knowledge about the Android universe.
Hosted by
{{ gettext('Login to leave a comment') }}
{{ gettext('Post a comment…') }}{{ errorMsg }}
{{ gettext('No comments posted yet') }}