Slide 1

Slide 1 text

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

Slide 2

Slide 2 text

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

Slide 3

Slide 3 text

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

Slide 4

Slide 4 text

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

Slide 5

Slide 5 text

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

Slide 6

Slide 6 text

Android testing Android testing AndroidTestCase ApplicationTestCase ProviderTestCase2 ServiceTestCase

Slide 7

Slide 7 text

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

Slide 8

Slide 8 text

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

Slide 9

Slide 9 text

Android testing Android testing Using Instrumentation.

Slide 10

Slide 10 text

Android testing Android testing Work it!

Slide 11

Slide 11 text

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

Slide 12

Slide 12 text

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

Slide 13

Slide 13 text

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

Slide 14

Slide 14 text

Build management Build management Maven 2 is a build system.

Slide 15

Slide 15 text

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

Slide 16

Slide 16 text

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

Slide 17

Slide 17 text

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

Slide 18

Slide 18 text

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

Slide 19

Slide 19 text

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

Slide 20

Slide 20 text

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

Slide 21

Slide 21 text

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

Slide 22

Slide 22 text

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.

Slide 23

Slide 23 text

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

Slide 24

Slide 24 text

Build automation Build automation Hudson does these sorts of things.

Slide 25

Slide 25 text

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.

Slide 26

Slide 26 text

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

Slide 27

Slide 27 text

Build automation Build automation Let's run it.

Slide 28

Slide 28 text

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