Testing With Open Source


Published on

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

Published in: Technology
1 Like
  • Be the first to comment

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

Testing With Open Source

  1. 1. Testing Android with Open Source ~ Matthias Käppler ~ February 23rd, 2010   
  2. 2. 1h 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    
  3. 3. Europes leading local review site 17M uniques Im the Android guy at Qype.com!   
  4. 4. Android testingHow do we write tests for Android?    
  5. 5. Android testing As usual! Android uses JUnit 3 android.test: AndroidTestCase < junit.framework.TestCaseInstrumentationTestCase < junit.framework.TestCase    
  6. 6. Android testing AndroidTestCase ApplicationTestCase ProviderTestCase2 ServiceTestCase   
  7. 7. Android testing InstrumentationTestCase (SyncBaseInstrumentation) (SingleLaunchActivityTestCase) ActivityUnitTestCase ActivityInstrumentationTestCase2   
  8. 8. Android testingHow do we run tests for Android?    
  9. 9. Android testing Using Instrumentation.   
  10. 10. Android testing Work it!   
  11. 11. Build management Nice, we have tests now. But my build server doesnt click buttons.   
  12. 12. Build managementWe need something that can runbuilds from the command line.   
  13. 13. Build managementMaven 2 does these sorts of things. (and MUCH more, in fact)    
  14. 14. Build management Maven 2 is a build system.   
  15. 15. Build management Maven 2 is a dependency management system.   
  16. 16. Build management Maven 2 is a life-cycle management system.   
  17. 17. Build management Maven 2 is a report and documentation generator.   
  18. 18. Build management In fact: Maven 2 is a platform.   
  19. 19. Build management Theres a plugin for Android! maven-android-plugin   
  20. 20. Build managementMavens central notion is the project. Its described by the POM.    
  21. 21. Android testing Lets have a look at one...   
  22. 22. Build automationNice, we can now build and deploy our app from the command line. But we still have to do it manually.    
  23. 23. Build automationWhat we need is a build server, which automatically triggers builds.    
  24. 24. Build automationHudson does these sorts of things.    
  25. 25. Build automationHudson is a continuuous integration server. It can run builds when people commit pieces of work. This is extremely helpful for discovering software regressions early on.    
  26. 26. Build automation Hudson is a Java Web application. It consists of a single WAR. $ java -jar hudson.war   
  27. 27. Build automation Lets run it.   
  28. 28. More information maven.apache.orgcode.google.com/p/maven-android-plugin hudson-ci.org