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

Testing Android with Open Source

Testing Android with Open Source

Matthias Käppler

February 22, 2010
Tweet

More Decks by Matthias Käppler

Other Decks in Programming

Transcript

  1. Testing Android
    Testing Android
    with
    with Open Source
    Open Source
    ~ Matthias Käppler ~
    ~ Matthias Käppler ~
    February 23rd, 2010

    View Slide

  2. 1h Workshop
    1h Workshop
    (1) Writing Android tests 5m
    (2) Writing Android tests: Example 15m
    (3) Build management / Maven 5m
    (4) Build management / Maven: Example 15m
    (5) Build automation / Hudson 5m
    (6) Build automation / Hudson: Example 15m

    View Slide

  3. Europe's leading local review site
    17M uniques
    I'm the Android guy at Qype.com!

    View Slide

  4. Android testing
    Android testing
    How do we write tests for Android?

    View Slide

  5. Android testing
    Android testing
    As usual! Android uses JUnit 3
    android.test:
    AndroidTestCase < junit.framework.TestCase
    InstrumentationTestCase < junit.framework.TestCase

    View Slide

  6. Android testing
    Android testing
    AndroidTestCase
    ApplicationTestCase
    ProviderTestCase2
    ServiceTestCase

    View Slide

  7. Android testing
    Android testing
    InstrumentationTestCase
    (SyncBaseInstrumentation)
    (SingleLaunchActivityTestCase)
    ActivityUnitTestCase
    ActivityInstrumentationTestCase2

    View Slide

  8. Android testing
    Android testing
    How do we run tests for Android?

    View Slide

  9. Android testing
    Android testing
    Using Instrumentation.

    View Slide

  10. Android testing
    Android testing
    Work it!

    View Slide

  11. Build management
    Build management
    Nice, we have tests now.
    But my build server
    doesn't click buttons.

    View Slide

  12. Build management
    Build management
    We need something that can run
    builds from the command line.

    View Slide

  13. Build management
    Build management
    Maven 2 does these sorts of things.
    (and MUCH more, in fact)

    View Slide

  14. Build management
    Build management
    Maven 2 is a build system.

    View Slide

  15. Build management
    Build management
    Maven 2 is a dependency
    management system.

    View Slide

  16. Build management
    Build management
    Maven 2 is a life-cycle
    management system.

    View Slide

  17. Build management
    Build management
    Maven 2 is a report and
    documentation generator.

    View Slide

  18. Build management
    Build management
    In fact: Maven 2 is a platform.

    View Slide

  19. Build management
    Build management
    There's a plugin for Android!
    maven-android-plugin

    View Slide

  20. Build management
    Build management
    Maven's central notion is the project.
    It's described by the POM.

    View Slide

  21. Android testing
    Android testing
    Let's have a look at one...

    View Slide

  22. Build automation
    Build automation
    Nice, we can now build and deploy our
    app from the command line.
    But we still have to do it manually.

    View Slide

  23. Build automation
    Build automation
    What we need is a build server, which
    automatically triggers builds.

    View Slide

  24. Build automation
    Build automation
    Hudson does these sorts of things.

    View Slide

  25. Build automation
    Build automation
    Hudson is a continuuous integration server. It can
    run builds when people commit pieces of work.
    This is extremely helpful for discovering
    software regressions early on.

    View Slide

  26. Build automation
    Build automation
    Hudson is a Java Web application.
    It consists of a single WAR.
    $ java -jar hudson.war

    View Slide

  27. Build automation
    Build automation
    Let's run it.

    View Slide

  28. More information
    More information
    maven.apache.org
    code.google.com/p/maven-android-plugin
    hudson-ci.org

    View Slide