droidcon paris 2013 - musclez vos applications android avec les outils du monde java

Post on 10-May-2015

549 Views

Category:

Technology

2 Downloads

Preview:

Click to see full reader

DESCRIPTION

Musclez vos applications Android avec les outils du monde java, conférence Droidcon Paris 2013

TRANSCRIPT

1 Tél : +33 (0)1 58 56 10 00 Fax : +33 (0)1 58 56 10 01 www.octo.com © OCTO 2012

50, avenue des Champs-Elysées 75008 Paris - FRANCE

Beef up your Android apps, using Java tools

Musclez vos apps Android avec les outils du monde Java.

Jérôme Van Der Linden & Stéphane Nicolas

2

! Java / Android / JEE Architect !   Design, development, audit !   Industrialization of software engineering

! OSS softwares on GitHub !   Android Holo Colors, Sonar Android Lint Plugin

! Appaloosa Store co-founder

Jérôme Van Der Linden

@jeromevdl +jerome van der linden

3

! 17 years of Java experience !  Mostly teaching, programming, designing.

! OSS softwares on GitHub !   RoboSpice, Quality Analysis Tools for Android,

RoboDemo, ORMLite Content Provider Compiler !   Contributor of android maven plugin

! Quebecer-like, woodworker wanna be, OSS-fan, Android coder

Stéphane Nicolas

+stephane nicolas

4

���

Quality Tools Available on Android

Quality Tools For Android

Calabash

Mockito

Robotium UI

Automator

Robo lectric

JUnit

Jenkins

Sonar

Maven

Ant

Geny Motion

Emulator

Vogar

Emma Jacoco

Lint

PMD

CheckStyle

findbugs

EasyMock

Cobertura

Device

FEST-Android

Spoon

http://goo.gl/pdwnq

Test Tools Reporting Tools

Code coverage

Graddle

Monkey

Monkey Runner

5

https://github.com/stephanenicolas/Quality-Tools-for-Android (http://goo.gl/pdwnq)

6

Initial setup

Initial Setup

#install Eclipse Juno or IntelliJ #install ADT (for Eclipse) #install a few Android SDK (i.e: 8, 11, 14, 17) #install Hardware Acceleration from Intel #install X86 android emulator with Hardware Acceleration Support

#install maven 3.0.3+ #install Jenkins #install Jenkins Android Emulator Plugin

Jenkins Maven

7

#install Sonar

#install the Sonar Android Lint Plugin > git clone git@github.com:SonarCommunity/sonar-android.git > mvn clean install && cp target/*.jar [SONAR_HOME]/extensions/plugins/ > sonar.sh restart #install the Sonar Emma Plugin

Sonar Lint PMD Check Style findbugs Emma Cobertura

Initial setup :: Sonar

Jacoco

Thanks to Thomas Bores & Florian Roncari for their contributions to the sonar lint plugin.

8

Getting started # clone the repository on GitHub > git clone git@github.com:stephanenicolas/Quality-Tools-for-Android.git

This projects combines many Quality Tools for Android. ���It demonstrates how to set up those tools.

It is not intended to be used as a maven archetype. ���

No project will need all of those technologies,���take only what you need.

All configurations work both in IntelliJ, Eclipse, Maven CLI and

Jenkins.

9

Project Structure

•  Main app + Robolectric : Maven Android project •  Shared configuration : Maven parent project •  Android Junit Tests : Maven Android project •  UI Automator Tests : Maven Java project

Eclipse projects follow maven submodules.

10

Maven profiles

Junit + Robotium Robolectric UIAutomator Code coverage

Quality checks (Checkstyle +

findbugs + PMD + lint)

Sonar

standard

emma

cobertura

ui automator

spoon

jacoco

11

Standard profile : Running tests and Quality checks

Robo lectric

Robotium JUnit UI���Automator

Lint PMD Check Style findbugs

# run all tests > mvn clean install

12

Emma profile : JUnit tests and Emma code coverage in Sonar

Robo tium

JUnit Emma Sonar

Lint PMD Check Style findbugs

# run standard junit tests and get code coverage > mvn clean install –P emma # Report in Sonar > mvn sonar:sonar –P emma

13

Cobertura profile : Robolectric tests and Cobertura code coverage in Sonar

# run robolectric tests and get code coverage > mvn clean cobertura:cobertura –P cobertura # Report in Sonar > mvn sonar:sonar –P cobertura

Robo lectric

Cober tura

Sonar

Lint PMD Check Style findbugs

14

Jacoco profile : Robolectric and standard tests and Jacoco code coverage in Sonar

# run robolectric tests and get code coverage > mvn clean install –P jacoco # Report in Sonar > mvn sonar:sonar –P jacoco

Robo lectric

Jacoco

Sonar Lint PMD Check Style findbugs

Robo tium

JUnit

15

UI Automator profile : Running UI Automator tests

# run UI Automator tests > mvn clean install –P uiautomator > mvn sonar:sonar –P uiautomator

UI���Automator

Sonar

Lint PMD Check Style findbugs

16

Spoon profile : Running Junit & Robotium via Spoon

# run JUnit & Robotium tests via spoon > mvn clean install –P spoon

Robotium JUnit

Lint PMD Check Style findbugs Spoon

17

Monkey profile : Running Monkey tests

# run Monkey tests and get result in Sonar > mvn clean install –P monkey

Monkey

Lint PMD Check Style findbugs Sonar

18

Monkey Runner profile : Running Monkey runner tests

# run Monkey runner tests ���#and get result in Sonar > mvn clean install –P monkeyrunner

Monkey Runner

Lint PMD Check Style findbugs Sonar

19

! Let’s take advantage of Java maturity.

! Testing and building more robust apps can be easy.

! Choose technologies that suit your needs.

! Clone our project on GitHub, try it, contribute !

Conclusion

http://goo.gl/pdwnq

20

https://github.com/stephanenicolas/Quality-Tools-for-Android

(http://goo.gl/pdwnq)

Live Demo

21

Question and comments ?

top related