SlideShare a Scribd company logo
Make use of Sonar on your
mobile developments

- It’s easy and useful!

October 26th, 2013

© OCTO 2013

Avenue du Théâtre 7
1005 Lausanne - SUISSE

Tél : +41 (0) 21 312 94 15
Fax : +41 (0) 21 312 94 16
www.octo.ch

1
Who We Are
Romain Felden: Java / Android developer
Cyril Picat: C++, iOS, Groovy/Grails
developer
OCTO Technology

Jenkins Quality
Dashboard
iOS

Android
Maven
Plugin

Sonar
Android
Lint Plugin

Quality Analysis
Tools for
Android

Sonar
Objective-C
Plugin

2
Agenda
1

QUALITY TOOLS ON MOBILE

2

SONAR PLUGINS PRESENTATION

3

HOW-TO & DEMO IOS

4

HOW-TO & DEMO ANDROID

5

CONCLUSION

3
Sonar For the Uninitiated
Manage quality of your software
Across languages/platforms (> 20)
Across projects
Across time
Across multiple axis/depths

A web app for (re)viewing, a back-end for analysis

4
Agenda

1

QUALITY TOOLS
ON MOBILE

5
Quality Tools on Mobile
s
s
in
kin
k
)
n
Je
en
od
V
e5
J
c
L
d
n
(X
2)
4) e (L for )
s o (Xco
c
i
e
e
g
o
ge
t
od
C
od erag gin lan alys
/cl
ra
e
Bo bjXc
Xc ov
lu (C an
nt
v
(
(
/
p
u
o
O
t
it
nit e c de Lint ality
nit ar
g Uni M
co
e c Un
U
c
U
d
d
n
o
an C
GT Co
XC So
slo
O
GH
OC Co Xc OC Qu
Cl
)
e3

19xx

2007

2009

2011

M)

2012

2013

2008
First iOS
SDK

TESTS

QUALITY
Quality Tools on Mobile

Sonar
Objective-C
Plugin

sic
a
- Bics
1
.0. etr
v0 m

n
sa
t
t
L
es
es ge
C
u
T
eq
- O .1 - era
r
ull
0.2 v0.3 cov
v
P
int

7

2012/06

2013/07

2013/10

d
Quality Tools on Mobile

d
n
oi ugi
r
gin
)
nd t-pl
u
ase )
pl )
r A lin
le e
e
d
fo
t r leas
oi mma
t ol s oi d
s e
r
n
(fir t r
nd EclE
Li To ndr
a
a
le
s
a
id
y
n- Co (
tur a (la
sty
r
e o
ro alit ark
e
c
n
av aC
n d Qu
ob Emm
he
m
C
A
J
so
C

2001

2004 2005

2009

2008
First Android SDK

2011 2012 2013
Agenda

2

SONAR PLUGINS
PRESENTATION

9
Sonar Plugins Features
Android
Complexity
Design
Documentation
Duplications
Issues
Size
Tests

√
√
√
√
√ (140)
√
√

iOS

X (*)
X
√
√
√ (58)
√ (*)
√

(*) integrated
as issues

(*) only LOC
and files

10
Sonar Plugin Architecture

Sonar
Sonar ObjC
Platform

Quality
management

Sonar Core

gcovr

oclint

xcodebuild / xctool

sonar-runner

OCLint
sensor

xctool

run-sonar.sh

Build

Cobertura
sensor

Measures/
Issues
computation

Surefire
sensor

Measures/
Issues
integration

Squid plugin

Sonar Objective-C plugin

11
Sonar Plugin Architecture

Sonar
Android Plugin
Platform

Quality
management

Measures/
Issues
computation
ant

maven

Sonar Android plugin

PMD
plugin

JaCoCo
plugin

Checkstyle
plugin

Findbugs
plugin

Surefire
plugin

Squid plugin

Measures/
Issues
integration

Sonar Core

gradle

Build

12
Testing / Quality Tools Integration

Kiwi

UI
Automation

KIF

Frank /
UISpec

UI Testing

GTM

BDD

GHUnit

√

Unit Testing

...

√ X

X

X

X

X

X

X

OCUnit /
XCUnit

OCLint

Quality

*

*

* *

= in roadmap

13
Testing / Quality Tools Integration

Robolectric

UIAutomator

PMD

Checkstyle

Findbugs

Lint

Quality checks

Robotium

UI

JUnit

Unit and Integration
Testing

√

√

√

√

√

√

√

√

14
Agenda

3

HOW-TO & DEMO

15
How-to

Install Sonar, Sonar Runner and Sonar
Objective-C plugin
Install prerequisites (xctool, gcovr, oclint)
Configure your project
Run analysis

16
Configure your project

Copy run-sonar.sh in your Xcode project
root folder and make it executable
Copy sonar-project.properties in your Xcode
project root folder
Edit the sonar-project.properties file to
match your Xcode iOS/MacOS project

17
Demo

https://github.com/dennisreimann/ioctocat

(*) https://github.com/cyrilpicat/ioctocat
18
sonar-project.properties

#	
  Project	
  description
sonar.projectKey=my-­‐project
sonar.projectName=My	
  project
sonar.projectVersion=1.0
sonar.projectDescription=Fake	
  description
	
  
#	
  Path	
  to	
  source	
  directories	
  
sonar.sources=srcDir1,srcDir2
	
  
#	
  Xcode	
  project	
  configuration	
  (.xcodeproj	
  
or	
  .xcworkspace)
sonar.objectivec.project=myApplication.xcodeproj	
  
sonar.objectivec.appScheme=myApplication
sonar.objectivec.testScheme=myApplicationTests

19
Run it!

>	
  ./run-­‐sonar.sh

20
Jenkins Quality Dashboard

Almost feature
complete
No code checks
Timeconsuming,
error prone and
intrusive
Weak reporting
and
configuration

21
How-to using maven

Install Sonar and Sonar Android plugin
Add maven profile(s) to your module(s)
Connect ADB in root mode
Run analysis

22
Maven structure

Parent module
Application module
Library module
Integration testing module

23
Demo

Morse Flash
https://github.com/jayway/maven-android-plugin-samples

24
Maven profiles
parent module
<profile>
	 	 	 	 <id>sonar</id>
	 	 	 	 <modules>
	 	 	 	 	 	 	 	 <module>morse-lib</module>
	 	 	 	 	 	 	 	 <module>morseflash-app</module>
	 	 	 	 	 	 	 	 <module>morseflash-instrumentation</module>
	 	 	 	 </modules>
	 	 	 	 <properties>
	 	 	 	 	 	 	 	 <sonar.profile>Android	 Lint</sonar.profile>
	 	 	 	 	 	 	 	 <sonar.jacoco.excludes>*test*</sonar.jacoco.excludes>
	 	 	 	 	 	 	 	 <sonar.jacoco.itReportPath>target/jacoco-it.exec</sonar.jacoco.itReportPath>
	 	 	 	 	 	 	 	 <sonar.jacoco.reportPath>jacoco.exec</sonar.jacoco.reportPath>
	 	 	 	 	 	 	 	 <sonar.core.codeCoveragePlugin>jacoco</sonar.core.codeCoveragePlugin>
	 	 	 	 	 	 	 	 <sonar.skippedModules>morseflash-instrumentation</sonar.skippedModules>
	 	 	 	 	 	 	 	 <sonar.exclusions>**/org/jacoco/**</sonar.exclusions>
	 	 	 	 	 	 	 	 <jacoco.version>0.6.2.201302030002</jacoco.version>
	 	 	 	 </properties>
	 	 	 	 <dependencyManagement>
	 	 	 	 	 	 	 	 <dependencies>
	 	 	 	 	 	 	 	 	 	 	 	 <dependency>
	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 <groupId>org.jacoco</groupId>
	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 <artifactId>org.jacoco.agent</artifactId>
	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 <version>${jacoco.version}</version>
	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 <classifier>runtime</classifier>
	 	 	 	 	 	 	 	 	 	 	 	 </dependency>
	 	 	 	 	 	 	 	 </dependencies>
	 	 	 	 </dependencyManagement>
	 	 	 	 <build>
	 	 	 	 	 	 	 	 <pluginManagement>
	 	 	 	 	 	 	 	 	 	 	 	 <plugins>
	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 <plugin>
	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 <groupId>org.jacoco</groupId>
	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 <artifactId>jacoco-maven-plugin</artifactId>
	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 <version>${jacoco.version}</version>
	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 </plugin>
	 	 	 	 	 	 	 	 	 	 	 	 </plugins>
	 	 	 	 	 	 	 	 </pluginManagement>
	 	 	 	 </build>
</profile>

25
Maven profiles
application module (includes unit testing)
<profile>
	 	 	 	 <id>sonar</id>
	 	 	 	 <dependencies>
	 	 	 	 	 	 	 	 <dependency>
	 	 	 	 	 	 	 	 	 	 	 	 <groupId>org.jacoco</groupId>
	 	 	 	 	 	 	 	 	 	 	 	 <artifactId>org.jacoco.agent</artifactId>
	 	 	 	 	 	 	 	 	 	 	 	 <classifier>runtime</classifier>
	 	 	 	 	 	 	 	 	 	 	 	 <scope>compile</scope>
	 	 	 	 	 	 	 	 </dependency>
	 	 	 	 </dependencies>
	 	 	 	 <build>
	 	 	 	 	 	 	 	 <plugins>
	 	 	 	 	 	 	 	 	 	 	 	 <plugin>
	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 <groupId>org.jacoco</groupId>
	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 <artifactId>jacoco-maven-plugin</artifactId>
	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 <executions>
	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 <execution>
	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 <id>instrument-classes</id>
	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 <goals>
	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 <goal>instrument</goal>
	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 </goals>
	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 <configuration>
	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 <excludes>
	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 <exclude>*test*</exclude>
	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 <exclude>*/test/*</exclude>
	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 </excludes>
	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 </configuration>
	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 </execution>
	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 <execution>
	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 <id>restore-instrumented-classes</id>
	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 <phase>package</phase>
	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 <goals>
	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 <goal>restore-instrumented-classes</goal>
	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 </goals>
	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 </execution>
	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 </executions>
	 	 	 	 	 	 	 	 	 	 	 	 </plugin>
	 	 	 	 	 	 	 	 	 	 	 	 <plugin>
	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 <groupId>com.jayway.maven.plugins.android.generation2</groupId>
	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 <artifactId>android-maven-plugin</artifactId>
	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 <configuration>
	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 <test>
	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 <coverage>true</coverage>
	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 <createReport>true</createReport>
	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 </test>
	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 </configuration>
	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 <extensions>true</extensions>
	 	 	 	 	 	 	 	 	 	 	 	 </plugin>
	 	 	 	 	 	 	 	 </plugins>
	 	 	 	 </build>
</profile>

26
Maven profiles
integration testing module
<profiles>
	 	 	 	 <profile>
	 	 	 	 	 	 	 	 <id>sonar</id>
	 	 	 	 	 	 	 	 <build>
	 	 	 	 	 	 	 	 	 	 	 	 <plugins>
	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 <plugin>
	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 <groupId>com.jayway.maven.plugins.android.generation2</groupId>
	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 <artifactId>android-maven-plugin</artifactId>
	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 <configuration>
	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 <dex>
	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 <!--	 Required	 for	 EMMA	 -->
	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 <noLocals>true</noLocals>
	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 </dex>
	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 <test>
	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 <coverage>true</coverage>
	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 <createReport>true</createReport>
	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 </test>
	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 </configuration>
	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 <executions>
	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 <execution>
	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 <id>pull-coverage</id>
	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 <phase>post-integration-test</phase>
	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 <goals>
	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 <goal>pull</goal>
	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 </goals>
	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 <configuration>
	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 <pullSource>/data/data/com.simpligility.android.morseflash/files/coverage.ec</pullSource>
	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 <pullDestination>${project.basedir}/../morseflash-app/target/jacoco-it.exec</pullDestination>
	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 </configuration>
	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 </execution>
	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 </executions>
	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 </plugin>
	 	 	 	 	 	 	 	 	 	 	 	 </plugins>
	 	 	 	 	 	 	 	 </build>
	 	 	 	 </profile>
</profiles>

27
Run it!

>	
  mvn	
  -­‐P	
  sonar	
  clean	
  install
>	
  mvn	
  -­‐P	
  sonar	
  sonar:sonar

28
Agenda

5

CONCLUSION

29
Why Use Sonar?

Mobile projects are small and short, is it
applicable?
Three typical uses cases:
Small and short projects
Assessments
Bigger projects (there are!)

30
Stay in touch!
Objective-C plugin: https://github.com/octotechnology/sonar-objective-c
Sonar Android Lint plugin: https://
github.com/SonarCommunity/sonar-android
Quality Analysis Tools for Android:
https://github.com/stephanenicolas/QualityTools-for-Android
http://fr.slideshare.net/jeromevdl/droidconparis-2013

31
Questions/Answers

© OCTO 2013

Avenue du Théâtre 7
1005 Lausanne - SUISSE

Tél : +41 (0) 21 312 94 15
Fax : +41 (0) 21 312 94 16
www.octo.ch

32

More Related Content

What's hot

Continous UI testing with Espresso and Jenkins
Continous UI testing with Espresso and JenkinsContinous UI testing with Espresso and Jenkins
Continous UI testing with Espresso and Jenkins
Sylwester Madej
 
JavaFX JumpStart @JavaOne 2016
JavaFX JumpStart @JavaOne 2016JavaFX JumpStart @JavaOne 2016
JavaFX JumpStart @JavaOne 2016
Hendrik Ebbers
 
Enterprise Build And Test In The Cloud
Enterprise Build And Test In The CloudEnterprise Build And Test In The Cloud
Enterprise Build And Test In The Cloud
Carlos Sanchez
 
探討Web ui自動化測試工具
探討Web ui自動化測試工具探討Web ui自動化測試工具
探討Web ui自動化測試工具
政億 林
 
Enterprise Build And Test In The Cloud
Enterprise Build And Test In The CloudEnterprise Build And Test In The Cloud
Enterprise Build And Test In The Cloud
Carlos Sanchez
 
*Webinar* Learn from the Experts: How to Boost Test Coverage with Automated V...
*Webinar* Learn from the Experts: How to Boost Test Coverage with Automated V...*Webinar* Learn from the Experts: How to Boost Test Coverage with Automated V...
*Webinar* Learn from the Experts: How to Boost Test Coverage with Automated V...
Applitools
 
Introduction maven3 and gwt2.5 rc2 - Lesson 01
Introduction maven3 and gwt2.5 rc2 - Lesson 01Introduction maven3 and gwt2.5 rc2 - Lesson 01
Introduction maven3 and gwt2.5 rc2 - Lesson 01
rhemsolutions
 
Rohit android lab projects in suresh gyan vihar
Rohit android lab projects in suresh gyan viharRohit android lab projects in suresh gyan vihar
Rohit android lab projects in suresh gyan vihar
Rohit malav
 
前端網頁自動測試
前端網頁自動測試 前端網頁自動測試
前端網頁自動測試
政億 林
 
Night Watch with QA
Night Watch with QANight Watch with QA
Night Watch with QA
Carsten Sandtner
 
Супер быстрая автоматизация тестирования на iOS
Супер быстрая автоматизация тестирования на iOSСупер быстрая автоматизация тестирования на iOS
Супер быстрая автоматизация тестирования на iOS
SQALab
 
Gradle Introduction
Gradle IntroductionGradle Introduction
Gradle Introduction
Dmitry Buzdin
 
Selenium-Browser-Based-Automated-Testing-for-Grails-Apps
Selenium-Browser-Based-Automated-Testing-for-Grails-AppsSelenium-Browser-Based-Automated-Testing-for-Grails-Apps
Selenium-Browser-Based-Automated-Testing-for-Grails-Apps
chrisb206 chrisb206
 
Visual Component Testing -- w/ Gil Tayar (Applitools) and Gleb Bahmutov (Cyp...
Visual Component Testing  -- w/ Gil Tayar (Applitools) and Gleb Bahmutov (Cyp...Visual Component Testing  -- w/ Gil Tayar (Applitools) and Gleb Bahmutov (Cyp...
Visual Component Testing -- w/ Gil Tayar (Applitools) and Gleb Bahmutov (Cyp...
Applitools
 
軟體測試是在測試什麼?
軟體測試是在測試什麼?軟體測試是在測試什麼?
軟體測試是在測試什麼?
Yao Nien Chung
 
Protractor framework – how to make stable e2e tests for Angular applications
Protractor framework – how to make stable e2e tests for Angular applicationsProtractor framework – how to make stable e2e tests for Angular applications
Protractor framework – how to make stable e2e tests for Angular applications
Ludmila Nesvitiy
 
5 Reasons Why Maven Sux
5 Reasons Why Maven Sux5 Reasons Why Maven Sux
5 Reasons Why Maven Sux
Carlos Sanchez
 
淺談 Groovy 與 AWS 雲端應用開發整合
淺談 Groovy 與 AWS 雲端應用開發整合淺談 Groovy 與 AWS 雲端應用開發整合
淺談 Groovy 與 AWS 雲端應用開發整合
Kyle Lin
 
Introduction to maven
Introduction to mavenIntroduction to maven
Introduction to maven
Manos Georgopoulos
 
Making React Native UI Components with Swift
Making React Native UI Components with SwiftMaking React Native UI Components with Swift
Making React Native UI Components with Swift
Ray Deck
 

What's hot (20)

Continous UI testing with Espresso and Jenkins
Continous UI testing with Espresso and JenkinsContinous UI testing with Espresso and Jenkins
Continous UI testing with Espresso and Jenkins
 
JavaFX JumpStart @JavaOne 2016
JavaFX JumpStart @JavaOne 2016JavaFX JumpStart @JavaOne 2016
JavaFX JumpStart @JavaOne 2016
 
Enterprise Build And Test In The Cloud
Enterprise Build And Test In The CloudEnterprise Build And Test In The Cloud
Enterprise Build And Test In The Cloud
 
探討Web ui自動化測試工具
探討Web ui自動化測試工具探討Web ui自動化測試工具
探討Web ui自動化測試工具
 
Enterprise Build And Test In The Cloud
Enterprise Build And Test In The CloudEnterprise Build And Test In The Cloud
Enterprise Build And Test In The Cloud
 
*Webinar* Learn from the Experts: How to Boost Test Coverage with Automated V...
*Webinar* Learn from the Experts: How to Boost Test Coverage with Automated V...*Webinar* Learn from the Experts: How to Boost Test Coverage with Automated V...
*Webinar* Learn from the Experts: How to Boost Test Coverage with Automated V...
 
Introduction maven3 and gwt2.5 rc2 - Lesson 01
Introduction maven3 and gwt2.5 rc2 - Lesson 01Introduction maven3 and gwt2.5 rc2 - Lesson 01
Introduction maven3 and gwt2.5 rc2 - Lesson 01
 
Rohit android lab projects in suresh gyan vihar
Rohit android lab projects in suresh gyan viharRohit android lab projects in suresh gyan vihar
Rohit android lab projects in suresh gyan vihar
 
前端網頁自動測試
前端網頁自動測試 前端網頁自動測試
前端網頁自動測試
 
Night Watch with QA
Night Watch with QANight Watch with QA
Night Watch with QA
 
Супер быстрая автоматизация тестирования на iOS
Супер быстрая автоматизация тестирования на iOSСупер быстрая автоматизация тестирования на iOS
Супер быстрая автоматизация тестирования на iOS
 
Gradle Introduction
Gradle IntroductionGradle Introduction
Gradle Introduction
 
Selenium-Browser-Based-Automated-Testing-for-Grails-Apps
Selenium-Browser-Based-Automated-Testing-for-Grails-AppsSelenium-Browser-Based-Automated-Testing-for-Grails-Apps
Selenium-Browser-Based-Automated-Testing-for-Grails-Apps
 
Visual Component Testing -- w/ Gil Tayar (Applitools) and Gleb Bahmutov (Cyp...
Visual Component Testing  -- w/ Gil Tayar (Applitools) and Gleb Bahmutov (Cyp...Visual Component Testing  -- w/ Gil Tayar (Applitools) and Gleb Bahmutov (Cyp...
Visual Component Testing -- w/ Gil Tayar (Applitools) and Gleb Bahmutov (Cyp...
 
軟體測試是在測試什麼?
軟體測試是在測試什麼?軟體測試是在測試什麼?
軟體測試是在測試什麼?
 
Protractor framework – how to make stable e2e tests for Angular applications
Protractor framework – how to make stable e2e tests for Angular applicationsProtractor framework – how to make stable e2e tests for Angular applications
Protractor framework – how to make stable e2e tests for Angular applications
 
5 Reasons Why Maven Sux
5 Reasons Why Maven Sux5 Reasons Why Maven Sux
5 Reasons Why Maven Sux
 
淺談 Groovy 與 AWS 雲端應用開發整合
淺談 Groovy 與 AWS 雲端應用開發整合淺談 Groovy 與 AWS 雲端應用開發整合
淺談 Groovy 與 AWS 雲端應用開發整合
 
Introduction to maven
Introduction to mavenIntroduction to maven
Introduction to maven
 
Making React Native UI Components with Swift
Making React Native UI Components with SwiftMaking React Native UI Components with Swift
Making React Native UI Components with Swift
 

Viewers also liked

Introdução, instalação e configuração do SonarQube
Introdução, instalação e configuração do SonarQubeIntrodução, instalação e configuração do SonarQube
Introdução, instalação e configuração do SonarQube
Denis Santos
 
Sonarqube
SonarqubeSonarqube
Sonarqube
CDS
 
Continuous Integration for iOS (iOS User Group Berlin)
Continuous Integration for iOS (iOS User Group Berlin)Continuous Integration for iOS (iOS User Group Berlin)
Continuous Integration for iOS (iOS User Group Berlin)
Wooga
 
Social Sharing
Social Sharing Social Sharing
Social Sharing
Amit Agarwal
 
Continuous Integration for iOS
Continuous Integration for iOSContinuous Integration for iOS
Continuous Integration for iOS
CODETE
 
Thinking About A Volcano
Thinking About A VolcanoThinking About A Volcano
Thinking About A Volcano
Simon Jones
 
SOLID, DRY, SLAP design principles
SOLID, DRY, SLAP design principlesSOLID, DRY, SLAP design principles
SOLID, DRY, SLAP design principles
Sergey Karpushin
 
Apple iOS
Apple iOSApple iOS
Apple iOS
Chetan Gowda
 
Mobile SDK: Considerations & Best Practices
Mobile SDK: Considerations & Best Practices Mobile SDK: Considerations & Best Practices
Mobile SDK: Considerations & Best Practices
LivePerson
 
Solution de transfert mobile - Formats d'échange
Solution de transfert mobile - Formats d'échangeSolution de transfert mobile - Formats d'échange
Solution de transfert mobile - Formats d'échange
OCTO Technology
 
A Guide to SlideShare Analytics - Excerpts from Hubspot's Step by Step Guide ...
A Guide to SlideShare Analytics - Excerpts from Hubspot's Step by Step Guide ...A Guide to SlideShare Analytics - Excerpts from Hubspot's Step by Step Guide ...
A Guide to SlideShare Analytics - Excerpts from Hubspot's Step by Step Guide ...
SlideShare
 
How to Make Awesome SlideShares: Tips & Tricks
How to Make Awesome SlideShares: Tips & TricksHow to Make Awesome SlideShares: Tips & Tricks
How to Make Awesome SlideShares: Tips & Tricks
SlideShare
 
Getting Started With SlideShare
Getting Started With SlideShareGetting Started With SlideShare
Getting Started With SlideShare
SlideShare
 

Viewers also liked (13)

Introdução, instalação e configuração do SonarQube
Introdução, instalação e configuração do SonarQubeIntrodução, instalação e configuração do SonarQube
Introdução, instalação e configuração do SonarQube
 
Sonarqube
SonarqubeSonarqube
Sonarqube
 
Continuous Integration for iOS (iOS User Group Berlin)
Continuous Integration for iOS (iOS User Group Berlin)Continuous Integration for iOS (iOS User Group Berlin)
Continuous Integration for iOS (iOS User Group Berlin)
 
Social Sharing
Social Sharing Social Sharing
Social Sharing
 
Continuous Integration for iOS
Continuous Integration for iOSContinuous Integration for iOS
Continuous Integration for iOS
 
Thinking About A Volcano
Thinking About A VolcanoThinking About A Volcano
Thinking About A Volcano
 
SOLID, DRY, SLAP design principles
SOLID, DRY, SLAP design principlesSOLID, DRY, SLAP design principles
SOLID, DRY, SLAP design principles
 
Apple iOS
Apple iOSApple iOS
Apple iOS
 
Mobile SDK: Considerations & Best Practices
Mobile SDK: Considerations & Best Practices Mobile SDK: Considerations & Best Practices
Mobile SDK: Considerations & Best Practices
 
Solution de transfert mobile - Formats d'échange
Solution de transfert mobile - Formats d'échangeSolution de transfert mobile - Formats d'échange
Solution de transfert mobile - Formats d'échange
 
A Guide to SlideShare Analytics - Excerpts from Hubspot's Step by Step Guide ...
A Guide to SlideShare Analytics - Excerpts from Hubspot's Step by Step Guide ...A Guide to SlideShare Analytics - Excerpts from Hubspot's Step by Step Guide ...
A Guide to SlideShare Analytics - Excerpts from Hubspot's Step by Step Guide ...
 
How to Make Awesome SlideShares: Tips & Tricks
How to Make Awesome SlideShares: Tips & TricksHow to Make Awesome SlideShares: Tips & Tricks
How to Make Awesome SlideShares: Tips & Tricks
 
Getting Started With SlideShare
Getting Started With SlideShareGetting Started With SlideShare
Getting Started With SlideShare
 

Similar to Soft shake 2013 - make use of sonar on your mobile developments

Pom
PomPom
Pom
akmini
 
Pom configuration java xml
Pom configuration java xmlPom configuration java xml
Pom configuration java xml
akmini
 
Build system
Build systemBuild system
Build system
Andrey Subbota
 
Maven 3… so what?
Maven 3… so what?Maven 3… so what?
Maven 3… so what?
Abel Muíño
 
Spring Web Service, Spring JMS, Eclipse & Maven tutorials
Spring Web Service, Spring JMS, Eclipse & Maven tutorialsSpring Web Service, Spring JMS, Eclipse & Maven tutorials
Spring Web Service, Spring JMS, Eclipse & Maven tutorials
Raghavan Mohan
 
Jsf, facelets, spring, hibernate, maven2
Jsf, facelets, spring, hibernate, maven2Jsf, facelets, spring, hibernate, maven2
Jsf, facelets, spring, hibernate, maven2
Raghavan Mohan
 
Apache Maven basics
Apache Maven basicsApache Maven basics
Apache Maven basics
Volodymyr Ostapiv
 
JSF, Facelets, Spring-JSF & Maven
JSF, Facelets, Spring-JSF & MavenJSF, Facelets, Spring-JSF & Maven
JSF, Facelets, Spring-JSF & Maven
Raghavan Mohan
 
Maven
MavenMaven
Maven
javeed_mhd
 
Maven
MavenMaven
Automation Frame works Instruction Sheet
Automation Frame works Instruction SheetAutomation Frame works Instruction Sheet
Automation Frame works Instruction Sheet
vodQA
 
Maven in Mule
Maven in MuleMaven in Mule
Maven in Mule
Anand kalla
 
Pom
PomPom
Using JIRA to build a culture of innovation - Atlassian Summit 2012
Using JIRA to build a culture of innovation - Atlassian Summit 2012Using JIRA to build a culture of innovation - Atlassian Summit 2012
Using JIRA to build a culture of innovation - Atlassian Summit 2012
Atlassian
 
Develop and Deploy your JavaEE micro service in less than 5 minutes with Apac...
Develop and Deploy your JavaEE micro service in less than 5 minutes with Apac...Develop and Deploy your JavaEE micro service in less than 5 minutes with Apac...
Develop and Deploy your JavaEE micro service in less than 5 minutes with Apac...
Alex Soto
 
Using Maven to build Java & Android program
Using Maven to build Java & Android programUsing Maven to build Java & Android program
Using Maven to build Java & Android program
Mu Chun Wang
 
Training in Android with Maven
Training in Android with MavenTraining in Android with Maven
Training in Android with Maven
Arcadian Learning
 
Using Maven2
Using Maven2Using Maven2
Using Maven2
elliando dias
 
Implementing Quality on Java projects
Implementing Quality on Java projectsImplementing Quality on Java projects
Implementing Quality on Java projects
Vincent Massol
 
Maven advanced
Maven advancedMaven advanced
Maven advanced
Smita Prasad
 

Similar to Soft shake 2013 - make use of sonar on your mobile developments (20)

Pom
PomPom
Pom
 
Pom configuration java xml
Pom configuration java xmlPom configuration java xml
Pom configuration java xml
 
Build system
Build systemBuild system
Build system
 
Maven 3… so what?
Maven 3… so what?Maven 3… so what?
Maven 3… so what?
 
Spring Web Service, Spring JMS, Eclipse & Maven tutorials
Spring Web Service, Spring JMS, Eclipse & Maven tutorialsSpring Web Service, Spring JMS, Eclipse & Maven tutorials
Spring Web Service, Spring JMS, Eclipse & Maven tutorials
 
Jsf, facelets, spring, hibernate, maven2
Jsf, facelets, spring, hibernate, maven2Jsf, facelets, spring, hibernate, maven2
Jsf, facelets, spring, hibernate, maven2
 
Apache Maven basics
Apache Maven basicsApache Maven basics
Apache Maven basics
 
JSF, Facelets, Spring-JSF & Maven
JSF, Facelets, Spring-JSF & MavenJSF, Facelets, Spring-JSF & Maven
JSF, Facelets, Spring-JSF & Maven
 
Maven
MavenMaven
Maven
 
Maven
MavenMaven
Maven
 
Automation Frame works Instruction Sheet
Automation Frame works Instruction SheetAutomation Frame works Instruction Sheet
Automation Frame works Instruction Sheet
 
Maven in Mule
Maven in MuleMaven in Mule
Maven in Mule
 
Pom
PomPom
Pom
 
Using JIRA to build a culture of innovation - Atlassian Summit 2012
Using JIRA to build a culture of innovation - Atlassian Summit 2012Using JIRA to build a culture of innovation - Atlassian Summit 2012
Using JIRA to build a culture of innovation - Atlassian Summit 2012
 
Develop and Deploy your JavaEE micro service in less than 5 minutes with Apac...
Develop and Deploy your JavaEE micro service in less than 5 minutes with Apac...Develop and Deploy your JavaEE micro service in less than 5 minutes with Apac...
Develop and Deploy your JavaEE micro service in less than 5 minutes with Apac...
 
Using Maven to build Java & Android program
Using Maven to build Java & Android programUsing Maven to build Java & Android program
Using Maven to build Java & Android program
 
Training in Android with Maven
Training in Android with MavenTraining in Android with Maven
Training in Android with Maven
 
Using Maven2
Using Maven2Using Maven2
Using Maven2
 
Implementing Quality on Java projects
Implementing Quality on Java projectsImplementing Quality on Java projects
Implementing Quality on Java projects
 
Maven advanced
Maven advancedMaven advanced
Maven advanced
 

Soft shake 2013 - make use of sonar on your mobile developments

  • 1. Make use of Sonar on your mobile developments - It’s easy and useful! October 26th, 2013 © OCTO 2013 Avenue du Théâtre 7 1005 Lausanne - SUISSE Tél : +41 (0) 21 312 94 15 Fax : +41 (0) 21 312 94 16 www.octo.ch 1
  • 2. Who We Are Romain Felden: Java / Android developer Cyril Picat: C++, iOS, Groovy/Grails developer OCTO Technology Jenkins Quality Dashboard iOS Android Maven Plugin Sonar Android Lint Plugin Quality Analysis Tools for Android Sonar Objective-C Plugin 2
  • 3. Agenda 1 QUALITY TOOLS ON MOBILE 2 SONAR PLUGINS PRESENTATION 3 HOW-TO & DEMO IOS 4 HOW-TO & DEMO ANDROID 5 CONCLUSION 3
  • 4. Sonar For the Uninitiated Manage quality of your software Across languages/platforms (> 20) Across projects Across time Across multiple axis/depths A web app for (re)viewing, a back-end for analysis 4
  • 6. Quality Tools on Mobile s s in kin k ) n Je en od V e5 J c L d n (X 2) 4) e (L for ) s o (Xco c i e e g o ge t od C od erag gin lan alys /cl ra e Bo bjXc Xc ov lu (C an nt v ( ( / p u o O t it nit e c de Lint ality nit ar g Uni M co e c Un U c U d d n o an C GT Co XC So slo O GH OC Co Xc OC Qu Cl ) e3 19xx 2007 2009 2011 M) 2012 2013 2008 First iOS SDK TESTS QUALITY
  • 7. Quality Tools on Mobile Sonar Objective-C Plugin sic a - Bics 1 .0. etr v0 m n sa t t L es es ge C u T eq - O .1 - era r ull 0.2 v0.3 cov v P int 7 2012/06 2013/07 2013/10 d
  • 8. Quality Tools on Mobile d n oi ugi r gin ) nd t-pl u ase ) pl ) r A lin le e e d fo t r leas oi mma t ol s oi d s e r n (fir t r nd EclE Li To ndr a a le s a id y n- Co ( tur a (la sty r e o ro alit ark e c n av aC n d Qu ob Emm he m C A J so C 2001 2004 2005 2009 2008 First Android SDK 2011 2012 2013
  • 10. Sonar Plugins Features Android Complexity Design Documentation Duplications Issues Size Tests √ √ √ √ √ (140) √ √ iOS X (*) X √ √ √ (58) √ (*) √ (*) integrated as issues (*) only LOC and files 10
  • 11. Sonar Plugin Architecture Sonar Sonar ObjC Platform Quality management Sonar Core gcovr oclint xcodebuild / xctool sonar-runner OCLint sensor xctool run-sonar.sh Build Cobertura sensor Measures/ Issues computation Surefire sensor Measures/ Issues integration Squid plugin Sonar Objective-C plugin 11
  • 12. Sonar Plugin Architecture Sonar Android Plugin Platform Quality management Measures/ Issues computation ant maven Sonar Android plugin PMD plugin JaCoCo plugin Checkstyle plugin Findbugs plugin Surefire plugin Squid plugin Measures/ Issues integration Sonar Core gradle Build 12
  • 13. Testing / Quality Tools Integration Kiwi UI Automation KIF Frank / UISpec UI Testing GTM BDD GHUnit √ Unit Testing ... √ X X X X X X X OCUnit / XCUnit OCLint Quality * * * * = in roadmap 13
  • 14. Testing / Quality Tools Integration Robolectric UIAutomator PMD Checkstyle Findbugs Lint Quality checks Robotium UI JUnit Unit and Integration Testing √ √ √ √ √ √ √ √ 14
  • 16. How-to Install Sonar, Sonar Runner and Sonar Objective-C plugin Install prerequisites (xctool, gcovr, oclint) Configure your project Run analysis 16
  • 17. Configure your project Copy run-sonar.sh in your Xcode project root folder and make it executable Copy sonar-project.properties in your Xcode project root folder Edit the sonar-project.properties file to match your Xcode iOS/MacOS project 17
  • 19. sonar-project.properties #  Project  description sonar.projectKey=my-­‐project sonar.projectName=My  project sonar.projectVersion=1.0 sonar.projectDescription=Fake  description   #  Path  to  source  directories   sonar.sources=srcDir1,srcDir2   #  Xcode  project  configuration  (.xcodeproj   or  .xcworkspace) sonar.objectivec.project=myApplication.xcodeproj   sonar.objectivec.appScheme=myApplication sonar.objectivec.testScheme=myApplicationTests 19
  • 21. Jenkins Quality Dashboard Almost feature complete No code checks Timeconsuming, error prone and intrusive Weak reporting and configuration 21
  • 22. How-to using maven Install Sonar and Sonar Android plugin Add maven profile(s) to your module(s) Connect ADB in root mode Run analysis 22
  • 23. Maven structure Parent module Application module Library module Integration testing module 23
  • 25. Maven profiles parent module <profile> <id>sonar</id> <modules> <module>morse-lib</module> <module>morseflash-app</module> <module>morseflash-instrumentation</module> </modules> <properties> <sonar.profile>Android Lint</sonar.profile> <sonar.jacoco.excludes>*test*</sonar.jacoco.excludes> <sonar.jacoco.itReportPath>target/jacoco-it.exec</sonar.jacoco.itReportPath> <sonar.jacoco.reportPath>jacoco.exec</sonar.jacoco.reportPath> <sonar.core.codeCoveragePlugin>jacoco</sonar.core.codeCoveragePlugin> <sonar.skippedModules>morseflash-instrumentation</sonar.skippedModules> <sonar.exclusions>**/org/jacoco/**</sonar.exclusions> <jacoco.version>0.6.2.201302030002</jacoco.version> </properties> <dependencyManagement> <dependencies> <dependency> <groupId>org.jacoco</groupId> <artifactId>org.jacoco.agent</artifactId> <version>${jacoco.version}</version> <classifier>runtime</classifier> </dependency> </dependencies> </dependencyManagement> <build> <pluginManagement> <plugins> <plugin> <groupId>org.jacoco</groupId> <artifactId>jacoco-maven-plugin</artifactId> <version>${jacoco.version}</version> </plugin> </plugins> </pluginManagement> </build> </profile> 25
  • 26. Maven profiles application module (includes unit testing) <profile> <id>sonar</id> <dependencies> <dependency> <groupId>org.jacoco</groupId> <artifactId>org.jacoco.agent</artifactId> <classifier>runtime</classifier> <scope>compile</scope> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.jacoco</groupId> <artifactId>jacoco-maven-plugin</artifactId> <executions> <execution> <id>instrument-classes</id> <goals> <goal>instrument</goal> </goals> <configuration> <excludes> <exclude>*test*</exclude> <exclude>*/test/*</exclude> </excludes> </configuration> </execution> <execution> <id>restore-instrumented-classes</id> <phase>package</phase> <goals> <goal>restore-instrumented-classes</goal> </goals> </execution> </executions> </plugin> <plugin> <groupId>com.jayway.maven.plugins.android.generation2</groupId> <artifactId>android-maven-plugin</artifactId> <configuration> <test> <coverage>true</coverage> <createReport>true</createReport> </test> </configuration> <extensions>true</extensions> </plugin> </plugins> </build> </profile> 26
  • 27. Maven profiles integration testing module <profiles> <profile> <id>sonar</id> <build> <plugins> <plugin> <groupId>com.jayway.maven.plugins.android.generation2</groupId> <artifactId>android-maven-plugin</artifactId> <configuration> <dex> <!-- Required for EMMA --> <noLocals>true</noLocals> </dex> <test> <coverage>true</coverage> <createReport>true</createReport> </test> </configuration> <executions> <execution> <id>pull-coverage</id> <phase>post-integration-test</phase> <goals> <goal>pull</goal> </goals> <configuration> <pullSource>/data/data/com.simpligility.android.morseflash/files/coverage.ec</pullSource> <pullDestination>${project.basedir}/../morseflash-app/target/jacoco-it.exec</pullDestination> </configuration> </execution> </executions> </plugin> </plugins> </build> </profile> </profiles> 27
  • 28. Run it! >  mvn  -­‐P  sonar  clean  install >  mvn  -­‐P  sonar  sonar:sonar 28
  • 30. Why Use Sonar? Mobile projects are small and short, is it applicable? Three typical uses cases: Small and short projects Assessments Bigger projects (there are!) 30
  • 31. Stay in touch! Objective-C plugin: https://github.com/octotechnology/sonar-objective-c Sonar Android Lint plugin: https:// github.com/SonarCommunity/sonar-android Quality Analysis Tools for Android: https://github.com/stephanenicolas/QualityTools-for-Android http://fr.slideshare.net/jeromevdl/droidconparis-2013 31
  • 32. Questions/Answers © OCTO 2013 Avenue du Théâtre 7 1005 Lausanne - SUISSE Tél : +41 (0) 21 312 94 15 Fax : +41 (0) 21 312 94 16 www.octo.ch 32