Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Inside Android Testing

Inside Android Testing

Introduction to Android testing explaining existent tools and good practices. Source code examples as well.

Fernando Cejas

October 11, 2013
Tweet

More Decks by Fernando Cejas

Other Decks in Programming

Transcript

  1. Who am I? •  GDG Organizer •  Android, Agile and

    technology Geek •  NFC Actions App •  Mobile Developer @fernando_cejas http://www.fernandocejas.com/
  2. Agenda •  Why testing? •  Types of tests •  What

    to test on Android •  Tools for testing – JUnit – Mockito – Robolectric – Test Framework  
  3. Why testing? •  Testing increases the level of confidence in

    your code. •  Testing makes it possible to write new code, and refactor existing code, without worrying that you’ve broken existing functionality.
  4. JUnit •  JUnit is an open source framework that has

    been designed for the purpose of writing and running unit tests in Java.
  5. Mockito •  Mocking Frameworks allow us to test the code

    you want, without its dependencies. •  Mock objects can simulate the behaviour of complex objects. •  Mock objects isolate the unit of code you are testing.
  6. Robolectric •  Robolectric is a unit test framework that de-fangs

    the Android SDK jar so you can test-drive the development of your Android app. •  It rewrites Android SDK classes as they're being loaded and making it possible for them to run on a regular JVM.
  7. Android Test Framework •  Offered by the android framework. • 

    Needs an emulator to execute the tests •  Lets write unit, integration and functional tests. •  Has its own mocking framework
  8. More tools… •  Fest •  Spoon •  Robotium •  UI

    Automator •  Monkey Runner •  Strict Mode