SlideShare a Scribd company logo
1 of 41
© Copyright SELA Software & Education Labs Ltd. | 14-18 Baruch Hirsch St Bnei Brak, 51202 Israel | www.selagroup.com
Arnon Axelrod
Test Automation for Developers
Arnon Axelrod
Expert for:
Test Automation
eXtreme Programming
Practices
Defect-free software
development
ArnonAxelrod
@ArnonAxelrod
@ArnonAxelrod
Test
Automation
Architecture
Working
practices
Quality &
Productivity
Business
Structure
Business
Culture
Documen-
tation
Testing vs. Quality
Developers vs. Testers
Unit Tests System Tests
Some common (mis?)conceptions
Unit System
Purpose Verify implementation Find bugs
Planned, written and used by Developers Testers / Automation Developers
Runs After Check-in Nightly / Before release
Scope Single function or class Entire System (Like a real user)
Isolation Mock all I/O (DB, Network, etc.) Full environment
Data Fake Real
Stability High Low
Speed Very fast Very slow
Failure investigation Easy Hard
When written Before (TDD?) Only when dev is done
Another (mis?)conception…
E2E
Integration
Unit
Test Scope (AKA Testbed)
Simplistic view on a computer system
Processing
InputsOutputs
Simplistic view on Test Automation
Processing
(SUT)
InputsOutputs
TestExpected?
Pass/Fail
A more realistic view on computer systems…
End to End (System) Scope
UI
View Model
Client Logic
Server Proxy
Service Layer
Business Logic
DAL
ORM
DB
Unit Tests scope
UI
View Model
Client Logic
Server Proxy
Service Layer
DAL
ORM
DB
Business Logic
Client-only Test Scope
UI
View Model
Client Logic
Server Proxy
Service Layer
Business Logic
DAL
ORM
DB
Simulator
Backend-only Test Scope
UI
View Model
Client Logic
Server Proxy
Service Layer
Business Logic
DAL
ORM
DB
Server / Service Test Scope
UI
View Model
Client Logic
Server Proxy
Service Layer
Business Logic
DAL
ORM
DBFake DB
Under the Skin Test Scope
UI
View Model
Client Logic
Server Proxy
Service Layer
Business Logic
DAL
ORM
DB
Functionality Test Scope
UI
View Model
Client Logic
Server Proxy
Service Layer
Business Logic
DAL
ORM
DB
Mock
Mock
Mock
Open Your Mind…
The Purpose of
Test Automation
Find Bugs?
Prevent Bugs!
Code Structure
“Refactoring is all about applying small
behavior-preserving steps and making a big
change by stringing together a sequence of
these behavior-preserving steps … As a
result, when I’m refactoring, my code doesn’t
spend much time in a broken state, allowing
me to stop at any moment even if I haven’t
finished.”
Simple Design
4 Rules of Simple Design / Kent Beck
Passes all the Tests
Reveals the intention
No duplication
Fewest elements (functions and
methods)
The rules are in priority order
Tests should describe Observable Behavior
When the design is too complex...
Test Structure
Arrange Act Assert
Given When Then
Test Structure
Experiment
Steps Expected Result
Claim
Test name
Test Method Example
[TestMethod]
public void AddingProductWithPromotionGivesDiscount()
{
const decimal price = 1200;
const decimal discount = 150;
var iPhone = CreateProduct("iPhone", price);
CreatePromotionOnProduct(iPhone, discount);
var shoppingCart = CreateShoppingCart();
shoppingCart.Add(iPhone);
Assert.AreEqual(price - discount, shoppingCart.Total);
}
Best Practices for Writing Tests
Keep it simple
Reliability
Isolate tests from one another
Deterministic and Specific Expected Result
Don’t assume anything about existing data
Mock anything you can’t control
Maintainability
Readable
No duplication
Refactor continuously!
ATDD - Acceptance Test Driven Development
PO defines the problem (User Story)
PO & team collaborate on simplest solution
Define Acceptance Criteria
Implement automated test
Implement Code & Refactor
Exploratory testing
Get customer feedback
Back to our (mis)conceptions…
Unit System
Purpose Verify implementation Find bugs
Planned, written and used by Developers Testers / Automation Deelopers
Runs After Check-in Nightly / Before release
Scope Single function or class Entire System (Like a real user)
Isolation Mock all I/O (DB, Network, etc.) Full environment
Data Fake Real
Stability High Low
Speed Very fast Very slow
Failure investigation Easy Hard
When written Before (TDD?) Only when dev is done
Verify Behavior  Refactoring  Clean code  Better Quality
The entire team
As soon and often as possible
Smaller… As needed …Larger
Mock anything as needed
Mostly Fake data
High
Slower
Should be made easy
Preferably before (ATDD)
Back to the Pyramids…
Back to the Testing Pyramid
E2E
Integration
Unit
Back to the Testing Pyramid
E2E
…
Unit
Test automation is your concern!
Quality comes from the code and the design
Design should evolve over time. Test automation enable that
Collaborate with the testers and test automation developers
Most principles apply to all test scopes
Questions

More Related Content

What's hot

An Introduction to Unit Testing
An Introduction to Unit TestingAn Introduction to Unit Testing
An Introduction to Unit TestingSahar Nofal
 
Writing Test Cases 20110808
Writing Test Cases 20110808Writing Test Cases 20110808
Writing Test Cases 20110808slovejoy
 
Agile Testing Dilemmas
Agile Testing DilemmasAgile Testing Dilemmas
Agile Testing DilemmasAman King
 
Real Life Unit Testing
Real Life Unit TestingReal Life Unit Testing
Real Life Unit TestingDror Helper
 
Mixing testing types to improve your testing results
Mixing testing types to improve your testing resultsMixing testing types to improve your testing results
Mixing testing types to improve your testing resultsPractiTest
 
Advanced unit testing – real life examples and mistakes
Advanced unit testing – real life examples and mistakesAdvanced unit testing – real life examples and mistakes
Advanced unit testing – real life examples and mistakesMilan Vukoje
 
How accurate are the Wearable fitness tracker showing 10000 steps in a day: A...
How accurate are the Wearable fitness tracker showing 10000 steps in a day: A...How accurate are the Wearable fitness tracker showing 10000 steps in a day: A...
How accurate are the Wearable fitness tracker showing 10000 steps in a day: A...STePINForum
 
Justin Presentation PPT Upload
Justin Presentation PPT UploadJustin Presentation PPT Upload
Justin Presentation PPT Uploadtechweb08
 
Black box testing lecture 11
Black box testing lecture 11Black box testing lecture 11
Black box testing lecture 11Abdul Basit
 
Sqa, test scenarios and test cases
Sqa, test scenarios and test casesSqa, test scenarios and test cases
Sqa, test scenarios and test casesConfiz
 
Test Automation Patterns: Issues and Solutions
Test Automation Patterns: Issues and SolutionsTest Automation Patterns: Issues and Solutions
Test Automation Patterns: Issues and SolutionsTechWell
 
Software Testing As a Career Path
Software Testing As a Career PathSoftware Testing As a Career Path
Software Testing As a Career PathRock Interview
 
Unit testing
Unit testingUnit testing
Unit testingAdam Birr
 
Producing Testable Requirements
Producing Testable RequirementsProducing Testable Requirements
Producing Testable RequirementsIntergen
 
UI Automation Quirks
UI Automation QuirksUI Automation Quirks
UI Automation QuirksLucas Pang
 

What's hot (20)

Test case development
Test case developmentTest case development
Test case development
 
An Introduction to Unit Testing
An Introduction to Unit TestingAn Introduction to Unit Testing
An Introduction to Unit Testing
 
Writing Test Cases 20110808
Writing Test Cases 20110808Writing Test Cases 20110808
Writing Test Cases 20110808
 
Agile Testing Dilemmas
Agile Testing DilemmasAgile Testing Dilemmas
Agile Testing Dilemmas
 
Real Life Unit Testing
Real Life Unit TestingReal Life Unit Testing
Real Life Unit Testing
 
Mixing testing types to improve your testing results
Mixing testing types to improve your testing resultsMixing testing types to improve your testing results
Mixing testing types to improve your testing results
 
Advanced unit testing – real life examples and mistakes
Advanced unit testing – real life examples and mistakesAdvanced unit testing – real life examples and mistakes
Advanced unit testing – real life examples and mistakes
 
Unit Testing
Unit TestingUnit Testing
Unit Testing
 
How accurate are the Wearable fitness tracker showing 10000 steps in a day: A...
How accurate are the Wearable fitness tracker showing 10000 steps in a day: A...How accurate are the Wearable fitness tracker showing 10000 steps in a day: A...
How accurate are the Wearable fitness tracker showing 10000 steps in a day: A...
 
Test case writing
Test case writingTest case writing
Test case writing
 
Justin Presentation PPT Upload
Justin Presentation PPT UploadJustin Presentation PPT Upload
Justin Presentation PPT Upload
 
Black box testing lecture 11
Black box testing lecture 11Black box testing lecture 11
Black box testing lecture 11
 
Sqa, test scenarios and test cases
Sqa, test scenarios and test casesSqa, test scenarios and test cases
Sqa, test scenarios and test cases
 
Black box testing
Black box testingBlack box testing
Black box testing
 
Unit tests benefits
Unit tests benefitsUnit tests benefits
Unit tests benefits
 
Test Automation Patterns: Issues and Solutions
Test Automation Patterns: Issues and SolutionsTest Automation Patterns: Issues and Solutions
Test Automation Patterns: Issues and Solutions
 
Software Testing As a Career Path
Software Testing As a Career PathSoftware Testing As a Career Path
Software Testing As a Career Path
 
Unit testing
Unit testingUnit testing
Unit testing
 
Producing Testable Requirements
Producing Testable RequirementsProducing Testable Requirements
Producing Testable Requirements
 
UI Automation Quirks
UI Automation QuirksUI Automation Quirks
UI Automation Quirks
 

Similar to .NET Fest 2019. Arnon Axelrod. Test automation for developers

Software Quality and Test Strategies for Ruby and Rails Applications
Software Quality and Test Strategies for Ruby and Rails ApplicationsSoftware Quality and Test Strategies for Ruby and Rails Applications
Software Quality and Test Strategies for Ruby and Rails ApplicationsBhavin Javia
 
An introduction to unit testing
An introduction to unit testingAn introduction to unit testing
An introduction to unit testingAdam Stephensen
 
6 Traits of a Successful Test Automation Architecture
6 Traits of a Successful Test Automation Architecture6 Traits of a Successful Test Automation Architecture
6 Traits of a Successful Test Automation ArchitectureErdem YILDIRIM
 
Unit tests & TDD
Unit tests & TDDUnit tests & TDD
Unit tests & TDDDror Helper
 
Lightning Talks by Globant - Automation (This app runs by itself )
Lightning Talks by Globant -  Automation (This app runs by itself ) Lightning Talks by Globant -  Automation (This app runs by itself )
Lightning Talks by Globant - Automation (This app runs by itself ) Globant
 
Test driven development in .Net - 2010 + Eclipse
Test driven development in .Net - 2010 + EclipseTest driven development in .Net - 2010 + Eclipse
Test driven development in .Net - 2010 + EclipseUTC Fire & Security
 
#DOAW16 - DevOps@work Roma 2016 - Testing your databases
#DOAW16 - DevOps@work Roma 2016 - Testing your databases#DOAW16 - DevOps@work Roma 2016 - Testing your databases
#DOAW16 - DevOps@work Roma 2016 - Testing your databasesAlessandro Alpi
 
Unit Testing and TDD 2017
Unit Testing and TDD 2017Unit Testing and TDD 2017
Unit Testing and TDD 2017Xavi Hidalgo
 
May: Automated Developer Testing: Achievements and Challenges
May: Automated Developer Testing: Achievements and ChallengesMay: Automated Developer Testing: Achievements and Challenges
May: Automated Developer Testing: Achievements and ChallengesTriTAUG
 
Agile Testing, Uncertainty, Risk, and Why It All Works
Agile Testing, Uncertainty, Risk, and Why It All WorksAgile Testing, Uncertainty, Risk, and Why It All Works
Agile Testing, Uncertainty, Risk, and Why It All WorksElisabeth Hendrickson
 
Unit Testing, TDD and the Walking Skeleton
Unit Testing, TDD and the Walking SkeletonUnit Testing, TDD and the Walking Skeleton
Unit Testing, TDD and the Walking SkeletonSeb Rose
 
Test Driven Development Introduction
Test Driven Development IntroductionTest Driven Development Introduction
Test Driven Development IntroductionNguyen Hai
 

Similar to .NET Fest 2019. Arnon Axelrod. Test automation for developers (20)

Software Quality and Test Strategies for Ruby and Rails Applications
Software Quality and Test Strategies for Ruby and Rails ApplicationsSoftware Quality and Test Strategies for Ruby and Rails Applications
Software Quality and Test Strategies for Ruby and Rails Applications
 
An introduction to unit testing
An introduction to unit testingAn introduction to unit testing
An introduction to unit testing
 
TDD Best Practices
TDD Best PracticesTDD Best Practices
TDD Best Practices
 
6 Traits of a Successful Test Automation Architecture
6 Traits of a Successful Test Automation Architecture6 Traits of a Successful Test Automation Architecture
6 Traits of a Successful Test Automation Architecture
 
Unit tests & TDD
Unit tests & TDDUnit tests & TDD
Unit tests & TDD
 
Why Unit Testingl
Why Unit TestinglWhy Unit Testingl
Why Unit Testingl
 
Why unit testingl
Why unit testinglWhy unit testingl
Why unit testingl
 
Why Unit Testingl
Why Unit TestinglWhy Unit Testingl
Why Unit Testingl
 
Lightning Talks by Globant - Automation (This app runs by itself )
Lightning Talks by Globant -  Automation (This app runs by itself ) Lightning Talks by Globant -  Automation (This app runs by itself )
Lightning Talks by Globant - Automation (This app runs by itself )
 
TDD Workshop UTN 2012
TDD Workshop UTN 2012TDD Workshop UTN 2012
TDD Workshop UTN 2012
 
Test driven development in .Net - 2010 + Eclipse
Test driven development in .Net - 2010 + EclipseTest driven development in .Net - 2010 + Eclipse
Test driven development in .Net - 2010 + Eclipse
 
#DOAW16 - DevOps@work Roma 2016 - Testing your databases
#DOAW16 - DevOps@work Roma 2016 - Testing your databases#DOAW16 - DevOps@work Roma 2016 - Testing your databases
#DOAW16 - DevOps@work Roma 2016 - Testing your databases
 
Unit Testing and TDD 2017
Unit Testing and TDD 2017Unit Testing and TDD 2017
Unit Testing and TDD 2017
 
May: Automated Developer Testing: Achievements and Challenges
May: Automated Developer Testing: Achievements and ChallengesMay: Automated Developer Testing: Achievements and Challenges
May: Automated Developer Testing: Achievements and Challenges
 
Testing 101
Testing 101Testing 101
Testing 101
 
Agile Testing, Uncertainty, Risk, and Why It All Works
Agile Testing, Uncertainty, Risk, and Why It All WorksAgile Testing, Uncertainty, Risk, and Why It All Works
Agile Testing, Uncertainty, Risk, and Why It All Works
 
Agile Testing Overview
Agile Testing OverviewAgile Testing Overview
Agile Testing Overview
 
Unit Testing, TDD and the Walking Skeleton
Unit Testing, TDD and the Walking SkeletonUnit Testing, TDD and the Walking Skeleton
Unit Testing, TDD and the Walking Skeleton
 
Agile testing
Agile testingAgile testing
Agile testing
 
Test Driven Development Introduction
Test Driven Development IntroductionTest Driven Development Introduction
Test Driven Development Introduction
 

More from NETFest

.NET Fest 2019. Николай Балакин. Микрооптимизации в мире .NET
.NET Fest 2019. Николай Балакин. Микрооптимизации в мире .NET.NET Fest 2019. Николай Балакин. Микрооптимизации в мире .NET
.NET Fest 2019. Николай Балакин. Микрооптимизации в мире .NETNETFest
 
.NET Fest 2019. Сергей Калинец. Efficient Microservice Communication with .NE...
.NET Fest 2019. Сергей Калинец. Efficient Microservice Communication with .NE....NET Fest 2019. Сергей Калинец. Efficient Microservice Communication with .NE...
.NET Fest 2019. Сергей Калинец. Efficient Microservice Communication with .NE...NETFest
 
.NET Fest 2019. Оля Гавриш. .NET Core 3.0 и будущее .NET
.NET Fest 2019. Оля Гавриш. .NET Core 3.0 и будущее .NET.NET Fest 2019. Оля Гавриш. .NET Core 3.0 и будущее .NET
.NET Fest 2019. Оля Гавриш. .NET Core 3.0 и будущее .NETNETFest
 
.NET Fest 2019. Оля Гавриш. Машинное обучение для .NET программистов
.NET Fest 2019. Оля Гавриш. Машинное обучение для .NET программистов.NET Fest 2019. Оля Гавриш. Машинное обучение для .NET программистов
.NET Fest 2019. Оля Гавриш. Машинное обучение для .NET программистовNETFest
 
.NET Fest 2019. Roberto Freato. Provisioning Azure PaaS fluently with Managem...
.NET Fest 2019. Roberto Freato. Provisioning Azure PaaS fluently with Managem....NET Fest 2019. Roberto Freato. Provisioning Azure PaaS fluently with Managem...
.NET Fest 2019. Roberto Freato. Provisioning Azure PaaS fluently with Managem...NETFest
 
.NET Fest 2019. Halil Ibrahim Kalkan. Implementing Domain Driven Design
.NET Fest 2019. Halil Ibrahim Kalkan. Implementing Domain Driven Design.NET Fest 2019. Halil Ibrahim Kalkan. Implementing Domain Driven Design
.NET Fest 2019. Halil Ibrahim Kalkan. Implementing Domain Driven DesignNETFest
 
.NET Fest 2019. Сергій Бута. Feature Toggles: Dynamic Configuration at Wirex
.NET Fest 2019. Сергій Бута. Feature Toggles: Dynamic Configuration at Wirex.NET Fest 2019. Сергій Бута. Feature Toggles: Dynamic Configuration at Wirex
.NET Fest 2019. Сергій Бута. Feature Toggles: Dynamic Configuration at WirexNETFest
 
.NET Fest 2019. Michael Staib. Hot Chocolate: GraphQL Schema Stitching with A...
.NET Fest 2019. Michael Staib. Hot Chocolate: GraphQL Schema Stitching with A....NET Fest 2019. Michael Staib. Hot Chocolate: GraphQL Schema Stitching with A...
.NET Fest 2019. Michael Staib. Hot Chocolate: GraphQL Schema Stitching with A...NETFest
 
.NET Fest 2019. Андрей Литвинов. Async lifetime tests with xUnit and AutoFixture
.NET Fest 2019. Андрей Литвинов. Async lifetime tests with xUnit and AutoFixture.NET Fest 2019. Андрей Литвинов. Async lifetime tests with xUnit and AutoFixture
.NET Fest 2019. Андрей Литвинов. Async lifetime tests with xUnit and AutoFixtureNETFest
 
.NET Fest 2019. Анатолий Колесник. Love, Death & F# Tests
.NET Fest 2019. Анатолий Колесник. Love, Death & F# Tests.NET Fest 2019. Анатолий Колесник. Love, Death & F# Tests
.NET Fest 2019. Анатолий Колесник. Love, Death & F# TestsNETFest
 
.NET Fest 2019. Алексей Голуб. Монадные парсер-комбинаторы в C# (простой спос...
.NET Fest 2019. Алексей Голуб. Монадные парсер-комбинаторы в C# (простой спос....NET Fest 2019. Алексей Голуб. Монадные парсер-комбинаторы в C# (простой спос...
.NET Fest 2019. Алексей Голуб. Монадные парсер-комбинаторы в C# (простой спос...NETFest
 
.NET Fest 2019. Roberto Freato. Azure App Service deep dive
.NET Fest 2019. Roberto Freato. Azure App Service deep dive.NET Fest 2019. Roberto Freato. Azure App Service deep dive
.NET Fest 2019. Roberto Freato. Azure App Service deep diveNETFest
 
.NET Fest 2019. Леонид Молотиевский. DotNet Core in production
.NET Fest 2019. Леонид Молотиевский. DotNet Core in production.NET Fest 2019. Леонид Молотиевский. DotNet Core in production
.NET Fest 2019. Леонид Молотиевский. DotNet Core in productionNETFest
 
.NET Fest 2019. Александр Демчук. How to measure relationships within the Com...
.NET Fest 2019. Александр Демчук. How to measure relationships within the Com....NET Fest 2019. Александр Демчук. How to measure relationships within the Com...
.NET Fest 2019. Александр Демчук. How to measure relationships within the Com...NETFest
 
.NET Fest 2019. Anna Melashkina та Philipp Bauknecht. Dragons in a Mixed Real...
.NET Fest 2019. Anna Melashkina та Philipp Bauknecht. Dragons in a Mixed Real....NET Fest 2019. Anna Melashkina та Philipp Bauknecht. Dragons in a Mixed Real...
.NET Fest 2019. Anna Melashkina та Philipp Bauknecht. Dragons in a Mixed Real...NETFest
 
.NET Fest 2019. Alex Thissen. Architecting .NET solutions in a Docker ecosystem
.NET Fest 2019. Alex Thissen. Architecting .NET solutions in a Docker ecosystem.NET Fest 2019. Alex Thissen. Architecting .NET solutions in a Docker ecosystem
.NET Fest 2019. Alex Thissen. Architecting .NET solutions in a Docker ecosystemNETFest
 
.NET Fest 2019. Stas Lebedenko. Practical serverless use cases in Azure with ...
.NET Fest 2019. Stas Lebedenko. Practical serverless use cases in Azure with ....NET Fest 2019. Stas Lebedenko. Practical serverless use cases in Azure with ...
.NET Fest 2019. Stas Lebedenko. Practical serverless use cases in Azure with ...NETFest
 
.NET Fest 2019. Сергей Медведев. How serverless makes Integration TDD a reali...
.NET Fest 2019. Сергей Медведев. How serverless makes Integration TDD a reali....NET Fest 2019. Сергей Медведев. How serverless makes Integration TDD a reali...
.NET Fest 2019. Сергей Медведев. How serverless makes Integration TDD a reali...NETFest
 
.NET Fest 2019. Сергей Корж. Natural Language Processing in .NET
.NET Fest 2019. Сергей Корж. Natural Language Processing in .NET.NET Fest 2019. Сергей Корж. Natural Language Processing in .NET
.NET Fest 2019. Сергей Корж. Natural Language Processing in .NETNETFest
 
.NET Fest 2019. Eran Stiller. Create Your Own Serverless PKI with .NET & Azur...
.NET Fest 2019. Eran Stiller. Create Your Own Serverless PKI with .NET & Azur....NET Fest 2019. Eran Stiller. Create Your Own Serverless PKI with .NET & Azur...
.NET Fest 2019. Eran Stiller. Create Your Own Serverless PKI with .NET & Azur...NETFest
 

More from NETFest (20)

.NET Fest 2019. Николай Балакин. Микрооптимизации в мире .NET
.NET Fest 2019. Николай Балакин. Микрооптимизации в мире .NET.NET Fest 2019. Николай Балакин. Микрооптимизации в мире .NET
.NET Fest 2019. Николай Балакин. Микрооптимизации в мире .NET
 
.NET Fest 2019. Сергей Калинец. Efficient Microservice Communication with .NE...
.NET Fest 2019. Сергей Калинец. Efficient Microservice Communication with .NE....NET Fest 2019. Сергей Калинец. Efficient Microservice Communication with .NE...
.NET Fest 2019. Сергей Калинец. Efficient Microservice Communication with .NE...
 
.NET Fest 2019. Оля Гавриш. .NET Core 3.0 и будущее .NET
.NET Fest 2019. Оля Гавриш. .NET Core 3.0 и будущее .NET.NET Fest 2019. Оля Гавриш. .NET Core 3.0 и будущее .NET
.NET Fest 2019. Оля Гавриш. .NET Core 3.0 и будущее .NET
 
.NET Fest 2019. Оля Гавриш. Машинное обучение для .NET программистов
.NET Fest 2019. Оля Гавриш. Машинное обучение для .NET программистов.NET Fest 2019. Оля Гавриш. Машинное обучение для .NET программистов
.NET Fest 2019. Оля Гавриш. Машинное обучение для .NET программистов
 
.NET Fest 2019. Roberto Freato. Provisioning Azure PaaS fluently with Managem...
.NET Fest 2019. Roberto Freato. Provisioning Azure PaaS fluently with Managem....NET Fest 2019. Roberto Freato. Provisioning Azure PaaS fluently with Managem...
.NET Fest 2019. Roberto Freato. Provisioning Azure PaaS fluently with Managem...
 
.NET Fest 2019. Halil Ibrahim Kalkan. Implementing Domain Driven Design
.NET Fest 2019. Halil Ibrahim Kalkan. Implementing Domain Driven Design.NET Fest 2019. Halil Ibrahim Kalkan. Implementing Domain Driven Design
.NET Fest 2019. Halil Ibrahim Kalkan. Implementing Domain Driven Design
 
.NET Fest 2019. Сергій Бута. Feature Toggles: Dynamic Configuration at Wirex
.NET Fest 2019. Сергій Бута. Feature Toggles: Dynamic Configuration at Wirex.NET Fest 2019. Сергій Бута. Feature Toggles: Dynamic Configuration at Wirex
.NET Fest 2019. Сергій Бута. Feature Toggles: Dynamic Configuration at Wirex
 
.NET Fest 2019. Michael Staib. Hot Chocolate: GraphQL Schema Stitching with A...
.NET Fest 2019. Michael Staib. Hot Chocolate: GraphQL Schema Stitching with A....NET Fest 2019. Michael Staib. Hot Chocolate: GraphQL Schema Stitching with A...
.NET Fest 2019. Michael Staib. Hot Chocolate: GraphQL Schema Stitching with A...
 
.NET Fest 2019. Андрей Литвинов. Async lifetime tests with xUnit and AutoFixture
.NET Fest 2019. Андрей Литвинов. Async lifetime tests with xUnit and AutoFixture.NET Fest 2019. Андрей Литвинов. Async lifetime tests with xUnit and AutoFixture
.NET Fest 2019. Андрей Литвинов. Async lifetime tests with xUnit and AutoFixture
 
.NET Fest 2019. Анатолий Колесник. Love, Death & F# Tests
.NET Fest 2019. Анатолий Колесник. Love, Death & F# Tests.NET Fest 2019. Анатолий Колесник. Love, Death & F# Tests
.NET Fest 2019. Анатолий Колесник. Love, Death & F# Tests
 
.NET Fest 2019. Алексей Голуб. Монадные парсер-комбинаторы в C# (простой спос...
.NET Fest 2019. Алексей Голуб. Монадные парсер-комбинаторы в C# (простой спос....NET Fest 2019. Алексей Голуб. Монадные парсер-комбинаторы в C# (простой спос...
.NET Fest 2019. Алексей Голуб. Монадные парсер-комбинаторы в C# (простой спос...
 
.NET Fest 2019. Roberto Freato. Azure App Service deep dive
.NET Fest 2019. Roberto Freato. Azure App Service deep dive.NET Fest 2019. Roberto Freato. Azure App Service deep dive
.NET Fest 2019. Roberto Freato. Azure App Service deep dive
 
.NET Fest 2019. Леонид Молотиевский. DotNet Core in production
.NET Fest 2019. Леонид Молотиевский. DotNet Core in production.NET Fest 2019. Леонид Молотиевский. DotNet Core in production
.NET Fest 2019. Леонид Молотиевский. DotNet Core in production
 
.NET Fest 2019. Александр Демчук. How to measure relationships within the Com...
.NET Fest 2019. Александр Демчук. How to measure relationships within the Com....NET Fest 2019. Александр Демчук. How to measure relationships within the Com...
.NET Fest 2019. Александр Демчук. How to measure relationships within the Com...
 
.NET Fest 2019. Anna Melashkina та Philipp Bauknecht. Dragons in a Mixed Real...
.NET Fest 2019. Anna Melashkina та Philipp Bauknecht. Dragons in a Mixed Real....NET Fest 2019. Anna Melashkina та Philipp Bauknecht. Dragons in a Mixed Real...
.NET Fest 2019. Anna Melashkina та Philipp Bauknecht. Dragons in a Mixed Real...
 
.NET Fest 2019. Alex Thissen. Architecting .NET solutions in a Docker ecosystem
.NET Fest 2019. Alex Thissen. Architecting .NET solutions in a Docker ecosystem.NET Fest 2019. Alex Thissen. Architecting .NET solutions in a Docker ecosystem
.NET Fest 2019. Alex Thissen. Architecting .NET solutions in a Docker ecosystem
 
.NET Fest 2019. Stas Lebedenko. Practical serverless use cases in Azure with ...
.NET Fest 2019. Stas Lebedenko. Practical serverless use cases in Azure with ....NET Fest 2019. Stas Lebedenko. Practical serverless use cases in Azure with ...
.NET Fest 2019. Stas Lebedenko. Practical serverless use cases in Azure with ...
 
.NET Fest 2019. Сергей Медведев. How serverless makes Integration TDD a reali...
.NET Fest 2019. Сергей Медведев. How serverless makes Integration TDD a reali....NET Fest 2019. Сергей Медведев. How serverless makes Integration TDD a reali...
.NET Fest 2019. Сергей Медведев. How serverless makes Integration TDD a reali...
 
.NET Fest 2019. Сергей Корж. Natural Language Processing in .NET
.NET Fest 2019. Сергей Корж. Natural Language Processing in .NET.NET Fest 2019. Сергей Корж. Natural Language Processing in .NET
.NET Fest 2019. Сергей Корж. Natural Language Processing in .NET
 
.NET Fest 2019. Eran Stiller. Create Your Own Serverless PKI with .NET & Azur...
.NET Fest 2019. Eran Stiller. Create Your Own Serverless PKI with .NET & Azur....NET Fest 2019. Eran Stiller. Create Your Own Serverless PKI with .NET & Azur...
.NET Fest 2019. Eran Stiller. Create Your Own Serverless PKI with .NET & Azur...
 

Recently uploaded

Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and ModificationsMJDuyan
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfPoh-Sun Goh
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...ZurliaSoop
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsKarakKing
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.pptRamjanShidvankar
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxAreebaZafar22
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.MaryamAhmad92
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Pooja Bhuva
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Jisc
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxDr. Sarita Anand
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Association for Project Management
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...Poonam Aher Patil
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jisc
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxDenish Jangid
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSCeline George
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptxMaritesTamaniVerdade
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the ClassroomPooky Knightsmith
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxCeline George
 

Recently uploaded (20)

Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptx
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the Classroom
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptx
 

.NET Fest 2019. Arnon Axelrod. Test automation for developers

  • 1. © Copyright SELA Software & Education Labs Ltd. | 14-18 Baruch Hirsch St Bnei Brak, 51202 Israel | www.selagroup.com Arnon Axelrod Test Automation for Developers
  • 2. Arnon Axelrod Expert for: Test Automation eXtreme Programming Practices Defect-free software development ArnonAxelrod @ArnonAxelrod @ArnonAxelrod
  • 5. Developers vs. Testers Unit Tests System Tests
  • 6.
  • 7. Some common (mis?)conceptions Unit System Purpose Verify implementation Find bugs Planned, written and used by Developers Testers / Automation Developers Runs After Check-in Nightly / Before release Scope Single function or class Entire System (Like a real user) Isolation Mock all I/O (DB, Network, etc.) Full environment Data Fake Real Stability High Low Speed Very fast Very slow Failure investigation Easy Hard When written Before (TDD?) Only when dev is done
  • 9. Test Scope (AKA Testbed)
  • 10. Simplistic view on a computer system Processing InputsOutputs
  • 11. Simplistic view on Test Automation Processing (SUT) InputsOutputs TestExpected? Pass/Fail
  • 12. A more realistic view on computer systems…
  • 13. End to End (System) Scope UI View Model Client Logic Server Proxy Service Layer Business Logic DAL ORM DB
  • 14. Unit Tests scope UI View Model Client Logic Server Proxy Service Layer DAL ORM DB Business Logic
  • 15. Client-only Test Scope UI View Model Client Logic Server Proxy Service Layer Business Logic DAL ORM DB Simulator
  • 16. Backend-only Test Scope UI View Model Client Logic Server Proxy Service Layer Business Logic DAL ORM DB
  • 17. Server / Service Test Scope UI View Model Client Logic Server Proxy Service Layer Business Logic DAL ORM DBFake DB
  • 18. Under the Skin Test Scope UI View Model Client Logic Server Proxy Service Layer Business Logic DAL ORM DB
  • 19. Functionality Test Scope UI View Model Client Logic Server Proxy Service Layer Business Logic DAL ORM DB Mock Mock Mock
  • 21. The Purpose of Test Automation
  • 25. “Refactoring is all about applying small behavior-preserving steps and making a big change by stringing together a sequence of these behavior-preserving steps … As a result, when I’m refactoring, my code doesn’t spend much time in a broken state, allowing me to stop at any moment even if I haven’t finished.”
  • 27. 4 Rules of Simple Design / Kent Beck Passes all the Tests Reveals the intention No duplication Fewest elements (functions and methods) The rules are in priority order
  • 28.
  • 29. Tests should describe Observable Behavior
  • 30. When the design is too complex...
  • 31. Test Structure Arrange Act Assert Given When Then
  • 33. Test Method Example [TestMethod] public void AddingProductWithPromotionGivesDiscount() { const decimal price = 1200; const decimal discount = 150; var iPhone = CreateProduct("iPhone", price); CreatePromotionOnProduct(iPhone, discount); var shoppingCart = CreateShoppingCart(); shoppingCart.Add(iPhone); Assert.AreEqual(price - discount, shoppingCart.Total); }
  • 34. Best Practices for Writing Tests Keep it simple Reliability Isolate tests from one another Deterministic and Specific Expected Result Don’t assume anything about existing data Mock anything you can’t control Maintainability Readable No duplication Refactor continuously!
  • 35. ATDD - Acceptance Test Driven Development PO defines the problem (User Story) PO & team collaborate on simplest solution Define Acceptance Criteria Implement automated test Implement Code & Refactor Exploratory testing Get customer feedback
  • 36. Back to our (mis)conceptions… Unit System Purpose Verify implementation Find bugs Planned, written and used by Developers Testers / Automation Deelopers Runs After Check-in Nightly / Before release Scope Single function or class Entire System (Like a real user) Isolation Mock all I/O (DB, Network, etc.) Full environment Data Fake Real Stability High Low Speed Very fast Very slow Failure investigation Easy Hard When written Before (TDD?) Only when dev is done Verify Behavior  Refactoring  Clean code  Better Quality The entire team As soon and often as possible Smaller… As needed …Larger Mock anything as needed Mostly Fake data High Slower Should be made easy Preferably before (ATDD)
  • 37. Back to the Pyramids…
  • 38. Back to the Testing Pyramid E2E Integration Unit
  • 39. Back to the Testing Pyramid E2E … Unit
  • 40. Test automation is your concern! Quality comes from the code and the design Design should evolve over time. Test automation enable that Collaborate with the testers and test automation developers Most principles apply to all test scopes

Editor's Notes

  1. I come from a dev background
  2. Why I was so interested in Test Automation Test Automation is not (just) about testing, and that’s why it’s your concern!
  3. Quality and Testing are 2 different things Testers don’t control quality! Developers do! Test Automation is a tool that helps improve quality, if used correctly!
  4. And what’s that “integration tests” even mean?! this is dichotomic. I suggest a different paradigm I call “Test Scope”
  5. But before I
  6. באופן פשטני ודומה, בדיקות אוטומטיות הן תוכנה שמזינה קלט מסויים לתוך המערכת הנבדקת, בוחנת את הפלט ומדווחת אם הפלט מתאים לתוצאה הצפויה או לא. באופן עקרוני, הפלט של כל מערכת (והמערכת הנבדקת בפרט) תלוי אך ורק בקלט שלה! בהנתן שזה המצב, אין כל סיבה שבדיקה אוטומטית לא תתן גם היא תמיד את אותה תוצאה עבור כל עוד המערכת הנבדקת לא השתנתה. הבעיה היא שבפועל, רוב המערכות לא נראות כ"כ פשוטות, אלא נראות יותר כמו משהו כזה:...
  7. למעשה יש לנו כאן אוסף של מערכות שכל אחת מהן מקבלת קלט ממספר מקורות, כולל: § תתי מערכות אחרות § מערכות חיצוניות § בסיסי נתונים § מידע מחיישנים שונים תאריך ושעה... כולל שעון התזמון של מערכת ההפעלה שמשפיע על תזמון של thread-ים... שאלה: מי פה כותב את הבדיקות האוטומטיות על סמך תסריטים שבודקים ידניים מגדירים? (מי מגדיר בעצמו?) מה הבעיה עם זה? □ לבודקים ידניים פחות חשוב העניין של יציבות כי הם יכולים להפעיל שיקול דעת ולהבין אם התוצאה שהם קיבלו שונה מהתוצאה הצפויה בגלל באג או בגלל שאיזשהו "קלט" שהם לא שולטים בו לא היה בדיוק מה שתוכנן. □ בגלל זה בודקים ידניים הרבה פעמים גם לא טורחים להגדיר במדוייק את התוצאה הצפויה, אלא שוב, מסתמכים על השיקול דעת שלהם בזמן הרצת הבדיקה □ לעתים קרובות לבודקים הידניים אין את היכולת לשלוט בקלט שמגיע ממקורות שונים מלבד ממשק המשתמש (ולעתים ה-database) ו/או לבדוק את הפלט שנשלח למקורות אחרים מלבד ה-UI לעומת זאת, באוטומציה, חשוב שנהיה מסוגלים לשלוט בכל מקור קלט שיכול להשפיע על תוצאות הבדיקה! כמו כן, רצוי מאד שנהיה מסוגלים לבחון יעדי פלט אחרים מלבד ה-UI, בעיקר אם זאת המהות של המערכת... § למעשה, אנחנו צריכים "לסמן מסגרת" מסביב לרכיבים שאנחנו רוצים לבדוק, ולזהות את כל מקורות הקלט שיכולים להשפיע על הפלט שאותו אנחנו רוצים לבדוק <תמונה> הערה: אם אנחנו יכולים להבטיח במידה מספיק גבוהה של אמינות שקלט מסויים לא יכול להשפיע על הפלט הנבדק, אז אנחנו לא חייבים לשלוט בו.
  8. לשנות צבע של המילה ולמרכז
  9. Don’t be stuck on the 3 types of tests…
  10. For functional tests, humans are better than machines in finding bugs
  11. Bad abstractions, wrong encapsulation, duplications, etc. can lead to bugs What causes it? What can we do about it?
  12. We must have a proper test automation suite to allow safe refactoring
  13. Attributes of simple design: Loosely-coupled No duplication Modular Simple design requires less and simpler tests
  14. This also applies to unit tests!
  15. Unit tests may interfere with refactoring… Either write E2E first or refactor
  16. Top->Down ביזנס קצר וממוקד
  17. (After slide: ) But how do we decide what to test? My best experience developing software was in a team that used the ATDD methodology:
  18. It’s not always appropriate Generally, good structure will lead to it.