Behavior Driven Development in Android

Sponsored · Your Podcast. Everywhere. Effortlessly. Share. Educate. Inspire. Entertain. You do you. We'll handle the rest. →
Selim
September 29, 2016

Behavior Driven Development in Android

The way to find BDD for Android Apps development!

Selim

September 29, 2016

Annual Pro sale · Save $30

Have presentations of your own?

Share with private links, password protection, and more control over your work.

Transcript

39 slides
  1. Who is talking? Teresa Holfeld Head of Mobile @ Ubilabs

    @TeresaHolfeld Selim Salman Android Engineer @ Ubilabs @A_SelimS
  2. UI Testing in Android • Espresso • Espresso Test Recorder

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

    in BDD • Gherkin: Given - When - Then • Ruby
  4. Cucumber Keywords: • Feature • Scenario • Given, When, Then,

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

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

    and Android • By Xamarin Calabash-android: • Calabash testing framework for Android • Uses Cucumber + Gherkin • Ruby
  7. 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')
  8. Cucumber + Espresso + Gradle ./gradlew connectedCheck :app:connectedCheck Retrieving Cucumber

    test report to /Users/aselims/AndroidStudioProjects/CucumberJava/app/build BUILD SUCCESSFUL
  9. 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…)

More Decks by Selim

Other Decks in Technology