Testing AndroidTesting Androidwithwith Open SourceOpen Source~ Matthias Käppler ~~ Matthias Käppler ~February 23rd, 2010
View Slide
1h Workshop1h 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
Europe's leading local review site17M uniquesI'm the Android guy at Qype.com!
Android testingAndroid testingHow do we write tests for Android?
Android testingAndroid testingAs usual! Android uses JUnit 3android.test:AndroidTestCase < junit.framework.TestCaseInstrumentationTestCase < junit.framework.TestCase
Android testingAndroid testingAndroidTestCaseApplicationTestCaseProviderTestCase2ServiceTestCase
Android testingAndroid testingInstrumentationTestCase(SyncBaseInstrumentation)(SingleLaunchActivityTestCase)ActivityUnitTestCaseActivityInstrumentationTestCase2
Android testingAndroid testingHow do we run tests for Android?
Android testingAndroid testingUsing Instrumentation.
Android testingAndroid testingWork it!
Build managementBuild managementNice, we have tests now.But my build serverdoesn't click buttons.
Build managementBuild managementWe need something that can runbuilds from the command line.
Build managementBuild managementMaven 2 does these sorts of things.(and MUCH more, in fact)
Build managementBuild managementMaven 2 is a build system.
Build managementBuild managementMaven 2 is a dependencymanagement system.
Build managementBuild managementMaven 2 is a life-cyclemanagement system.
Build managementBuild managementMaven 2 is a report anddocumentation generator.
Build managementBuild managementIn fact: Maven 2 is a platform.
Build managementBuild managementThere's a plugin for Android!maven-android-plugin
Build managementBuild managementMaven's central notion is the project.It's described by the POM.
Android testingAndroid testingLet's have a look at one...
Build automationBuild automationNice, we can now build and deploy ourapp from the command line.But we still have to do it manually.
Build automationBuild automationWhat we need is a build server, whichautomatically triggers builds.
Build automationBuild automationHudson does these sorts of things.
Build automationBuild automationHudson is a continuuous integration server. It canrun builds when people commit pieces of work.This is extremely helpful for discoveringsoftware regressions early on.
Build automationBuild automationHudson is a Java Web application.It consists of a single WAR.$ java -jar hudson.war
Build automationBuild automationLet's run it.
More informationMore informationmaven.apache.orgcode.google.com/p/maven-android-pluginhudson-ci.org