Slide 1

Slide 1 text

Talking myself into the value of acceptance testing

Slide 2

Slide 2 text

@mokagio (click to see these slides in the browser)

Slide 3

Slide 3 text

Before we begin...

Slide 4

Slide 4 text

Acceptance Test != Unit Test

Slide 5

Slide 5 text

DO. WRITE. UNIT. TESTS.

Slide 6

Slide 6 text

Acceptance Test != Automated Test

Slide 7

Slide 7 text

Having the intern make sure that when logging in with Facebook the profile picture is the set correctly is a test for an acceptance criteria

Slide 8

Slide 8 text

⌘U, Xcode Bots, Travis CI, Jenkins, etc, can be used to run unit tests automatically

Slide 9

Slide 9 text

Automated Acceptance Tests = Acceptance tests run automatically

Slide 10

Slide 10 text

This talk is about (automated) acceptance tests

Slide 11

Slide 11 text

Content Problems When they are valuable Who they are valuable for How to get started

Slide 12

Slide 12 text

Problems

Slide 13

Slide 13 text

Long to write

Slide 14

Slide 14 text

Slow to run

Slide 15

Slide 15 text

Expensive to maintain

Slide 16

Slide 16 text

Still need QA

Slide 17

Slide 17 text

Apple doesn't care

Slide 18

Slide 18 text

When they are valuable

Slide 19

Slide 19 text

"State-intense" & "many-branches" apps

Slide 20

Slide 20 text

Refactoring legacy spaghetti code

Slide 21

Slide 21 text

The client with the JIRA board and the acceptance criterias

Slide 22

Slide 22 text

Who they are valuable for

Slide 23

Slide 23 text

big-medium teams with clear requirements and relaxed deadlines

Slide 24

Slide 24 text

small/one man teams with green product and need for fast pace

Slide 25

Slide 25 text

Just try it out and see how it goes

Slide 26

Slide 26 text

How to get started

Slide 27

Slide 27 text

UIAutomation

Slide 28

Slide 28 text

Apple UI Testing

Slide 29

Slide 29 text

Apple UI Testing / * * * W h e n I t a p t h e " s a y h e l l o " b u t t o n , I s e e a g r e e t i n g s a l e r t . * / t e s t S a y H e l l o ( ) { l e t a p p = X C U I A p p l i c a t i o n ( ) a p p . b u t t o n s [ " s a y h e l l o " ] . t a p ( ) a p p . a l e r t s [ " H e l l o " ] . c o l l e c t i o n V i e w s . b u t t o n s [ " D i s m i s s " ] . t a p ( ) }

Slide 30

Slide 30 text

Apple UI Testing / * * * W h e n I t a p t h e " s h o w e l e m e n t e s " b u t t o n , I s e e t h e l i s t w i t h * t h e e l e m e n t s o f t h e p e r i o d i c t a b l e . * / t e s t S h o w E l e m e n t s ( ) { l e t a p p = X C U I A p p l i c a t i o n ( ) a p p . b u t t o n s [ " s h o w e l e m e n t s " ] . t a p ( ) X C T A s s e r t E q u a l ( a p p . t a b l e s . c o u n t , 1 ) l e t t a b l e = a p p . t a b l e s . e l e m e n t A t I n d e x ( 0 ) l e t p e r i o d i c T a b l e E l e m e n t s C o u n t : U I n t = 1 1 8 X C T A s s e r t E q u a l ( t a b l e . c e l l s . c o u n t , p e r i o d i c T a b l e E l e m e n t s C o u n t ) }

Slide 31

Slide 31 text

KIF

Slide 32

Slide 32 text

KIF d e s c r i b e ( @ " M a i n s c r e e n " , ^ { c o n t e x t ( @ " w h e n I t a p t h e ' s a y h e l l o ' b u t t o n " , ^ { b e f o r e ( ^ { [ t e s t e r t a p V i e w W i t h A c c e s s i b i l i t y L a b e l : k S a y H e l l o ] ; } ) ; i t ( @ " I s e e a g r e e t i n g s a l e r t " , ^ { [ t e s t e r w a i t F o r V i e w W i t h A c c e s s i b i l i t y L a b e l : k H e l l o A l e r t T i t l e ] ; [ t e s t e r w a i t F o r V i e w W i t h A c c e s s i b i l i t y L a b e l : k H e l l o A l e r t M e s s a g e ] ; [ t e s t e r w a i t F o r V i e w W i t h A c c e s s i b i l i t y L a b e l : k H e l l o A l e r t B u t t o n ] ; } ) ; } ) ; } ) ;

Slide 33

Slide 33 text

Calabash and Appium

Slide 34

Slide 34 text

Were do I begin?

Slide 35

Slide 35 text

Add an acceptance test for the most important feature

Slide 36

Slide 36 text

Add an acceptance test for every new bug fix

Slide 37

Slide 37 text

"A bug is only a test that hasn't been written yet" - I don't know who said this

Slide 38

Slide 38 text

Where to go from here Xcode 7 UI testing - WWDC KIF on GitHub mokacoding.com > Acceptance Testing Generative Testing

Slide 39

Slide 39 text

And remember...

Slide 40

Slide 40 text

DO. WRITE. UNIT. TESTS.

Slide 41

Slide 41 text

Thanks

Slide 42

Slide 42 text

❓ Questions?