SlideShare a Scribd company logo
Automated testing
How?
Markko Paas
markko.paas@gmail.com
unit tests
component tests
integration tests
end-to-end and smoke tests
acceptance and contract tests
code review
continuous integration and deployment
Automated testing - how?
Automated testing - how?
4 clear blocks: setup, operation, validation, teardown
Single claim per test, description should not contain “and”
Independently executable
Unit tests
Test descriptions first, then code and tests in parallel
Code first, then tests
Pure TDD (single failing test – single feature – refactor – repeat)
Unit tests
https://github.com/johnpapa/angular-styleguide#write-tests-with-stories
Automated testing - how?
Automated testing - how?
Service1 Service2mock
adapter
?
?
Component tests
Cover interface
Cover possible behaviours of dependencies
Common mock for positive scenarios
Ad-hock mocks for error scenarios
Possible duplication of some unit tests
Mock databases with in-memory databases.
Component tests
Automated testing - how?
Automated testing - how?
Cover interface between units
E.g. if plugins can be plugged in
Often can be omitted because of component tests cover it
Sometimes it may be efficient to create integration tests instead of unit tests
Integration tests
Automated testing - how?
Automated testing - how?
✓ unit tests
✓ component tests
✓ integration tests
end-to-end and smoke tests
acceptance and contract tests
code review
continuous integration and deployment
Use staging environment
Stable test data set in database
(alternative would be setup and teardown as part of test)
Mock external http-based services using Robohydra
Create page models for abstracting interaction with html/css
Protractor for running tests in browser
End-to-end tests for HTTP API can be done using mocha, much faster
End-to-end tests
Automated testing - how?
Technically same as end-to-end tests
Use in production environment right after deployment
Very limited number of tests, just to validate the deployment success
Smoke tests
Link and track with business requirements
Does not have to be end-to-end test
Acceptance tests
Set of customer-specific requirements
If the customer vanishes, the tests can be removed
Coverage tools can be used to find code that no customer requires
Contract tests
✓ unit tests
✓ component tests
✓ integration tests
✓ end-to-end and smoke tests
✓ acceptance and contract tests
code review
continuous integration and deployment
No seniority – everybody can and has to review
Are the tests descriptions working as a specification?
Has the author revised the existing tests for the entire unit or just added new?
Readability of both code and tests.
Third eye-pair code review for pair programming.
Code review
Continuous integration and deployment
Development
and tests
(feature
branch)
Code
review
Tests
(feature
branch) Merge to
master
Tests
(master)
End-to-end
tests
Deploy to
production
Deploy to
stage
Smoke
tests
Development CI (docker) Stage Production
Protractor – browser end-to-end test runner
Karma – JavaScript unit test runner
Mocha + chai – JavaScript unit test framework
Istanbul – coverage
Nock – http interception for nodejs
Sinon – mocking tool for JavaScript objects and libraries
Robohydra – webserver for mocking
Phabricator + arcanist – code review
Jenkins – continuous integration
Tools

More Related Content

PPTX
Testing the untestable
PPT
Unit testing
PDF
Behavior Driven Development with SpecFlow
PPTX
Unit Tests And Automated Testing
PPTX
Behaviour Driven Development with SpecFlow
PPT
Automated Testing DITA Content and Customizations
PDF
ABAP Code Retreat Frankfurt 2016: TDD - Test Driven Development
PDF
ABAPCodeRetreat - TDD Intro by Damir Majer
Testing the untestable
Unit testing
Behavior Driven Development with SpecFlow
Unit Tests And Automated Testing
Behaviour Driven Development with SpecFlow
Automated Testing DITA Content and Customizations
ABAP Code Retreat Frankfurt 2016: TDD - Test Driven Development
ABAPCodeRetreat - TDD Intro by Damir Majer

What's hot (20)

KEY
Unit Testing Your Application
PPTX
Practical unit testing in c & c++
PPTX
Testing JavaScript Applications
PPTX
JavaScript Unit Testing
PPTX
Software testing and quality assurance
PPTX
Regression Testing with Symfony
PPTX
Tdd for php
PDF
Regression Tests with Symfony - Example
PPTX
Bye Bye Cowboy Coder Days! (Legacy Code & TDD)
PDF
Keyword Driven Testing
PDF
Code Review Tool Evaluation
PDF
Unit vs. Integration Tests
PPTX
Unit Testing in Action - C#, NUnit, and Moq
PDF
TDD in the ABAP world - sitNL 2013 edition
PPTX
Unit tests benefits
PPT
Introduction to Gauge
PPS
Unit Testing
PPTX
Development and test infrastructure
PPTX
Completed slides
PPTX
Android tdd
Unit Testing Your Application
Practical unit testing in c & c++
Testing JavaScript Applications
JavaScript Unit Testing
Software testing and quality assurance
Regression Testing with Symfony
Tdd for php
Regression Tests with Symfony - Example
Bye Bye Cowboy Coder Days! (Legacy Code & TDD)
Keyword Driven Testing
Code Review Tool Evaluation
Unit vs. Integration Tests
Unit Testing in Action - C#, NUnit, and Moq
TDD in the ABAP world - sitNL 2013 edition
Unit tests benefits
Introduction to Gauge
Unit Testing
Development and test infrastructure
Completed slides
Android tdd
Ad

Viewers also liked (6)

PPTX
Pricing Siddhant Gupta
PPTX
Water damage agent presentation
PDF
Choice of Entity for Startups by Huan Le
PPT
projektijuhtimine - teooria ja praktika
PPTX
Understanding Risk Management by Bobby Talbott
PPTX
Rockethub: The world's crowdfunding machine
Pricing Siddhant Gupta
Water damage agent presentation
Choice of Entity for Startups by Huan Le
projektijuhtimine - teooria ja praktika
Understanding Risk Management by Bobby Talbott
Rockethub: The world's crowdfunding machine
Ad

Similar to Automated testing - how? (20)

PDF
Front-End Testing: Demystified
PPTX
Automation testing
PDF
3 WAYS TO TEST YOUR COLDFUSION API
PDF
3 WAYS TO TEST YOUR COLDFUSION API -
PPTX
Full Stack Unit Testing
PPTX
Test Strategies in Microservices
PPT
Integration testing
PDF
Javascript Testing Tools - Overview
PPTX
3 Ways to test your ColdFusion API - 2017 Adobe CF Summit
PPTX
Test automation expert days
PDF
mocha sinon chai Dc jquery 4-24
PDF
Developers Testing - Girl Code at bloomon
PDF
Unit Testing - The Whys, Whens and Hows
PPTX
Testing nodejs apps
PDF
Describe's Full of It's
PDF
Automated testing-whitepaper
PDF
TDD Presentation
PDF
Unit-testing and E2E testing in JS
PPTX
Testing.pptx
PDF
Software Testing Basic Concepts
Front-End Testing: Demystified
Automation testing
3 WAYS TO TEST YOUR COLDFUSION API
3 WAYS TO TEST YOUR COLDFUSION API -
Full Stack Unit Testing
Test Strategies in Microservices
Integration testing
Javascript Testing Tools - Overview
3 Ways to test your ColdFusion API - 2017 Adobe CF Summit
Test automation expert days
mocha sinon chai Dc jquery 4-24
Developers Testing - Girl Code at bloomon
Unit Testing - The Whys, Whens and Hows
Testing nodejs apps
Describe's Full of It's
Automated testing-whitepaper
TDD Presentation
Unit-testing and E2E testing in JS
Testing.pptx
Software Testing Basic Concepts

Recently uploaded (20)

PDF
Designing Intelligence for the Shop Floor.pdf
PPTX
L1 - Introduction to python Backend.pptx
PPT
Introduction Database Management System for Course Database
PDF
System and Network Administraation Chapter 3
PDF
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
PDF
Which alternative to Crystal Reports is best for small or large businesses.pdf
PPTX
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
PPTX
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
PDF
medical staffing services at VALiNTRY
PDF
PTS Company Brochure 2025 (1).pdf.......
PDF
Softaken Excel to vCard Converter Software.pdf
PDF
Nekopoi APK 2025 free lastest update
PPTX
ai tools demonstartion for schools and inter college
PPTX
Operating system designcfffgfgggggggvggggggggg
PDF
top salesforce developer skills in 2025.pdf
PDF
Design an Analysis of Algorithms I-SECS-1021-03
PDF
Navsoft: AI-Powered Business Solutions & Custom Software Development
PDF
Wondershare Filmora 15 Crack With Activation Key [2025
PDF
Design an Analysis of Algorithms II-SECS-1021-03
PDF
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
Designing Intelligence for the Shop Floor.pdf
L1 - Introduction to python Backend.pptx
Introduction Database Management System for Course Database
System and Network Administraation Chapter 3
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
Which alternative to Crystal Reports is best for small or large businesses.pdf
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
medical staffing services at VALiNTRY
PTS Company Brochure 2025 (1).pdf.......
Softaken Excel to vCard Converter Software.pdf
Nekopoi APK 2025 free lastest update
ai tools demonstartion for schools and inter college
Operating system designcfffgfgggggggvggggggggg
top salesforce developer skills in 2025.pdf
Design an Analysis of Algorithms I-SECS-1021-03
Navsoft: AI-Powered Business Solutions & Custom Software Development
Wondershare Filmora 15 Crack With Activation Key [2025
Design an Analysis of Algorithms II-SECS-1021-03
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf

Automated testing - how?

  • 2. unit tests component tests integration tests end-to-end and smoke tests acceptance and contract tests code review continuous integration and deployment
  • 5. 4 clear blocks: setup, operation, validation, teardown Single claim per test, description should not contain “and” Independently executable Unit tests
  • 6. Test descriptions first, then code and tests in parallel Code first, then tests Pure TDD (single failing test – single feature – refactor – repeat) Unit tests
  • 11. Cover interface Cover possible behaviours of dependencies Common mock for positive scenarios Ad-hock mocks for error scenarios Possible duplication of some unit tests Mock databases with in-memory databases. Component tests
  • 14. Cover interface between units E.g. if plugins can be plugged in Often can be omitted because of component tests cover it Sometimes it may be efficient to create integration tests instead of unit tests Integration tests
  • 17. ✓ unit tests ✓ component tests ✓ integration tests end-to-end and smoke tests acceptance and contract tests code review continuous integration and deployment
  • 18. Use staging environment Stable test data set in database (alternative would be setup and teardown as part of test) Mock external http-based services using Robohydra Create page models for abstracting interaction with html/css Protractor for running tests in browser End-to-end tests for HTTP API can be done using mocha, much faster End-to-end tests
  • 20. Technically same as end-to-end tests Use in production environment right after deployment Very limited number of tests, just to validate the deployment success Smoke tests
  • 21. Link and track with business requirements Does not have to be end-to-end test Acceptance tests
  • 22. Set of customer-specific requirements If the customer vanishes, the tests can be removed Coverage tools can be used to find code that no customer requires Contract tests
  • 23. ✓ unit tests ✓ component tests ✓ integration tests ✓ end-to-end and smoke tests ✓ acceptance and contract tests code review continuous integration and deployment
  • 24. No seniority – everybody can and has to review Are the tests descriptions working as a specification? Has the author revised the existing tests for the entire unit or just added new? Readability of both code and tests. Third eye-pair code review for pair programming. Code review
  • 25. Continuous integration and deployment Development and tests (feature branch) Code review Tests (feature branch) Merge to master Tests (master) End-to-end tests Deploy to production Deploy to stage Smoke tests Development CI (docker) Stage Production
  • 26. Protractor – browser end-to-end test runner Karma – JavaScript unit test runner Mocha + chai – JavaScript unit test framework Istanbul – coverage Nock – http interception for nodejs Sinon – mocking tool for JavaScript objects and libraries Robohydra – webserver for mocking Phabricator + arcanist – code review Jenkins – continuous integration Tools