Technology

DroidconUK 2013 : Beef up android apps with java tools

Description
1. BEEF UP ANDROID APPS USING JAVA TOOLS Stéphane Nicolas & Jérôme Van Der Linden 2. 2   Jerome Van Der Linden android-­‐holo-­‐colors.com   jeromevdl  …
Categories
Published
of 36
All materials on our website are shared by users. If you have any questions about copyright issues, please report us to resolve them. We are always happy to assist you.
Related Documents
Share
Transcript
  • 1. BEEF UP ANDROID APPS USING JAVA TOOLS Stéphane Nicolas & Jérôme Van Der Linden
  • 2. 2   Jerome Van Der Linden android-­‐holo-­‐colors.com   jeromevdl   @jeromevdl   +jerome  van  der  linden  
  • 3. 3   Stéphane Nicolas ox   BoundB And  others  :  RoboDemo,  Quality  Analysis  Tools  for  Android,  android-­‐maven-­‐plugin,  …   stephanenicolas   snicolas   +stephane  nicolas  
  • 4. 4  
  • 5. 5   1 ONCE UPON A TIME JAVA ENVIRONMENT
  • 6. 6   4  
  • 7. 7   Everything is testable Everything is measurable Everything is integrated No excuses to have poor apps !
  • 8. 8   Great !
  • 9. 9   And me ?!
  • 10. 10   2 WTF ?! ANDROID IS JAVA !
  • 11. 11   Almost YES… … a story of Virtual Machine So what … ?
  • 12. 12   3  
  • 13. Oh Yeah !
  • 14. 14   (almost) (almost) Everything is testable Everything is measurable BUT Everything is NOT integrated
  • 15. 15   Quality Tools for Android http://goo.gl/zGFvda
  • 16. 16   3 Quality Tools Android Ant
  • 17. 18   4 Quality Tools Android Maven
  • 18. 19   The magical plugin <plugin>! <groupId>com.jayway.maven.plugins.android.generation2</groupId> "! <artifactId>android-maven-plugin</artifactId>! <version>3.6.1</version>! </plugin>!
  • 19. 20   The ultimate profile # run junit, robotium, robolectric tests and get code coverage! > mvn clean install –P jacoco!
  • 20. 21   Maven Profiles Junit  +   Robo,um Robolectric UIAutomator Code   coverage standard emma cobertura ui   automator spoon jacoco x2   Quality   checks   (Checkstyle  +   findbugs  +   PMD  +  lint) Sonar
  • 21. 22   Android Lint Sonar plugin # analyse code (pmd, checkstyle, findbugs, lint) and report in sonar! > mvn sonar:sonar –P jacoco! hOps://github.com/SonarCommunity/sonar-­‐android  
  • 22. 23   Not an archetype (see akquinet : http://goo.gl/O46LIw) Only samples Do not use everything ! Pick up what you need !
  • 23. 24   Return of real life experience Maven   Jenkins   Sonar  (PMD,  checkstyle,  findbugs,  lint)   Junit  (Instrumenta[onTestCase)   ~  100  screens  (phone  +  tablet)   ~  5  developers  during  only  5  months   ~  60k  loc  (java),  15k  loc  (xml)   ~  400  unit  tests  :  not  an  excep[onal  coverage  (~  30%)   Built  on  each  commit  on  Jenkins  +  Genymo[on   0  lint,  pmd,  findbugs,  checkstyle  viola[ons   1  sonar  report  generated  each  night  with  those  metrics     è  An  happy  customer  J  
  • 24. 25   Lessons learned A  laborious  development  environment  :   eclipse  +  maven  +  m2eclipse  +  android  m2e  connector   è Many  hours  lost  è  Use  IntelliJ  !     A  laborious  execu[on  environment  :  emulator   è  Too  slow  è  Use  Genymo[on  (or  at  least  a  device)  !     Not  enough  tests  :   è Instrumenta[onTestCase  are  too  heavy/slow  for  Unit  Tes[ng     è Use  Robolectric  and/or  think  about  MV*  paOern   è  Keep  Instrumenta[onTestCase  for  Android  specific  (Ac[vity,   Services,  …)    
  • 25. 26   Lessons learned A  robust  development  environment  :   eclipse  +  maven  +  m2eclipse  +  android  m2e  connector   è  s[ll  some  problem  with  eclipse  and  maven  integra[on     About  tests   è Instrumenta[onTestCase  are  fast  enough  with  GenyMo[on   è  Robolectric  can’t  give  you  enough  confidence      
  • 26. 27   5 Quality Tools Android Gradle
  • 27. 28   Before     V  0.6   Lint UIAutomator Monkey & Monkey Runner Robolectric PMD, checkstyle, findbugs Emma, Cobertura, Jacoco
  • 28. Joke ?!
  • 29. 30   V  0.6.+   Lint UIAutomator Monkey & Monkey Runner Robolectric PMD, checkstyle, findbugs Emma, Cobertura, Jacoco
  • 30. 31   Quality # # > # > the gradle way run junit, robotium, robolectric tests ! AND Chekstyle + PMD + Findbugs + Classycle! gradle check! report in sonar! gradle sonarRunner!
  • 31. 32   6 Conclusion Android is filling the gap
  • 32. Gradle Feature Application Variants & Manifest merging Standard  tests  &  Robo,um Code  Coverage   Robolectric UI  automator  /  Monkey  /   Monkey  Runner PMD  /  CheckStyle  /   FindBgugs  /  Classycle  /  Lint Sonar  &  Project  Sites 0.6.1 VS Maven Gradle Maven ? 33   3.6.1
  • 33. Android offers 34   lots of quality tools lots of testing methods rapid testing Everything gets easier to use Build rock solid apps
  • 34. 35   Thank You ! Any Question ? stephanenicolas   jeromevdl   snicolas   @jeromevdl   Stéphane Nicolas & Jérôme Van Der Linden +stephane  nicolas   +jerome  van  der  linden  
  • 35. 36   Quality Tools for Android http://goo.gl/zGFvda
  • We Need Your Support
    Thank you for visiting our website and your interest in our free products and services. We are nonprofit website to share and download documents. To the running of this website, we need your help to support us.

    Thanks to everyone for your continued support.

    No, Thanks