Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Behavior Driven Development in Android

3a7c04e082380dc5d76182aefb1e244a?s=47 Selim
September 29, 2016

Behavior Driven Development in Android

The way to find BDD for Android Apps development!

3a7c04e082380dc5d76182aefb1e244a?s=128

Selim

September 29, 2016
Tweet

More Decks by Selim

Other Decks in Technology

Transcript

  1. Behavior Driven Development in Android Teresa Holfeld + Selim Salman

    | Ubilabs
  2. Who is talking? Teresa Holfeld Head of Mobile @ Ubilabs

    @TeresaHolfeld Selim Salman Android Engineer @ Ubilabs @A_SelimS
  3. None
  4. Testing

  5. Testing Src: http://giphy.com/

  6. Test Driven Development

  7. Test Driven Development

  8. Behavior Driven Development

  9. Behavior Driven Development

  10. UI Testing in Android • Espresso • Espresso Test Recorder

    • UIAutomator • Monkey (Command Line) • Monkeyrunner (Python) • … >Not Plain Natural Language BDD!
  11. Cucumber Cucumber: • Software tool for writing automated acceptance tests

    in BDD • Gherkin: Given - When - Then • Ruby
  12. Cucumber

  13. Cucumber Keywords: • Feature • Scenario • Given, When, Then,

    And, But (Steps) • Background • Scenario Outline • Examples
  14. Cucumber There are a few extra keywords as well: •

    """ (Doc Strings) • | (Data Tables) • @ (Tags) • # (Comments) https://cucumber.io/docs/reference
  15. Calabash Calabash: • Framework for automated acceptance tests for iOS

    and Android • By Xamarin Calabash-android: • Calabash testing framework for Android • Uses Cucumber + Gherkin • Ruby
  16. Calabash

  17. Calabash show_tracks.feature

  18. Calabash

  19. Calabash

  20. Calabash show_tracks.feature

  21. Calabash Calabash console

  22. Calabash Calabash console

  23. Calabash Calabash console

  24. Calabash show_tracks.feature

  25. Calabash calabash_steps.rb

  26. Calabash-android demo!

  27. None
  28. To Test: I only want Java & plain English!

  29. Cucumber + Espresso + Gradle // Espresso androidTestCompile('com.android.support.test:runner:0.5') androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2') androidTestCompile('com.android.support.test.espresso:espresso-contrib:2.2.2')

    // Cucumber androidTestCompile('info.cukes:cucumber-android:1.2.4') androidTestCompile('info.cukes:cucumber-picocontainer:1.2.4') androidTestCompile('info.cukes:cucumber-jvm-deps:1.0.3') // Screenshots androidTestCompile('com.squareup.spoon:spoon-client:1.2.0')
  30. Cucumber + Espresso + Gradle

  31. Cucumber + Espresso + Gradle

  32. Cucumber + Espresso + Gradle

  33. Cucumber + Espresso + Gradle ./gradlew connectedCheck :app:connectedCheck Retrieving Cucumber

    test report to /Users/aselims/AndroidStudioProjects/CucumberJava/app/build BUILD SUCCESSFUL
  34. Cucumber + Espresso + Gradle

  35. Cucumber + Espresso + Gradle

  36. Other frameworks APPIUM, ROBOTIUM, Calabash ... JDave, Concordion, Easyb, JBehave,

    Cucumber ...
  37. All good or what? + Serves as a technical documentation

    + Non-tech staff can understand + Enforces well-defined acceptance criteria + Easy to run, easy to learn - Comes with overhead: have to develop steps in Ruby - Not very mature: you have to implement certain things yourself (e.g. scrolling in RecyclerView) - You cannot go outside the app (e.g. Intents for image selection, email…)
  38. Useful Links https://github.com/calabash/calabash-android https://www.agilealliance.org/glossary/bdd/ https://cucumber.io/docs/reference https://github.com/sebaslogen/CleanGUITestArchitecture

  39. Danke! You may ask your questions now ;)