102
C# Cookware Manuel Pais CukeUp! London 3 rd Apr 2014

C# Cookware - presented at CukeUp! 2014

Embed Size (px)

Citation preview

Page 1: C# Cookware - presented at CukeUp! 2014

C# Cookware

Manuel Pais

CukeUp! London

3rd Apr 2014

Page 2: C# Cookware - presented at CukeUp! 2014

Agenda

Prelude

An Ancient World

Forget Physical Laws

Layered World

Parallel Worlds

Page 3: C# Cookware - presented at CukeUp! 2014

Prelude

Page 4: C# Cookware - presented at CukeUp! 2014
Page 5: C# Cookware - presented at CukeUp! 2014
Page 6: C# Cookware - presented at CukeUp! 2014

Test .NET Code with Specflow

Page 7: C# Cookware - presented at CukeUp! 2014

Test .NET Code with Specflow

Drive a Windows App Using White

Page 8: C# Cookware - presented at CukeUp! 2014

Test .NET Code with Specflow

Drive a Windows App Using White

Test Windows GUIs with AutoIt

Page 9: C# Cookware - presented at CukeUp! 2014
Page 10: C# Cookware - presented at CukeUp! 2014
Page 11: C# Cookware - presented at CukeUp! 2014

An Ancient World

Page 12: C# Cookware - presented at CukeUp! 2014
Page 13: C# Cookware - presented at CukeUp! 2014

Not for everyone

Page 14: C# Cookware - presented at CukeUp! 2014

For some many of us

this is more accurate…

Page 15: C# Cookware - presented at CukeUp! 2014
Page 16: C# Cookware - presented at CukeUp! 2014

Our context

Page 17: C# Cookware - presented at CukeUp! 2014
Page 18: C# Cookware - presented at CukeUp! 2014
Page 19: C# Cookware - presented at CukeUp! 2014
Page 20: C# Cookware - presented at CukeUp! 2014

Do desktop applications still make sense?

Page 21: C# Cookware - presented at CukeUp! 2014

IF you have to integrate with low-level SDKs

And…

Page 22: C# Cookware - presented at CukeUp! 2014

IF client app requires low latency IF you have to integrate with low-level SDKs

And…

Page 23: C# Cookware - presented at CukeUp! 2014

AND your stress tests look like this…

Page 24: C# Cookware - presented at CukeUp! 2014
Page 25: C# Cookware - presented at CukeUp! 2014
Page 26: C# Cookware - presented at CukeUp! 2014
Page 27: C# Cookware - presented at CukeUp! 2014
Page 28: C# Cookware - presented at CukeUp! 2014
Page 29: C# Cookware - presented at CukeUp! 2014
Page 30: C# Cookware - presented at CukeUp! 2014
Page 31: C# Cookware - presented at CukeUp! 2014
Page 32: C# Cookware - presented at CukeUp! 2014
Page 33: C# Cookware - presented at CukeUp! 2014
Page 34: C# Cookware - presented at CukeUp! 2014

Forget Physical Laws

Page 35: C# Cookware - presented at CukeUp! 2014

Test automation

with

physical devices ?!

Page 36: C# Cookware - presented at CukeUp! 2014
Page 37: C# Cookware - presented at CukeUp! 2014

Not great to maintain…

Page 38: C# Cookware - presented at CukeUp! 2014

char[] start_scan()

char[] capture()

char[] scan_finger()

Page 39: C# Cookware - presented at CukeUp! 2014

Plain Old Interfaces

Page 40: C# Cookware - presented at CukeUp! 2014

byte[] start_scan();

Page 41: C# Cookware - presented at CukeUp! 2014

byte[] start_scan();

Page 42: C# Cookware - presented at CukeUp! 2014

Decoupled Development

x. Device Integration

y. Application Biometric Logic

Page 43: C# Cookware - presented at CukeUp! 2014

Decoupled Development

x. Device Integration

y. Application Biometric Logic

Page 44: C# Cookware - presented at CukeUp! 2014

Decoupled Development

x. Device Integration

y. Application Biometric Logic

Page 45: C# Cookware - presented at CukeUp! 2014

byte[] start_scan();

Page 46: C# Cookware - presented at CukeUp! 2014

byte[] start_scan();

Page 47: C# Cookware - presented at CukeUp! 2014

byte[] start_scan();

Page 48: C# Cookware - presented at CukeUp! 2014

byte[] start_scan();

Page 49: C# Cookware - presented at CukeUp! 2014

Requires: Categorized Test Data

Supports: Randomization

Page 50: C# Cookware - presented at CukeUp! 2014

Requires: Categorized Test Data

Supports: Randomization

Page 51: C# Cookware - presented at CukeUp! 2014

byte[] start_scan();

Page 52: C# Cookware - presented at CukeUp! 2014
Page 53: C# Cookware - presented at CukeUp! 2014
Page 54: C# Cookware - presented at CukeUp! 2014

Virtual Fingerprint Scanner

Page 55: C# Cookware - presented at CukeUp! 2014

Given a complete Visa application

When I capture 4 valid fingerprints

Then application is sent for approval

Virtual Fingerprint Scanner

Page 56: C# Cookware - presented at CukeUp! 2014

Given a complete Visa application

When I capture 4 valid fingerprints

Then application is sent for approval

Virtual Fingerprint Scanner

Page 57: C# Cookware - presented at CukeUp! 2014

Given a complete Visa application

When I capture 4 valid fingerprints

Then application is sent for approval

Virtual Fingerprint Scanner

Page 58: C# Cookware - presented at CukeUp! 2014

Given a complete Visa application

When I capture 4 valid fingerprints

Then application is sent for approval

Virtual Fingerprint Scanner

Page 59: C# Cookware - presented at CukeUp! 2014

Given a complete Visa application

When I capture 4 valid fingerprints

Then application is sent for approval

Virtual Fingerprint Scanner

Page 60: C# Cookware - presented at CukeUp! 2014

Given a traveler leaving the country

When 1 finger is missing

Then emigration supervisor is called

Virtual Fingerprint Scanner

Page 61: C# Cookware - presented at CukeUp! 2014

Forget Physical Laws Problem Automate testing of applications using physical devices

Ingredients • Common interface for similar devices

• Virtual device implementation for that interface

• Categorized test data repository

• Test data sampler

Page 62: C# Cookware - presented at CukeUp! 2014

Layered World

Page 63: C# Cookware - presented at CukeUp! 2014

Reusable core modules

but

Many customizations

and

Specific client requirements ?

Page 64: C# Cookware - presented at CukeUp! 2014

Reusable core modules

but

Many customizations

and

Specific client requirements ?

Page 65: C# Cookware - presented at CukeUp! 2014

Reusable core modules

but

Many customizations

and

Specific customer requirements ?

Page 66: C# Cookware - presented at CukeUp! 2014
Page 67: C# Cookware - presented at CukeUp! 2014

Plain Old Layers

Page 68: C# Cookware - presented at CukeUp! 2014
Page 69: C# Cookware - presented at CukeUp! 2014

Low level UI

automation

across all apps

Page 70: C# Cookware - presented at CukeUp! 2014

Low level UI

automation

across all apps

Page 71: C# Cookware - presented at CukeUp! 2014

Low level UI

automation

across all apps

Module

“object”

automation

Page 72: C# Cookware - presented at CukeUp! 2014

Low level UI

automation

across all apps

Module

“object”

automation

Page 73: C# Cookware - presented at CukeUp! 2014

Low level UI

automation

across all apps

Module

“object”

automation

Application

logic

automation

Page 74: C# Cookware - presented at CukeUp! 2014

Low level UI

automation

across all apps

Module

“object”

automation

Application

logic

automation

Page 75: C# Cookware - presented at CukeUp! 2014

Low level UI

automation

across all apps

Module

“object”

automation

Application

logic

automation

Page 76: C# Cookware - presented at CukeUp! 2014

Application Driver DSL

Page 77: C# Cookware - presented at CukeUp! 2014

Given a traveler entering the country

When I capture all biometric data

And no alarms are raised

Then travel is allowed

Application Driver DSL

Page 78: C# Cookware - presented at CukeUp! 2014

Given a traveler entering the country

When I capture all biometric data

And no alarms are raised

Then travel is allowed

Application Driver DSL

Page 79: C# Cookware - presented at CukeUp! 2014

Given a traveler entering the country

When I capture all biometric data

And no alarms are raised

Then travel is allowed

Application Driver DSL

Page 80: C# Cookware - presented at CukeUp! 2014

Layered World Problem Automate testing of reusable client modules with project

customizations and specific requirements

Ingredients • Specflow (Cucumber family)

• White (GUI automation)

• Layered test code: pure UI + module + application DSL

Page 81: C# Cookware - presented at CukeUp! 2014

Parallel Worlds

Page 82: C# Cookware - presented at CukeUp! 2014

Multiple

public-facing interfaces

GUI vs API

Page 83: C# Cookware - presented at CukeUp! 2014

Multiple

public-facing interfaces

GUI vs API

Page 84: C# Cookware - presented at CukeUp! 2014

OR

Page 85: C# Cookware - presented at CukeUp! 2014

Multiple

execution alternatives

GUI objects vs Keyboard shortcuts

Page 86: C# Cookware - presented at CukeUp! 2014

Multiple

execution alternatives

GUI objects vs Keyboard shortcuts

Page 87: C# Cookware - presented at CukeUp! 2014

Plain old

Dependency Injection

Page 88: C# Cookware - presented at CukeUp! 2014
Page 89: C# Cookware - presented at CukeUp! 2014
Page 90: C# Cookware - presented at CukeUp! 2014

FingerprintsUI

Page 91: C# Cookware - presented at CukeUp! 2014

FingerprintsUI

Page 92: C# Cookware - presented at CukeUp! 2014

FingerprintsUI FingerprintsShortcuts …

IFingerprints

Page 93: C# Cookware - presented at CukeUp! 2014

FingerprintsShortcuts

IFingerprints

Given a complete Visa application

When I capture 4 valid fingerprints

Then application is sent for approval

FingerprintsUI

Page 94: C# Cookware - presented at CukeUp! 2014

FingerprintsShortcuts

IFingerprints

Given a complete Visa application

When I capture 4 valid fingerprints

Then application is sent for approval

FingerprintsUI

Fingerprint.IFingerprints

=

Fingerprint.FingerprintsUI

Page 95: C# Cookware - presented at CukeUp! 2014

FingerprintsShortcuts

IFingerprints

Given a complete Visa application

When I capture 4 valid fingerprints

Then application is sent for approval

FingerprintsUI

Fingerprint.IFingerprints

=

Fingerprint.FingerprintsUI

Page 96: C# Cookware - presented at CukeUp! 2014

FingerprintsShortcuts

IFingerprints

Given a complete Visa application

When I capture 4 valid fingerprints

Then application is sent for approval

FingerprintsUI

Fingerprint.IFingerprints

=

Fingerprint.FingerprintsShortcuts

Page 97: C# Cookware - presented at CukeUp! 2014

FingerprintsShortcuts

IFingerprints

Given a complete Visa application

When I capture 4 valid fingerprints

Then application is sent for approval

FingerprintsUI

Fingerprint.IFingerprints

=

Fingerprint.FingerprintsShortcuts

Page 98: C# Cookware - presented at CukeUp! 2014

Parallel Worlds Problem Automate testing of multiple interfaces/executions for same

scenario

Ingredients • A single test interface for the exposed functionality

• Two or more implementations of that interface

• (Basic) dependency injection mechanism

Page 99: C# Cookware - presented at CukeUp! 2014

Image credits

Ancient world map: http://ancientworldmaps.blogspot.com.es/2010/06/world-map-17th-century_12.html Fingerprint scanners: http://www.bayometric.com/lumidigm-venus-v302.html

http://www.biometricsintegrated.com/passport-seva.html http://www.indiamart.com/bayometric-mumbai/fingerprint-scanners.html

Signature pads: http://www.ez-tech.com.mx/store/STU-500-LCD-Signature-Tablet-Large-STU-500.html http://www.reusetek.com/topaz-t-lbk766se-bhsb-r-4x5-lcd-usb-signature-pad/

http://www.alphacard.com/siglite-signature-capture-terminal Document readers: http://www.access-is.com/ocr640-desktop-full-page-passport-id-reader.php

http://www.access-is.com/ocr601_kiosk_desktop_airport_mrz_passport_reader.php http://www.assuretec.com/product/passport-readers

Cameras: http://www.ephotozine.com/article/canon-eos-1100d-digital-slr-review-16085 http://www.lawyersandsettlements.com/blog/tag/webcam

http://www.hdrphotographypro.org/best-tools/ A4 scanner: http://www.printerland.co.uk/Xerox-7600i-P13571.aspx

Workstation: http://www.channelregister.co.uk/2011/04/12/hp_workstations/ Web technologies: http://www.smartechworldweb.com/smartech_web_technology.html

Building blocks: http://www.getfilecloud.com/blog/2014/01/the-fundamental-building-blocks-of-cloud-computing/#.Uzf2RfmSySo

Unfinished building: http://www.panoramio.com/photo/26507136 UK border control: http://www.theguardian.com/uk/2011/nov/08/border-control-row-targeted-checks

Veridoc: http://www.marpless.co.za/Secure-Document.html Biometric enrolment:

http://www.zimbio.com/pictures/JV59KukDbmF/Home+Office+Minister+Demonstrates+New+Biometric/tA8g2BhKmD9/Phil+Woolas

Border control queue: http://www.dailymail.co.uk/travel/article-2133883/Passport-checks-cut-Olympic-official-complains-hour-delay-Heathrow.html

Recipe template: http://www.vertex42.com/WordTemplates/recipe-card-template.html

Page 100: C# Cookware - presented at CukeUp! 2014

Thanks!

Francisco Cerrudo

Francisco Garcia

Javier Perez

José Cruz

Page 101: C# Cookware - presented at CukeUp! 2014

Thank you!

Page 102: C# Cookware - presented at CukeUp! 2014

Q & A