SlideShare uma empresa Scribd logo
1 de 25
Baixar para ler offline
Automated testing overview
February 2012
Summary
• Why do we need software testing
• Software testing definition
• Types of testing
• Why do we need automated testing
• Unit testing for simple objects
• Unit testing for objects that have
dependencies
• Automated testing for user interface
Why do we need software testing
• To reduce operating costs : software bugs are a
big cost for the business;
• To protect company reputation : software
quality is a key requirement of any new project;
• any developer will do some kind of testing
before delivering the software to the client;
• software testing is a core activity associated
with the development process;
Software testing definition
• Definition: Software testing is an investigation
conducted to provide stakeholders with
information about the quality of the product
or service under test;
• software testing verifies and validates that the
software deliverable:
– meets the business and technical requirements that
guided its design and development;
– works as expected;
Types of testing
• system testing : exercises the application end
to end. Based on specifications and executed
using tests scripts as part of a test plan.
• integration testing : targets parts of the
application e.g. the service layer;
• unit testing : tests individual code units : e.g.
classes.
Cost of software bugs
Cost to fix a defect
Time detected
Requirem
ents
Architectu
re
Constructi
on
System
test
After
release
Time
introd
uced
Requirement
s
1x 3x 5-10x 10x 10-100x
Architecture - 1x 10x 15x 25-100x
Construction - - 1x 10x 10-25x
• the cost of removing a software bug is linked to the development stage the
software bug is found;
Difficulties of software testing
• It is a lengthy process and can happen only after the
alpha stage of the application;
• Constant retesting : After each release we need to
test new features and retest existing ones - even if
the changes affect only a part of the application we
can never be sure that the rest of the application is
unaffected;
• Usually the full test plan is applied right at the end of
the delivery cycle : regression errors or unexpected
errors can be detected too close to final delivery -
they can affect the delivery schedule;
Solution: automated tests
• Automate the test plan right from the beginning of
the development cycle : the developer can now
exercise the application before is deployed to
testing;
• System testing will always have a manual part but
can be also comprised of automated tests that can
cover a lot of scenarios
• Use unit testing and integration testing extensively
as they can be automated with minimal costs;
Why do we need automated testing
• TIME - speed up the delivery schedule : the test
window is reduced and testers can concentrate more
on exploratory testing and test cases that cannot be
automated;
• COST - reduce the number of bugs : bugs can be
detected before a deployment is made and
regression issues are reduced significantly;
• SCOPE - reduce the amount of rework and make
scope changes cheap: the testers, business analysts
and developers will start from test scenarios first
that will increase the product knowledge right from
the start;
How to implement automated tests
• The application need to be testable;
• System testing : coded ui tests using an automation
framework or using record and replay tools;
• Integrations tests : inject data that is used to exercise
the application layers for specific scenarios;
• Unit testing : they are code only tests so they don’t
have an impact on external systems and their
dependencies
Unit testing
What is a unit test
• Can I run and get results from a unit test I wrote two
weeks or even months or years ago?
• Can any member of my team run and get the results
from unit tests I wrote two months ago?
• Can I run all the unit tests I’ve written in no more than
a few minutes?
• Can I run all the unit tests I’ve written at the push of a
button?
• Can I write a basic unit test in no more than a few
minutes?
Properties of a good unit test
• It should be automated and repeatable.
• It should be easy to implement.
• Once it’s written, it should remain for future
use.
• Anyone should be able to run it.
• It should run at the push of a button.
• It should run quickly.
Styles of writing unit tests
• write production code first then unit tests;
• test driven development(TDD): write the unit
tests first then production code;
• behaviour driven development(BDD): start
from user stories and decompose them in
scenarios then write code to validate the
scenarios
Unit testing naming conventions used
in examples
Object to be tested Object to create on the testing side
Project Create a test project named [ProjectUnderTest].Tests.
Class For each class, create at least one class with the name
[ClassName]Tests.
Method For each method, create at least one test method with
the following name:
[MethodName]_[StateUnderTest]_[ExpectedBehavior]
.
Example 1
SimpleParserCustomTests
Unit testing framework - MsTest
• Automates unit testing;
• Provides an intuitive easy to use interface;
• Generates output that can be used by the
continuous integration process;
• to write a unit test you just need to use
– two attributes [TestClass], [TestMethod];
– a static function call Assert that validates the test;
Example 1
SimpleParserTests
Unit testing classes that have
dependencies
Example 2
LegacyLogAnalyser
• Requirements:
– create a class that analyses a log file;
– if the log file is invalid call a webservice and log
the problem;
– if an error is encountered send an email to an
administrator;
Controlling dependencies
• identify dependencies;
• isolate them by introducing interfaces;
• this process is referred to as making the class
under test testable;
• during test replace interfaces with objects
that you can control(replace the dependency
with a fake);
• this process is referred to as mocking the
dependencies;
Example 2
LogAnalyser
LogAnalyserTests
Mocking framework – Rhino.Mocks
• a mocking framework facilitates the generation
of fakes;
• there are two main types of unit testing;
– state-based unit testing;
– interaction-based unit testing;
• there are two type of fakes to match the two
types of unit testing: stub and mock;
• Rhino.Mocks is the most widely used open
source framework;
• MockReposity.GenerateStub<T> and
MockReposity.GenerateMock<T> are the
methods used to generate fakes;
Example 2
LogAnalyserTestsWithRhinoMocks
Conclusion
• Defined the place of unit testing in the wider
context of software testing;
• Defined properties of a good unit test;
• Introduction to an unit testing framework;
• Discussed about the need to isolate and
control dependencies during testing;
• Introduction to a mocking framework.

Mais conteúdo relacionado

Mais procurados

Project Management: Burn-Down Chart / OrangeHRM Project MOD (eng)
Project Management: Burn-Down Chart / OrangeHRM Project MOD (eng)Project Management: Burn-Down Chart / OrangeHRM Project MOD (eng)
Project Management: Burn-Down Chart / OrangeHRM Project MOD (eng)Anatoliy Okhotnikov
 
How To Transform the Manual Testing Process to Incorporate Test Automation
How To Transform the Manual Testing Process to Incorporate Test AutomationHow To Transform the Manual Testing Process to Incorporate Test Automation
How To Transform the Manual Testing Process to Incorporate Test AutomationRanorex
 
Automation test scripting techniques
Automation test scripting techniquesAutomation test scripting techniques
Automation test scripting techniquesZhu Zhong
 
Why Test Automation Fails
Why Test Automation FailsWhy Test Automation Fails
Why Test Automation FailsRanorex
 
Best practices for writing good automated tests
Best practices for writing good automated testsBest practices for writing good automated tests
Best practices for writing good automated testsFelipe Lima
 
Automation testing IBM RFT - Rational Functional Tester
Automation testing IBM RFT - Rational Functional TesterAutomation testing IBM RFT - Rational Functional Tester
Automation testing IBM RFT - Rational Functional TesterVijayChowthri Nagaprakasham
 
Creating Maintainable Automated Acceptance Tests
Creating Maintainable Automated Acceptance TestsCreating Maintainable Automated Acceptance Tests
Creating Maintainable Automated Acceptance TestsJez Humble
 
Testing automation in agile environment
Testing automation in agile environmentTesting automation in agile environment
Testing automation in agile environmentPerfecto Mobile
 
Framework for Web Automation Testing
Framework for Web Automation TestingFramework for Web Automation Testing
Framework for Web Automation TestingTaras Lytvyn
 
Test automation in agile ecosystem
Test automation in agile ecosystemTest automation in agile ecosystem
Test automation in agile ecosystemJohnRizer
 
Agile testing - Principles and best practices
Agile testing  - Principles and best practicesAgile testing  - Principles and best practices
Agile testing - Principles and best practicesDr Ganesh Iyer
 
Automated Testing with Agile
Automated Testing with AgileAutomated Testing with Agile
Automated Testing with AgileKen McCorkell
 
Centralized test automation framework implementation
Centralized test automation framework implementationCentralized test automation framework implementation
Centralized test automation framework implementationBharathi Krishnamurthi
 
Automated vs manual testing
Automated vs manual testingAutomated vs manual testing
Automated vs manual testingKanoah
 
Testing strategy for agile projects updated
Testing strategy for agile projects updatedTesting strategy for agile projects updated
Testing strategy for agile projects updatedTharinda Liyanage
 
Tutorial ranorex
Tutorial ranorexTutorial ranorex
Tutorial ranorexradikalzen
 
TEST_AUTOMATION_CASE_STUDY_(2)2[1]
TEST_AUTOMATION_CASE_STUDY_(2)2[1]TEST_AUTOMATION_CASE_STUDY_(2)2[1]
TEST_AUTOMATION_CASE_STUDY_(2)2[1]Clive Dall
 
Introduction to Back End Automation Testing - Nguyen Vu Hoang, Hoang Phi
Introduction to Back End Automation Testing - Nguyen Vu Hoang, Hoang PhiIntroduction to Back End Automation Testing - Nguyen Vu Hoang, Hoang Phi
Introduction to Back End Automation Testing - Nguyen Vu Hoang, Hoang PhiHo Chi Minh City Software Testing Club
 

Mais procurados (20)

Project Management: Burn-Down Chart / OrangeHRM Project MOD (eng)
Project Management: Burn-Down Chart / OrangeHRM Project MOD (eng)Project Management: Burn-Down Chart / OrangeHRM Project MOD (eng)
Project Management: Burn-Down Chart / OrangeHRM Project MOD (eng)
 
How To Transform the Manual Testing Process to Incorporate Test Automation
How To Transform the Manual Testing Process to Incorporate Test AutomationHow To Transform the Manual Testing Process to Incorporate Test Automation
How To Transform the Manual Testing Process to Incorporate Test Automation
 
Automation test scripting techniques
Automation test scripting techniquesAutomation test scripting techniques
Automation test scripting techniques
 
Why Test Automation Fails
Why Test Automation FailsWhy Test Automation Fails
Why Test Automation Fails
 
Best practices for writing good automated tests
Best practices for writing good automated testsBest practices for writing good automated tests
Best practices for writing good automated tests
 
Automation testing IBM RFT - Rational Functional Tester
Automation testing IBM RFT - Rational Functional TesterAutomation testing IBM RFT - Rational Functional Tester
Automation testing IBM RFT - Rational Functional Tester
 
Creating Maintainable Automated Acceptance Tests
Creating Maintainable Automated Acceptance TestsCreating Maintainable Automated Acceptance Tests
Creating Maintainable Automated Acceptance Tests
 
Testing automation in agile environment
Testing automation in agile environmentTesting automation in agile environment
Testing automation in agile environment
 
Framework for Web Automation Testing
Framework for Web Automation TestingFramework for Web Automation Testing
Framework for Web Automation Testing
 
Test automation in agile ecosystem
Test automation in agile ecosystemTest automation in agile ecosystem
Test automation in agile ecosystem
 
Agile testing - Principles and best practices
Agile testing  - Principles and best practicesAgile testing  - Principles and best practices
Agile testing - Principles and best practices
 
Automated Testing with Agile
Automated Testing with AgileAutomated Testing with Agile
Automated Testing with Agile
 
Introduction to Software Test Automation
Introduction to Software Test AutomationIntroduction to Software Test Automation
Introduction to Software Test Automation
 
Centralized test automation framework implementation
Centralized test automation framework implementationCentralized test automation framework implementation
Centralized test automation framework implementation
 
Testing Tools
Testing ToolsTesting Tools
Testing Tools
 
Automated vs manual testing
Automated vs manual testingAutomated vs manual testing
Automated vs manual testing
 
Testing strategy for agile projects updated
Testing strategy for agile projects updatedTesting strategy for agile projects updated
Testing strategy for agile projects updated
 
Tutorial ranorex
Tutorial ranorexTutorial ranorex
Tutorial ranorex
 
TEST_AUTOMATION_CASE_STUDY_(2)2[1]
TEST_AUTOMATION_CASE_STUDY_(2)2[1]TEST_AUTOMATION_CASE_STUDY_(2)2[1]
TEST_AUTOMATION_CASE_STUDY_(2)2[1]
 
Introduction to Back End Automation Testing - Nguyen Vu Hoang, Hoang Phi
Introduction to Back End Automation Testing - Nguyen Vu Hoang, Hoang PhiIntroduction to Back End Automation Testing - Nguyen Vu Hoang, Hoang Phi
Introduction to Back End Automation Testing - Nguyen Vu Hoang, Hoang Phi
 

Destaque

Selenium Tutorial for Beginners | Automation framework Basics
Selenium Tutorial for Beginners | Automation framework BasicsSelenium Tutorial for Beginners | Automation framework Basics
Selenium Tutorial for Beginners | Automation framework BasicsTechcanvass
 
Interview questions
Interview questionsInterview questions
Interview questionsswatiba
 
Types of Software Testing
Types of Software TestingTypes of Software Testing
Types of Software TestingNishant Worah
 
Manual testing interview question by INFOTECH
Manual testing interview question by INFOTECHManual testing interview question by INFOTECH
Manual testing interview question by INFOTECHPravinsinh
 

Destaque (6)

Software testing
Software testingSoftware testing
Software testing
 
Software testing
Software testingSoftware testing
Software testing
 
Selenium Tutorial for Beginners | Automation framework Basics
Selenium Tutorial for Beginners | Automation framework BasicsSelenium Tutorial for Beginners | Automation framework Basics
Selenium Tutorial for Beginners | Automation framework Basics
 
Interview questions
Interview questionsInterview questions
Interview questions
 
Types of Software Testing
Types of Software TestingTypes of Software Testing
Types of Software Testing
 
Manual testing interview question by INFOTECH
Manual testing interview question by INFOTECHManual testing interview question by INFOTECH
Manual testing interview question by INFOTECH
 

Semelhante a Automated testing overview

Software Quality Assurance
Software Quality AssuranceSoftware Quality Assurance
Software Quality AssuranceSaqib Raza
 
Testing Frameworks
Testing FrameworksTesting Frameworks
Testing FrameworksMoataz Nabil
 
Testing strategies part -1
Testing strategies part -1Testing strategies part -1
Testing strategies part -1Divya Tiwari
 
testing strategies and tactics
 testing strategies and tactics testing strategies and tactics
testing strategies and tacticsPreeti Mishra
 
Agile Acceptance testing with Fitnesse
Agile Acceptance testing with FitnesseAgile Acceptance testing with Fitnesse
Agile Acceptance testing with FitnesseClareMcLennan
 
Structured system analysis and design
Structured system analysis and design Structured system analysis and design
Structured system analysis and design Jayant Dalvi
 
V Model in Software Testing
V Model in Software TestingV Model in Software Testing
V Model in Software TestingAbdul Raheem
 
Object Oriented Testing(OOT) presentation slides
Object Oriented Testing(OOT) presentation slidesObject Oriented Testing(OOT) presentation slides
Object Oriented Testing(OOT) presentation slidesPunjab University
 
software testing
 software testing software testing
software testingSara shall
 
Week 14 Unit Testing.pptx
Week 14  Unit Testing.pptxWeek 14  Unit Testing.pptx
Week 14 Unit Testing.pptxmianshafa
 
SENG202-v-and-v-modeling_121810.pptx
SENG202-v-and-v-modeling_121810.pptxSENG202-v-and-v-modeling_121810.pptx
SENG202-v-and-v-modeling_121810.pptxMinsasWorld
 
unit-2_20-july-2018 (1).pptx
unit-2_20-july-2018 (1).pptxunit-2_20-july-2018 (1).pptx
unit-2_20-july-2018 (1).pptxPriyaFulpagare1
 
Objectorientedtesting 160320132146
Objectorientedtesting 160320132146Objectorientedtesting 160320132146
Objectorientedtesting 160320132146vidhyyav
 
Object oriented testing
Object oriented testingObject oriented testing
Object oriented testingHaris Jamil
 
Software Engineering (Software Quality Assurance & Testing: Supplementary Mat...
Software Engineering (Software Quality Assurance & Testing: Supplementary Mat...Software Engineering (Software Quality Assurance & Testing: Supplementary Mat...
Software Engineering (Software Quality Assurance & Testing: Supplementary Mat...ShudipPal
 
Software Testing Strategies ,Validation Testing and System Testing.
Software Testing Strategies ,Validation Testing and System Testing.Software Testing Strategies ,Validation Testing and System Testing.
Software Testing Strategies ,Validation Testing and System Testing.Tanzeem Aslam
 

Semelhante a Automated testing overview (20)

Software testing
Software testingSoftware testing
Software testing
 
Software Quality Assurance
Software Quality AssuranceSoftware Quality Assurance
Software Quality Assurance
 
Testing Frameworks
Testing FrameworksTesting Frameworks
Testing Frameworks
 
Testing strategies part -1
Testing strategies part -1Testing strategies part -1
Testing strategies part -1
 
testing strategies and tactics
 testing strategies and tactics testing strategies and tactics
testing strategies and tactics
 
Agile Acceptance testing with Fitnesse
Agile Acceptance testing with FitnesseAgile Acceptance testing with Fitnesse
Agile Acceptance testing with Fitnesse
 
Structured system analysis and design
Structured system analysis and design Structured system analysis and design
Structured system analysis and design
 
V Model in Software Testing
V Model in Software TestingV Model in Software Testing
V Model in Software Testing
 
Object Oriented Testing(OOT) presentation slides
Object Oriented Testing(OOT) presentation slidesObject Oriented Testing(OOT) presentation slides
Object Oriented Testing(OOT) presentation slides
 
Software testing
Software testingSoftware testing
Software testing
 
software testing
 software testing software testing
software testing
 
Software automation
Software automationSoftware automation
Software automation
 
Week 14 Unit Testing.pptx
Week 14  Unit Testing.pptxWeek 14  Unit Testing.pptx
Week 14 Unit Testing.pptx
 
unit-5 SPM.pptx
unit-5 SPM.pptxunit-5 SPM.pptx
unit-5 SPM.pptx
 
SENG202-v-and-v-modeling_121810.pptx
SENG202-v-and-v-modeling_121810.pptxSENG202-v-and-v-modeling_121810.pptx
SENG202-v-and-v-modeling_121810.pptx
 
unit-2_20-july-2018 (1).pptx
unit-2_20-july-2018 (1).pptxunit-2_20-july-2018 (1).pptx
unit-2_20-july-2018 (1).pptx
 
Objectorientedtesting 160320132146
Objectorientedtesting 160320132146Objectorientedtesting 160320132146
Objectorientedtesting 160320132146
 
Object oriented testing
Object oriented testingObject oriented testing
Object oriented testing
 
Software Engineering (Software Quality Assurance & Testing: Supplementary Mat...
Software Engineering (Software Quality Assurance & Testing: Supplementary Mat...Software Engineering (Software Quality Assurance & Testing: Supplementary Mat...
Software Engineering (Software Quality Assurance & Testing: Supplementary Mat...
 
Software Testing Strategies ,Validation Testing and System Testing.
Software Testing Strategies ,Validation Testing and System Testing.Software Testing Strategies ,Validation Testing and System Testing.
Software Testing Strategies ,Validation Testing and System Testing.
 

Último

Empowering Africa's Next Generation: The AI Leadership Blueprint
Empowering Africa's Next Generation: The AI Leadership BlueprintEmpowering Africa's Next Generation: The AI Leadership Blueprint
Empowering Africa's Next Generation: The AI Leadership BlueprintMahmoud Rabie
 
COMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a WebsiteCOMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a Websitedgelyza
 
Linked Data in Production: Moving Beyond Ontologies
Linked Data in Production: Moving Beyond OntologiesLinked Data in Production: Moving Beyond Ontologies
Linked Data in Production: Moving Beyond OntologiesDavid Newbury
 
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve DecarbonizationUsing IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve DecarbonizationIES VE
 
IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019
IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019
IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019IES VE
 
Things you didn't know you can use in your Salesforce
Things you didn't know you can use in your SalesforceThings you didn't know you can use in your Salesforce
Things you didn't know you can use in your SalesforceMartin Humpolec
 
Babel Compiler - Transforming JavaScript for All Browsers.pptx
Babel Compiler - Transforming JavaScript for All Browsers.pptxBabel Compiler - Transforming JavaScript for All Browsers.pptx
Babel Compiler - Transforming JavaScript for All Browsers.pptxYounusS2
 
Artificial Intelligence & SEO Trends for 2024
Artificial Intelligence & SEO Trends for 2024Artificial Intelligence & SEO Trends for 2024
Artificial Intelligence & SEO Trends for 2024D Cloud Solutions
 
COMPUTER 10: Lesson 7 - File Storage and Online Collaboration
COMPUTER 10: Lesson 7 - File Storage and Online CollaborationCOMPUTER 10: Lesson 7 - File Storage and Online Collaboration
COMPUTER 10: Lesson 7 - File Storage and Online Collaborationbruanjhuli
 
Nanopower In Semiconductor Industry.pdf
Nanopower  In Semiconductor Industry.pdfNanopower  In Semiconductor Industry.pdf
Nanopower In Semiconductor Industry.pdfPedro Manuel
 
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...Will Schroeder
 
Digital magic. A small project for controlling smart light bulbs.
Digital magic. A small project for controlling smart light bulbs.Digital magic. A small project for controlling smart light bulbs.
Digital magic. A small project for controlling smart light bulbs.francesco barbera
 
20200723_insight_release_plan_v6.pdf20200723_insight_release_plan_v6.pdf
20200723_insight_release_plan_v6.pdf20200723_insight_release_plan_v6.pdf20200723_insight_release_plan_v6.pdf20200723_insight_release_plan_v6.pdf
20200723_insight_release_plan_v6.pdf20200723_insight_release_plan_v6.pdfJamie (Taka) Wang
 
Cloud Revolution: Exploring the New Wave of Serverless Spatial Data
Cloud Revolution: Exploring the New Wave of Serverless Spatial DataCloud Revolution: Exploring the New Wave of Serverless Spatial Data
Cloud Revolution: Exploring the New Wave of Serverless Spatial DataSafe Software
 
UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1DianaGray10
 
9 Steps For Building Winning Founding Team
9 Steps For Building Winning Founding Team9 Steps For Building Winning Founding Team
9 Steps For Building Winning Founding TeamAdam Moalla
 
Secure your environment with UiPath and CyberArk technologies - Session 1
Secure your environment with UiPath and CyberArk technologies - Session 1Secure your environment with UiPath and CyberArk technologies - Session 1
Secure your environment with UiPath and CyberArk technologies - Session 1DianaGray10
 
Computer 10: Lesson 10 - Online Crimes and Hazards
Computer 10: Lesson 10 - Online Crimes and HazardsComputer 10: Lesson 10 - Online Crimes and Hazards
Computer 10: Lesson 10 - Online Crimes and HazardsSeth Reyes
 
Designing A Time bound resource download URL
Designing A Time bound resource download URLDesigning A Time bound resource download URL
Designing A Time bound resource download URLRuncy Oommen
 
Machine Learning Model Validation (Aijun Zhang 2024).pdf
Machine Learning Model Validation (Aijun Zhang 2024).pdfMachine Learning Model Validation (Aijun Zhang 2024).pdf
Machine Learning Model Validation (Aijun Zhang 2024).pdfAijun Zhang
 

Último (20)

Empowering Africa's Next Generation: The AI Leadership Blueprint
Empowering Africa's Next Generation: The AI Leadership BlueprintEmpowering Africa's Next Generation: The AI Leadership Blueprint
Empowering Africa's Next Generation: The AI Leadership Blueprint
 
COMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a WebsiteCOMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a Website
 
Linked Data in Production: Moving Beyond Ontologies
Linked Data in Production: Moving Beyond OntologiesLinked Data in Production: Moving Beyond Ontologies
Linked Data in Production: Moving Beyond Ontologies
 
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve DecarbonizationUsing IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
 
IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019
IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019
IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019
 
Things you didn't know you can use in your Salesforce
Things you didn't know you can use in your SalesforceThings you didn't know you can use in your Salesforce
Things you didn't know you can use in your Salesforce
 
Babel Compiler - Transforming JavaScript for All Browsers.pptx
Babel Compiler - Transforming JavaScript for All Browsers.pptxBabel Compiler - Transforming JavaScript for All Browsers.pptx
Babel Compiler - Transforming JavaScript for All Browsers.pptx
 
Artificial Intelligence & SEO Trends for 2024
Artificial Intelligence & SEO Trends for 2024Artificial Intelligence & SEO Trends for 2024
Artificial Intelligence & SEO Trends for 2024
 
COMPUTER 10: Lesson 7 - File Storage and Online Collaboration
COMPUTER 10: Lesson 7 - File Storage and Online CollaborationCOMPUTER 10: Lesson 7 - File Storage and Online Collaboration
COMPUTER 10: Lesson 7 - File Storage and Online Collaboration
 
Nanopower In Semiconductor Industry.pdf
Nanopower  In Semiconductor Industry.pdfNanopower  In Semiconductor Industry.pdf
Nanopower In Semiconductor Industry.pdf
 
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
 
Digital magic. A small project for controlling smart light bulbs.
Digital magic. A small project for controlling smart light bulbs.Digital magic. A small project for controlling smart light bulbs.
Digital magic. A small project for controlling smart light bulbs.
 
20200723_insight_release_plan_v6.pdf20200723_insight_release_plan_v6.pdf
20200723_insight_release_plan_v6.pdf20200723_insight_release_plan_v6.pdf20200723_insight_release_plan_v6.pdf20200723_insight_release_plan_v6.pdf
20200723_insight_release_plan_v6.pdf20200723_insight_release_plan_v6.pdf
 
Cloud Revolution: Exploring the New Wave of Serverless Spatial Data
Cloud Revolution: Exploring the New Wave of Serverless Spatial DataCloud Revolution: Exploring the New Wave of Serverless Spatial Data
Cloud Revolution: Exploring the New Wave of Serverless Spatial Data
 
UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1
 
9 Steps For Building Winning Founding Team
9 Steps For Building Winning Founding Team9 Steps For Building Winning Founding Team
9 Steps For Building Winning Founding Team
 
Secure your environment with UiPath and CyberArk technologies - Session 1
Secure your environment with UiPath and CyberArk technologies - Session 1Secure your environment with UiPath and CyberArk technologies - Session 1
Secure your environment with UiPath and CyberArk technologies - Session 1
 
Computer 10: Lesson 10 - Online Crimes and Hazards
Computer 10: Lesson 10 - Online Crimes and HazardsComputer 10: Lesson 10 - Online Crimes and Hazards
Computer 10: Lesson 10 - Online Crimes and Hazards
 
Designing A Time bound resource download URL
Designing A Time bound resource download URLDesigning A Time bound resource download URL
Designing A Time bound resource download URL
 
Machine Learning Model Validation (Aijun Zhang 2024).pdf
Machine Learning Model Validation (Aijun Zhang 2024).pdfMachine Learning Model Validation (Aijun Zhang 2024).pdf
Machine Learning Model Validation (Aijun Zhang 2024).pdf
 

Automated testing overview

  • 2. Summary • Why do we need software testing • Software testing definition • Types of testing • Why do we need automated testing • Unit testing for simple objects • Unit testing for objects that have dependencies • Automated testing for user interface
  • 3. Why do we need software testing • To reduce operating costs : software bugs are a big cost for the business; • To protect company reputation : software quality is a key requirement of any new project; • any developer will do some kind of testing before delivering the software to the client; • software testing is a core activity associated with the development process;
  • 4. Software testing definition • Definition: Software testing is an investigation conducted to provide stakeholders with information about the quality of the product or service under test; • software testing verifies and validates that the software deliverable: – meets the business and technical requirements that guided its design and development; – works as expected;
  • 5. Types of testing • system testing : exercises the application end to end. Based on specifications and executed using tests scripts as part of a test plan. • integration testing : targets parts of the application e.g. the service layer; • unit testing : tests individual code units : e.g. classes.
  • 6. Cost of software bugs Cost to fix a defect Time detected Requirem ents Architectu re Constructi on System test After release Time introd uced Requirement s 1x 3x 5-10x 10x 10-100x Architecture - 1x 10x 15x 25-100x Construction - - 1x 10x 10-25x • the cost of removing a software bug is linked to the development stage the software bug is found;
  • 7. Difficulties of software testing • It is a lengthy process and can happen only after the alpha stage of the application; • Constant retesting : After each release we need to test new features and retest existing ones - even if the changes affect only a part of the application we can never be sure that the rest of the application is unaffected; • Usually the full test plan is applied right at the end of the delivery cycle : regression errors or unexpected errors can be detected too close to final delivery - they can affect the delivery schedule;
  • 8. Solution: automated tests • Automate the test plan right from the beginning of the development cycle : the developer can now exercise the application before is deployed to testing; • System testing will always have a manual part but can be also comprised of automated tests that can cover a lot of scenarios • Use unit testing and integration testing extensively as they can be automated with minimal costs;
  • 9. Why do we need automated testing • TIME - speed up the delivery schedule : the test window is reduced and testers can concentrate more on exploratory testing and test cases that cannot be automated; • COST - reduce the number of bugs : bugs can be detected before a deployment is made and regression issues are reduced significantly; • SCOPE - reduce the amount of rework and make scope changes cheap: the testers, business analysts and developers will start from test scenarios first that will increase the product knowledge right from the start;
  • 10. How to implement automated tests • The application need to be testable; • System testing : coded ui tests using an automation framework or using record and replay tools; • Integrations tests : inject data that is used to exercise the application layers for specific scenarios; • Unit testing : they are code only tests so they don’t have an impact on external systems and their dependencies
  • 12. What is a unit test • Can I run and get results from a unit test I wrote two weeks or even months or years ago? • Can any member of my team run and get the results from unit tests I wrote two months ago? • Can I run all the unit tests I’ve written in no more than a few minutes? • Can I run all the unit tests I’ve written at the push of a button? • Can I write a basic unit test in no more than a few minutes?
  • 13. Properties of a good unit test • It should be automated and repeatable. • It should be easy to implement. • Once it’s written, it should remain for future use. • Anyone should be able to run it. • It should run at the push of a button. • It should run quickly.
  • 14. Styles of writing unit tests • write production code first then unit tests; • test driven development(TDD): write the unit tests first then production code; • behaviour driven development(BDD): start from user stories and decompose them in scenarios then write code to validate the scenarios
  • 15. Unit testing naming conventions used in examples Object to be tested Object to create on the testing side Project Create a test project named [ProjectUnderTest].Tests. Class For each class, create at least one class with the name [ClassName]Tests. Method For each method, create at least one test method with the following name: [MethodName]_[StateUnderTest]_[ExpectedBehavior] .
  • 17. Unit testing framework - MsTest • Automates unit testing; • Provides an intuitive easy to use interface; • Generates output that can be used by the continuous integration process; • to write a unit test you just need to use – two attributes [TestClass], [TestMethod]; – a static function call Assert that validates the test;
  • 19. Unit testing classes that have dependencies
  • 20. Example 2 LegacyLogAnalyser • Requirements: – create a class that analyses a log file; – if the log file is invalid call a webservice and log the problem; – if an error is encountered send an email to an administrator;
  • 21. Controlling dependencies • identify dependencies; • isolate them by introducing interfaces; • this process is referred to as making the class under test testable; • during test replace interfaces with objects that you can control(replace the dependency with a fake); • this process is referred to as mocking the dependencies;
  • 23. Mocking framework – Rhino.Mocks • a mocking framework facilitates the generation of fakes; • there are two main types of unit testing; – state-based unit testing; – interaction-based unit testing; • there are two type of fakes to match the two types of unit testing: stub and mock; • Rhino.Mocks is the most widely used open source framework; • MockReposity.GenerateStub<T> and MockReposity.GenerateMock<T> are the methods used to generate fakes;
  • 25. Conclusion • Defined the place of unit testing in the wider context of software testing; • Defined properties of a good unit test; • Introduction to an unit testing framework; • Discussed about the need to isolate and control dependencies during testing; • Introduction to a mocking framework.

Notas do Editor

  1. Depending on the type of industry software testing has a different importance but in the last decade the quality of the software has increased dramatically while the delivery cycle was reduced considerably; At Microsoft a team of 20 developers will have a team of 20 testers;
  2. types of testing based on the testing method: black box testing: a method that tests the functionality of an application as opposed to its internal structures or workings. Test cases are built around specifications and requirements; white box testing: a method that tests internal structures or workings of an application as opposed to its functionality. The tester chooses inputs to exercise paths through the code and determine the appropriate output. types of testing based on the level of specificity: system testing: tests a completely integrated system to verify that it meets its requirements. UI software testing Usability testing Performance testing Compatibility testing Regression testin g integration testing: verifies the interfaces between components against a software design. Testing two or more dependent software modules as a group. unit testing: verifies the functionality of a specific section of code, usually at the function level. In an object-oriented environment, this is usually at the class level.
  3. McConnell, Steve (2004). Code Complete 2nd Ed ) bugs introduced in construction are costly to be fixed;
  4. Revised definition: A unit test is an automated piece of code that invokes the method or class being tested and then checks some assumptions about the logical behavior of that method or class. A unit test is almost always written using a unit-testing framework. It can be written easily and runs quickly. It’s fully automated, trustworthy, readable, and maintainable.
  5. Waterfall vs agile development; BDD: If all scenarios associated with a user story are successfully validated we can say that the user story has met the acceptance criteria.
  6. An external dependency is an object in your system that your code under test interacts with, and over which you have no control. (Common examples are filesystems, threads, memory, time, and so on.) A stub is a controllable replacement for an existing dependency (or collaborator) in the system. By using a stub, you can test your code without dealing with the dependency directly.
  7. S tate-based testing (also called state verification) determines whether the exercised method worked correctly by examining the state of the system under test and its collaborators (dependencies) after the method is exercised. Interaction testing is testing how an object sends input to or receives input from other objects—how that object interacts with other objects. ( action-driven testing)