SlideShare a Scribd company logo
Test Automation 
Oren Rubin - Testim.io
Who am I?
Who are you? 
● Company specialty? 
o Backend? Frontend? Mobile? 
● Current development? 
o how frequent are the releases? 
● QA or dev team? 
o Write code or manage?
Software Architecture Class 
Q: How to write large scale applications? 
A: You don't, you aim for small reusable 
components
Systems are composed of Units 
Unit A Unit B Unit C
Units have interfaces 
Click HTTP 
Browser Web Server DB
Units are composed of smaller units 
Web 
Server 
DB 
Click 
Browser 
HTML 
JS 
CSS 
a.js b.js
Test each unit separately? 
Browser Web Server DB 
Test A Test B Test C
Test how the units interact? 
Browser Web Server 
Test A 
DB
Test how the units interact? 
Web Server DB 
Test C 
Browser
Test the entire flow? 
Click HTTP 
Browser Web Server DB
Testing Theory - La järɡən 
● Unit Tests 
● Integration Tests 
● End to End Tests 
● Functional Tests 
● Smoke Tests 
● Load Tests 
● Acceptance Test
Testing Theory - La järɡən
Unit vs. Integration vs. E2E
Testing Theory 
Setup Stimuli Assertions Tear down 
Test starts Initial State Some State 
The Assertions can differ: 
Functional, UI, Timing, Memory consumption
Testing Theory 
Black Box 
● Check against the API 
● Can be done by others 
White Box 
● Look inside (gory details) 
● Usually same person
Testing Metrics 
Black Box 
● Users stories 
● Response time 
● Memory consumption 
(memory leaks) 
White Box 
● Code coverage 
● Loop edge cases: 
o Never go in 
o Go in once 
o More than once
Test automation 
Unit Tests
Unit Tests.. find the diffs 
Bad Code 
● Long methods 
● Tightly Coupled 
● Unreadable 
● Hard root cause 
● Use Global 
Good Code 
● Short methods 
● Loose Coupling 
● Readable 
● Easy bug detection 
● Separation of 
Concerns 
Unit Tested Code 
● Short methods 
● Loose Coupling 
● Readable 
● Easy bug detection 
● Separation of 
Concerns
Unit Tests 
Remember: 
Units tests helps you write better code 
Regression tests are a bonus!
Testing Theory - Unit Tests 
Setup Stimuli Assertions Tear down 
Test starts Initial State Some State 
Assertions 
● State changed 
● callbacks (methods) were called
Testing Theory - Unit Tests 
a =new A() a.f() assert(a.x = 5) 
Test starts Initial State Some State 
Assertions 
● State changed 
● callbacks (methods) were called
Test each unit separately? 
mock http 
Browser Web Server DB 
mock timers 
Test A Test B Test C
Unit Isolation 
Spies 
Stubs 
Mocks
Unit Isolation - if needed 
Fake ajax 
Fake timers 
Work asynchronously
Assertion Library
Spies
Spy on functions
Spy on functions
Spy on functions
Spy filters
Spy Assertions
Spy Assertions
Stubs
Stubs
Stubs
Mocks
Jasmine 
● Very simple 
● Great docs: http://pivotal.github.com/jasmine/ 
● Load is by an HTML scaffold 
● Completely standalone 
● Custom Matchers: expect('moshe').toBeMoshe(); 
● Easy to filter tests 
● Nested describe blocks (each has beforeEach)
Jasmine
Jasmine
Jasmine
Sinon
Asynchronous - Jasmine
Jasmine async riddle
TDD 
1. Write test 
2. Test fails 
3. Write code 
4. Test passes 
5. Refactor 
6. Go to 2
Keyword driven tests e.g. cucumber
TDD can apply to Integration and E2E

More Related Content

PDF
Statistical Element Locator by Oren Rubin - SeleniumConf UK 2016
PDF
Test automation & Seleniun by oren rubin
PDF
UI Testing Best Practices - An Expected Journey
PDF
Making cross browser tests beautiful
PDF
Introduction To Web Application Testing
PPTX
Angular UI Testing with Protractor
PPTX
DSL, Page Object and Selenium – a way to reliable functional tests
PDF
Selenium - The page object pattern
Statistical Element Locator by Oren Rubin - SeleniumConf UK 2016
Test automation & Seleniun by oren rubin
UI Testing Best Practices - An Expected Journey
Making cross browser tests beautiful
Introduction To Web Application Testing
Angular UI Testing with Protractor
DSL, Page Object and Selenium – a way to reliable functional tests
Selenium - The page object pattern

What's hot (20)

PPTX
Marcin Wasilczyk - Page objects with selenium
PPTX
Automated UI Testing Done Right (QMSDNUG)
PDF
AngularJS and Protractor
PDF
APIs: A Better Alternative to Page Objects
PPTX
Protractor training
PDF
Easy automation.py
PDF
Automation Abstraction Layers: Page Objects and Beyond
PDF
Selenide Alternative in Practice - Implementation & Lessons learned [Selenium...
PDF
Introduction to Selenium and Test Automation
PDF
Unit-testing and E2E testing in JS
PPTX
Protractor survival guide
PPTX
Protractor Tutorial Quality in Agile 2015
PDF
Real World Selenium Testing
PDF
Hands on Exploration of Page Objects and Abstraction Layers with Selenium Web...
PPTX
DSL, Page Object and WebDriver – the path to reliable functional tests.pptx
PPTX
Better End-to-End Testing with Page Objects Model using Protractor
PDF
Join the darkside: Selenium testing with Nightwatch.js
PPTX
Better Page Object Handling with Loadable Component Pattern
PDF
Mastering UI automation at Scale: Key Lessons and Best Practices (By Fernando...
ZIP
Automated Frontend Testing
Marcin Wasilczyk - Page objects with selenium
Automated UI Testing Done Right (QMSDNUG)
AngularJS and Protractor
APIs: A Better Alternative to Page Objects
Protractor training
Easy automation.py
Automation Abstraction Layers: Page Objects and Beyond
Selenide Alternative in Practice - Implementation & Lessons learned [Selenium...
Introduction to Selenium and Test Automation
Unit-testing and E2E testing in JS
Protractor survival guide
Protractor Tutorial Quality in Agile 2015
Real World Selenium Testing
Hands on Exploration of Page Objects and Abstraction Layers with Selenium Web...
DSL, Page Object and WebDriver – the path to reliable functional tests.pptx
Better End-to-End Testing with Page Objects Model using Protractor
Join the darkside: Selenium testing with Nightwatch.js
Better Page Object Handling with Loadable Component Pattern
Mastering UI automation at Scale: Key Lessons and Best Practices (By Fernando...
Automated Frontend Testing
Ad

Similar to Test automation expert days (20)

PPT
Test Automation Framework Designs
PPTX
An Introduction to Unit Testing
PDF
JAVASCRIPT TDD(Test driven Development) & Qunit Tutorial
PDF
Testing in FrontEnd World by Nikita Galkin
PPTX
Skillwise Unit Testing
PDF
3 WAYS TO TEST YOUR COLDFUSION API
PDF
3 WAYS TO TEST YOUR COLDFUSION API -
PPTX
3 Ways to test your ColdFusion API - 2017 Adobe CF Summit
PDF
Unit Testing JavaScript Applications
PDF
Front-End Testing: Demystified
PDF
Test driven development
PDF
Unit Testing - The Whys, Whens and Hows
PPTX
Automation testing
PPT
Test Automation Framework Designs
PPTX
Coding Naked
PDF
JAVASCRIPT Test Driven Development & Jasmine
PPTX
Benefits from AATs
PPTX
Testing 101
PDF
mocha sinon chai Dc jquery 4-24
PPTX
Java script unit testing
Test Automation Framework Designs
An Introduction to Unit Testing
JAVASCRIPT TDD(Test driven Development) & Qunit Tutorial
Testing in FrontEnd World by Nikita Galkin
Skillwise Unit Testing
3 WAYS TO TEST YOUR COLDFUSION API
3 WAYS TO TEST YOUR COLDFUSION API -
3 Ways to test your ColdFusion API - 2017 Adobe CF Summit
Unit Testing JavaScript Applications
Front-End Testing: Demystified
Test driven development
Unit Testing - The Whys, Whens and Hows
Automation testing
Test Automation Framework Designs
Coding Naked
JAVASCRIPT Test Driven Development & Jasmine
Benefits from AATs
Testing 101
mocha sinon chai Dc jquery 4-24
Java script unit testing
Ad

Test automation expert days

Editor's Notes

  • #4: One important goal is to get to know fellow friends in the industry.. and share knowledge