keeping your users happy with testable apps - greg shackles

56
Greg Shackles OLO @gshackles [email protected] github.com/gshackles Keeping Your Users Happy With Testable Apps Thursday, May 9, 13

Post on 17-Oct-2014

757 views

Category:

Technology


1 download

DESCRIPTION

 

TRANSCRIPT

Page 2: Keeping your users happy with testable apps - Greg Shackles

TDD

Thursday, May 9, 13

Page 3: Keeping your users happy with testable apps - Greg Shackles

TDDKISSSOLID

BDDDRY

SOC

YAGNI

DDD

SRP OCPLSP ISP

DIPXP

IOC CQS

Thursday, May 9, 13

Page 4: Keeping your users happy with testable apps - Greg Shackles

Thursday, May 9, 13

Page 5: Keeping your users happy with testable apps - Greg Shackles

Why Test?

Thursday, May 9, 13

Page 6: Keeping your users happy with testable apps - Greg Shackles

Stability

Thursday, May 9, 13

Page 7: Keeping your users happy with testable apps - Greg Shackles

Stability

•Obvious, but important

Thursday, May 9, 13

Page 8: Keeping your users happy with testable apps - Greg Shackles

Stability

•Obvious, but important

•Refactor and iterate with a safety net

Thursday, May 9, 13

Page 9: Keeping your users happy with testable apps - Greg Shackles

Stability

•Obvious, but important

•Refactor and iterate with a safety net

•Compilation is only the first unit test

Thursday, May 9, 13

Page 10: Keeping your users happy with testable apps - Greg Shackles

Stability

•Obvious, but important

•Refactor and iterate with a safety net

•Compilation is only the first unit test

•Verify cross-platform compatibility

Thursday, May 9, 13

Page 11: Keeping your users happy with testable apps - Greg Shackles

“I don’t have time to write tests!”

Thursday, May 9, 13

Page 12: Keeping your users happy with testable apps - Greg Shackles

“I don’t have time to NOT write tests!”

Thursday, May 9, 13

Page 13: Keeping your users happy with testable apps - Greg Shackles

Once It’s Out, It’s Out

Thursday, May 9, 13

Page 14: Keeping your users happy with testable apps - Greg Shackles

Once It’s Out, It’s Out

•This isn’t the web

Thursday, May 9, 13

Page 15: Keeping your users happy with testable apps - Greg Shackles

Once It’s Out, It’s Out

•This isn’t the web

•Difficult and expensive to

fix

Thursday, May 9, 13

Page 16: Keeping your users happy with testable apps - Greg Shackles

Once It’s Out, It’s Out

•This isn’t the web

•Difficult and expensive to

fix

•Quality bar has been

Thursday, May 9, 13

Page 17: Keeping your users happy with testable apps - Greg Shackles

The Happy Path

Thursday, May 9, 13

Page 18: Keeping your users happy with testable apps - Greg Shackles

•Improves design

The Happy Path

Thursday, May 9, 13

Page 19: Keeping your users happy with testable apps - Greg Shackles

•Improves design

•More shared code (not just mobile apps)

The Happy Path

Thursday, May 9, 13

Page 20: Keeping your users happy with testable apps - Greg Shackles

•Improves design

•More shared code (not just mobile apps)

•Optimize independently of a platform

The Happy Path

Thursday, May 9, 13

Page 21: Keeping your users happy with testable apps - Greg Shackles

•Improves design

•More shared code (not just mobile apps)

•Optimize independently of a platform

•IterationSpeed++

The Happy Path

Thursday, May 9, 13

Page 22: Keeping your users happy with testable apps - Greg Shackles

•Improves design

•More shared code (not just mobile apps)

•Optimize independently of a platform

•IterationSpeed++

•FACT: Green tests are good for the soul

The Happy Path

Thursday, May 9, 13

Page 23: Keeping your users happy with testable apps - Greg Shackles

What To Test?

Thursday, May 9, 13

Page 24: Keeping your users happy with testable apps - Greg Shackles

What to Test?

Thursday, May 9, 13

Page 25: Keeping your users happy with testable apps - Greg Shackles

What to Test?

•100% code coverage != the goal

Thursday, May 9, 13

Page 26: Keeping your users happy with testable apps - Greg Shackles

What to Test?

•100% code coverage != the goal

•Test parts that provide value

Thursday, May 9, 13

Page 27: Keeping your users happy with testable apps - Greg Shackles

What to Test?

•100% code coverage != the goal

•Test parts that provide value

•Testing platform code can be difficult

Thursday, May 9, 13

Page 28: Keeping your users happy with testable apps - Greg Shackles

What to Test?

•100% code coverage != the goal

•Test parts that provide value

•Testing platform code can be difficult

•Start small

Thursday, May 9, 13

Page 29: Keeping your users happy with testable apps - Greg Shackles

Thursday, May 9, 13

Page 30: Keeping your users happy with testable apps - Greg Shackles

!!Unit  Tests

Thursday, May 9, 13

Page 31: Keeping your users happy with testable apps - Greg Shackles

!!

!!

Unit  Tests

Integra-on  Tests

Thursday, May 9, 13

Page 32: Keeping your users happy with testable apps - Greg Shackles

!!

!!

!!

Unit  Tests

Integra-on  Tests

UI  /  UX  Tests

Thursday, May 9, 13

Page 33: Keeping your users happy with testable apps - Greg Shackles

!!

!!

!!

Unit  Tests

Integra-on  Tests

UI  /  UX  Tests Mixed

Automated

Thursday, May 9, 13

Page 34: Keeping your users happy with testable apps - Greg Shackles

Unit / Integration Tests

Thursday, May 9, 13

Page 35: Keeping your users happy with testable apps - Greg Shackles

Unit / Integration Tests

•Automated

Thursday, May 9, 13

Page 36: Keeping your users happy with testable apps - Greg Shackles

Unit / Integration Tests

•Automated

•Low friction

Thursday, May 9, 13

Page 37: Keeping your users happy with testable apps - Greg Shackles

Unit / Integration Tests

•Automated

•Low friction

•Leverage tooling

Thursday, May 9, 13

Page 38: Keeping your users happy with testable apps - Greg Shackles

Unit / Integration Tests

•Automated

•Low friction

•Leverage tooling

•NUnit (Lite)

Thursday, May 9, 13

Page 39: Keeping your users happy with testable apps - Greg Shackles

Unit / Integration Tests

•Automated

•Low friction

•Leverage tooling

•NUnit (Lite)

•Run on all

platforms

Thursday, May 9, 13

Page 40: Keeping your users happy with testable apps - Greg Shackles

Unit / Integration Tests

•Automated

•Low friction

•Leverage tooling

•NUnit (Lite)

•Run on all

platforms

•Simulator vs

Device

Thursday, May 9, 13

Page 41: Keeping your users happy with testable apps - Greg Shackles

Mocking

Thursday, May 9, 13

Page 42: Keeping your users happy with testable apps - Greg Shackles

Mocking

•Limited options

Thursday, May 9, 13

Page 43: Keeping your users happy with testable apps - Greg Shackles

Mocking

•Limited options

•Manual mocking

Thursday, May 9, 13

Page 44: Keeping your users happy with testable apps - Greg Shackles

Mocking

•Limited options

•Manual mocking

•Code generation, T4

github.com/gshackles/

Muntz

Thursday, May 9, 13

Page 45: Keeping your users happy with testable apps - Greg Shackles

01

02

03

04

05

06

07

08

09

10

11

12

13

14

Mocking

interface IService{! string Foo(string bar);}!class MockService : IService{! public Func<string> FooBody { get; set; }! !! public Foo(string bar)! {! ! return FooBody();! }}

Thursday, May 9, 13

Page 46: Keeping your users happy with testable apps - Greg Shackles

Manual Testing

Thursday, May 9, 13

Page 47: Keeping your users happy with testable apps - Greg Shackles

Manual Testing

•User feedback is

critical

Thursday, May 9, 13

Page 48: Keeping your users happy with testable apps - Greg Shackles

Manual Testing

•User feedback is

critical

•UX testing

Thursday, May 9, 13

Page 49: Keeping your users happy with testable apps - Greg Shackles

Manual Testing

•User feedback is

critical

•UX testing

•Exploratory testing

Thursday, May 9, 13

Page 50: Keeping your users happy with testable apps - Greg Shackles

MVVM

Thursday, May 9, 13

Page 51: Keeping your users happy with testable apps - Greg Shackles

MVVM

•MvvmCross

Thursday, May 9, 13

Page 52: Keeping your users happy with testable apps - Greg Shackles

MVVM

•MvvmCross

•Shared, testable view models

Thursday, May 9, 13

Page 53: Keeping your users happy with testable apps - Greg Shackles

MVVM

•MvvmCross

•Shared, testable view models

• Improved IoC support

Thursday, May 9, 13

Page 54: Keeping your users happy with testable apps - Greg Shackles

MVVM

•MvvmCross

•Shared, testable view models

• Improved IoC support

•Databinding keeps views thin

Thursday, May 9, 13

Page 55: Keeping your users happy with testable apps - Greg Shackles

DEMOThursday, May 9, 13

Page 56: Keeping your users happy with testable apps - Greg Shackles

Q&AThursday, May 9, 13