Cracking android app. Мокиенко Сергей

27
CRACKING ANDROID APP Sergei Mokienko

Transcript of Cracking android app. Мокиенко Сергей

CRACKING ANDROID APPSergei Mokienko

ABOUT ME

3+ Android development

5+ в IT

Witness of 90% coverage

Agile addict

AGENDA

Do tests exist on mobile projects ?

Can business write tests ?

How to face release dates without red eyes ?

WHEN DO WE NEED TESTS ?

•When we are going to support codebase for a long time

•When the whole team agrees on writing tests

•When tests gives real value but not statistics

•When we are developing API for external services

Unit testing

+ +

Clean java way

•Works with clean java (less Android

dependencies is best)

•Tests running on local JVM

•Android studio 1.0 + Gradle plugin 1.1.0+

supports running from IDE

Setting up Android Studio

Create folder test/java under app/src

Create test suit

Mocking Android

+

•Helps with unit tests for logic that is tightly coupled with Android SDK

•We can still run tests on local VM • Nice assertions

Integration tests

Espresso

•No unnecessary waits for UI thread events •Officially supported by Google •Works with Android Instrumentation •Harmcrest assertions •JUnit 4

What Espresso can do ?Work with views

Work with adapter views

Check intents

Spoon

•Running tests on several devices simultaneously •Taking screen shots •Great reports •Run specific tests on multiple devices •Choose device where you want tests to run

Add grade plugin for spoon

Add plugin to your app module

Run spoon task gradle spoon

BDD

What BDD is ?•Behavior Driven Development

•Usage of DSL (Domain Specific Languages)

•Clear implementation understanding

•More tests approved by management

•High product owner involvement

•Lots of tests =)

Acceptance test Formula

As a [role] I want [feature] so that [benefit]

Acceptance criteria Formula

Given [initial context] when [event occurs] then [ensure some outcomes]

Calabash Android

•Cucumber wrapper

•Integrates with Xamarin cloud

•Cross-platform

•Flexible

•Large collection of predefined steps

•Continuous Integration support

Cucumber

•Gherkin

•Scenarios

•Feature definitions

•Step definitions

Cucumber + Ruby + Robotium

=

Calabash as is

Continuous Integration

Why ?

•Fast integration bug allocation •No panic when release happens •No merges with bug happens •Every body knows where they can find build •Enforces discepline •Automatic metrics generation

How ?

Questions ?