Download - Building High Quality Android Applications
![Page 1: Building High Quality Android Applications](https://reader034.vdocuments.mx/reader034/viewer/2022042606/547da93ab4af9f92358b45ef/html5/thumbnails/1.jpg)
Building High Quality Android Apps
By using Jenkins and Automated Device Tests
![Page 2: Building High Quality Android Applications](https://reader034.vdocuments.mx/reader034/viewer/2022042606/547da93ab4af9f92358b45ef/html5/thumbnails/2.jpg)
Getting to know each other...
Leif JanzikTeam-Lead Android Development adesso mobile solutions GmbH
Twitter: @ElliotMonsterBlog: www.thoughtsonmobile.com
![Page 3: Building High Quality Android Applications](https://reader034.vdocuments.mx/reader034/viewer/2022042606/547da93ab4af9f92358b45ef/html5/thumbnails/3.jpg)
About adesso mobile solutions GmbH
• adesso mobile solutions GmbH, Dortmund, 65 MA (Ende 2012)• Tochterunternehmen der adesso AG, Dortmund, ca. 1.100 MA
(Ende 2012)• führender Anbieter in den Bereichen mobiles Internet, mobile
Applikationen und Mobile Marketing• Portfolio: Beratung, Konzeption, Realisierung, Review, Test und
Betrieb von Mobilisierungs-Projekten und App-Lösungen• Kunden: Über 200 realisierten Portalen und Applikationen für
Kunden wie Daimler, PAYBACK, ERGO, süddeutsche.de, SportScheck, die Volksbanken Raffeisenbanken, Bundesagentur für Arbeit.
![Page 4: Building High Quality Android Applications](https://reader034.vdocuments.mx/reader034/viewer/2022042606/547da93ab4af9f92358b45ef/html5/thumbnails/4.jpg)
http://www.flickr.com/photos/fullcodepress/
So you are an Android Developer and everything is f***ing awesome...
![Page 5: Building High Quality Android Applications](https://reader034.vdocuments.mx/reader034/viewer/2022042606/547da93ab4af9f92358b45ef/html5/thumbnails/5.jpg)
http://www.flickr.com/photos/fullcodepress/
Everyone loves your Apps
![Page 6: Building High Quality Android Applications](https://reader034.vdocuments.mx/reader034/viewer/2022042606/547da93ab4af9f92358b45ef/html5/thumbnails/6.jpg)
http://www.flickr.com/photos/fullcodepress/
Your companies headquarter looks like these
![Page 7: Building High Quality Android Applications](https://reader034.vdocuments.mx/reader034/viewer/2022042606/547da93ab4af9f92358b45ef/html5/thumbnails/7.jpg)
http://www.flickr.com/photos/fullcodepress/
Everything is perfect!
![Page 8: Building High Quality Android Applications](https://reader034.vdocuments.mx/reader034/viewer/2022042606/547da93ab4af9f92358b45ef/html5/thumbnails/8.jpg)
http://www.flickr.com/photos/fullcodepress/
BUT
![Page 9: Building High Quality Android Applications](https://reader034.vdocuments.mx/reader034/viewer/2022042606/547da93ab4af9f92358b45ef/html5/thumbnails/9.jpg)
http://www.flickr.com/photos/fullcodepress/
... time goes on, and the apps evolves, new features, new API-levels, bugfixes etc.
![Page 10: Building High Quality Android Applications](https://reader034.vdocuments.mx/reader034/viewer/2022042606/547da93ab4af9f92358b45ef/html5/thumbnails/10.jpg)
http://www.flickr.com/photos/fullcodepress/
There are „some“ new devices ... ... every day
![Page 11: Building High Quality Android Applications](https://reader034.vdocuments.mx/reader034/viewer/2022042606/547da93ab4af9f92358b45ef/html5/thumbnails/11.jpg)
And after some Versions, Refactorings & new Features your Code looks more like this...
![Page 12: Building High Quality Android Applications](https://reader034.vdocuments.mx/reader034/viewer/2022042606/547da93ab4af9f92358b45ef/html5/thumbnails/12.jpg)
you try to keep everything fine and running...
![Page 13: Building High Quality Android Applications](https://reader034.vdocuments.mx/reader034/viewer/2022042606/547da93ab4af9f92358b45ef/html5/thumbnails/13.jpg)
... but the number of bugs continues to grow ...
![Page 14: Building High Quality Android Applications](https://reader034.vdocuments.mx/reader034/viewer/2022042606/547da93ab4af9f92358b45ef/html5/thumbnails/14.jpg)
maybe your customers will react like this?
![Page 15: Building High Quality Android Applications](https://reader034.vdocuments.mx/reader034/viewer/2022042606/547da93ab4af9f92358b45ef/html5/thumbnails/15.jpg)
... but more likely they will react like this ...
![Page 16: Building High Quality Android Applications](https://reader034.vdocuments.mx/reader034/viewer/2022042606/547da93ab4af9f92358b45ef/html5/thumbnails/16.jpg)
... Your companies new headquarter ...
![Page 17: Building High Quality Android Applications](https://reader034.vdocuments.mx/reader034/viewer/2022042606/547da93ab4af9f92358b45ef/html5/thumbnails/17.jpg)
... and being a Android Developer is no fun no more.
![Page 18: Building High Quality Android Applications](https://reader034.vdocuments.mx/reader034/viewer/2022042606/547da93ab4af9f92358b45ef/html5/thumbnails/18.jpg)
Ok, maybe I exagerated a bit, BUT
• Android Apps grow more and more complex• Customers expect a bugfree and undisturbed App
experience• Tolerance even for minor bugs continues to shrink• Device fragmentation makes testing a sisysphean task
![Page 19: Building High Quality Android Applications](https://reader034.vdocuments.mx/reader034/viewer/2022042606/547da93ab4af9f92358b45ef/html5/thumbnails/19.jpg)
Some „everyday-problems“ we had to solve
• Apps have to be build in many different Versions (e.g. Development/Staging-Enviroment) or different brandings
• Developers are often disturbed, e.g. when a AdHoc for the customer is needed
• Changes in App Components lead to new bugs, which were discovered later.
![Page 20: Building High Quality Android Applications](https://reader034.vdocuments.mx/reader034/viewer/2022042606/547da93ab4af9f92358b45ef/html5/thumbnails/20.jpg)
so what is the solution to this problem?
![Page 21: Building High Quality Android Applications](https://reader034.vdocuments.mx/reader034/viewer/2022042606/547da93ab4af9f92358b45ef/html5/thumbnails/21.jpg)
exessive Testing ...
![Page 22: Building High Quality Android Applications](https://reader034.vdocuments.mx/reader034/viewer/2022042606/547da93ab4af9f92358b45ef/html5/thumbnails/22.jpg)
but testing your own app is soooooo boring! (so it might be skipped or not done thoroughly)
![Page 23: Building High Quality Android Applications](https://reader034.vdocuments.mx/reader034/viewer/2022042606/547da93ab4af9f92358b45ef/html5/thumbnails/23.jpg)
that‘s why we automated much of our testing and our build process.
![Page 24: Building High Quality Android Applications](https://reader034.vdocuments.mx/reader034/viewer/2022042606/547da93ab4af9f92358b45ef/html5/thumbnails/24.jpg)
„Our“ solution
• a clean and reliable development workflow• a toolchain which supports the developers and keeps
disturbing work away• Continuous refactoring of the apps• Maven for lesser configuration for every developer and
easier modularisation• Automated Device Tests• Continuous integration
![Page 25: Building High Quality Android Applications](https://reader034.vdocuments.mx/reader034/viewer/2022042606/547da93ab4af9f92358b45ef/html5/thumbnails/25.jpg)
What is Continuous Integration?
• Automate everything
• Build as often as possible• Build early, build often• e.g. on every commit• or nightly builds
![Page 26: Building High Quality Android Applications](https://reader034.vdocuments.mx/reader034/viewer/2022042606/547da93ab4af9f92358b45ef/html5/thumbnails/26.jpg)
Benefits of Continuous Integration
• Fewer Errors• very important, not everybody installs every update, so
bugs might never be fixed on a customers device• Fast Feedback• Tests everything on every (nightly) build• Much less manual testing• Cheaper• Happier developers
• Regression-Tests without additional effort
![Page 27: Building High Quality Android Applications](https://reader034.vdocuments.mx/reader034/viewer/2022042606/547da93ab4af9f92358b45ef/html5/thumbnails/27.jpg)
Automate...
• ...Builds• ...Unit Testing• ...Device Tests• ...Code Coverage & Static Analysis• ...Deployment
![Page 28: Building High Quality Android Applications](https://reader034.vdocuments.mx/reader034/viewer/2022042606/547da93ab4af9f92358b45ef/html5/thumbnails/28.jpg)
3 Major Build Profiles
Build after Commit Nightly Build Release or Promoted Build
• Build and archive APK• Run Unit-Tests• Run Sonar Code
Metrics
• Build Project without archiving/publishing APK
• Run Unit-Tests• Run Calabash Tests
• Build APK• Run Unit-Tests• Run Calabash Tests• Keep apk „forever“• upload apk to webserver
for enterprise delivery or to Google play
![Page 29: Building High Quality Android Applications](https://reader034.vdocuments.mx/reader034/viewer/2022042606/547da93ab4af9f92358b45ef/html5/thumbnails/29.jpg)
Why did we choose Jenkins
• Quasi-Standart CI Server (together with hudson)• A lot of useful plugins• e.g. Maven Plugin, Checkstyle
Plugin, Android Lint Plugin, Sonar Plugin
• Well documented Plugin API for own plugins
![Page 30: Building High Quality Android Applications](https://reader034.vdocuments.mx/reader034/viewer/2022042606/547da93ab4af9f92358b45ef/html5/thumbnails/30.jpg)
Our Jenkins System
Jenkins Master
Jenkins iOS
Jenkins Android
Jenkins Windows
Jenkins MobileWeb
![Page 31: Building High Quality Android Applications](https://reader034.vdocuments.mx/reader034/viewer/2022042606/547da93ab4af9f92358b45ef/html5/thumbnails/31.jpg)
Automate...
• ...Builds• ...Unit Testing• ...Device Tests• ...Code Coverage & Static Analysis• ...Deployment
![Page 32: Building High Quality Android Applications](https://reader034.vdocuments.mx/reader034/viewer/2022042606/547da93ab4af9f92358b45ef/html5/thumbnails/32.jpg)
why do we need automated ui-tests?
• Not all parts are covered by classic Unit-Tests•Manual Integration Tests take a lot of time•Manual tests are very boring and developers tend to skip
them• Device fragmentation grows every day ...
![Page 33: Building High Quality Android Applications](https://reader034.vdocuments.mx/reader034/viewer/2022042606/547da93ab4af9f92358b45ef/html5/thumbnails/33.jpg)
automated UI-Tests with Calabash
• Cucumber based Testing Tool• Test-Specs are human readable, even for non-programmers• Both mayor platforms iOS & Android are supported with a identical
Syntax• Runs in Simulator/Emulator and on Devices
![Page 34: Building High Quality Android Applications](https://reader034.vdocuments.mx/reader034/viewer/2022042606/547da93ab4af9f92358b45ef/html5/thumbnails/34.jpg)
Example
![Page 35: Building High Quality Android Applications](https://reader034.vdocuments.mx/reader034/viewer/2022042606/547da93ab4af9f92358b45ef/html5/thumbnails/35.jpg)
• All Calabash-Tests run on real Devices, so the results are much more reliable
![Page 36: Building High Quality Android Applications](https://reader034.vdocuments.mx/reader034/viewer/2022042606/547da93ab4af9f92358b45ef/html5/thumbnails/36.jpg)
Automate...
• ...Builds• ...Unit Testing• ...Device Tests• ...Code Coverage & Static Analysis• ...Deployment
![Page 37: Building High Quality Android Applications](https://reader034.vdocuments.mx/reader034/viewer/2022042606/547da93ab4af9f92358b45ef/html5/thumbnails/37.jpg)
Publish Code Analysis Results to Sonar
![Page 38: Building High Quality Android Applications](https://reader034.vdocuments.mx/reader034/viewer/2022042606/547da93ab4af9f92358b45ef/html5/thumbnails/38.jpg)
Automate...
• ...Builds• ...Unit Testing• ...Device Tests• ...Code Coverage & Static Analysis• ...Deployment
![Page 39: Building High Quality Android Applications](https://reader034.vdocuments.mx/reader034/viewer/2022042606/547da93ab4af9f92358b45ef/html5/thumbnails/39.jpg)
Any questions?
![Page 40: Building High Quality Android Applications](https://reader034.vdocuments.mx/reader034/viewer/2022042606/547da93ab4af9f92358b45ef/html5/thumbnails/40.jpg)
Thank youHave a nice day at DroidCon
PS: if you are an StartUp or have a great idea (for mobile) ask me for informations on the „adesso mobile fond“