testing with open source

Post on 13-May-2015

1.528 Views

Category:

Technology

1 Downloads

Preview:

Click to see full reader

DESCRIPTION

A workshop on Android testing and build automation I did on the M2D2

TRANSCRIPT

  

Testing AndroidTesting Androidwith with Open SourceOpen Source

~ Matthias Käppler ~~ Matthias Käppler ~

February 23rd, 2010

  

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 site

17M uniques

I'm the Android guy at Qype.com!

  

Android testingAndroid testing

How do we write tests for Android?

  

Android testingAndroid testing

As usual! Android uses JUnit 3

android.test:

AndroidTestCase < junit.framework.TestCase

InstrumentationTestCase < junit.framework.TestCase

  

Android testingAndroid testing

AndroidTestCase

ApplicationTestCase

ProviderTestCase2

ServiceTestCase

  

Android testingAndroid testing

InstrumentationTestCase

(SyncBaseInstrumentation)

(SingleLaunchActivityTestCase)

ActivityUnitTestCase

ActivityInstrumentationTestCase2

  

Android testingAndroid testing

How do we run tests for Android?

  

Android testingAndroid testing

Using Instrumentation.

  

Android testingAndroid testing

Work it!

  

Build managementBuild management

Nice, we have tests now.

But my build serverdoesn't click buttons.

  

Build managementBuild management

We need something that can runbuilds from the command line.

  

Build managementBuild management

Maven 2 does these sorts of things.

(and MUCH more, in fact)

  

Build managementBuild management

Maven 2 is a build system.

  

Build managementBuild management

Maven 2 is a dependencymanagement system.

  

Build managementBuild management

Maven 2 is a life-cyclemanagement system.

  

Build managementBuild management

Maven 2 is a report anddocumentation generator.

  

Build managementBuild management

In fact: Maven 2 is a platform.

  

Build managementBuild management

There's a plugin for Android!

maven-android-plugin

  

Build managementBuild management

Maven's central notion is the project.

It's described by the POM.

  

Android testingAndroid testing

Let's have a look at one...

  

Build automationBuild automation

Nice, we can now build and deploy our app from the command line.

But we still have to do it manually.

  

Build automationBuild automation

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

  

Build automationBuild automation

Hudson does these sorts of things.

  

Build automationBuild automation

Hudson is a continuuous integration server. It can run builds when people commit pieces of work.

This is extremely helpful for discoveringsoftware regressions early on.

  

Build automationBuild automation

Hudson is a Java Web application.It consists of a single WAR.

$ java -jar hudson.war

  

Build automationBuild automation

Let's run it.

  

More informationMore information

maven.apache.org

code.google.com/p/maven-android-plugin

hudson-ci.org

top related