SlideShare une entreprise Scribd logo
1  sur  21
Télécharger pour lire hors ligne
Unit Tests & Automated Testing Lee Englestone presents.. www.manchesterdeveloper.com
Agenda Terminology What, Why, How Automating unit tests & testing Advanced stuff Test driven development (TDD) Code coverage What we wont be covering Continuous Integration (in any depth)
Terminology (for the next hour) Unit test Tests a small bit of code (from code) Integration test Test after addition of code System test / functional test Test for adherence to user requirements  Regression test Test that fixing / adding code hasn’t introduced bugs Continuous integration Automated checkout, building and testing of code from source control Source : Lee & Wikipedia
Why should we TEST? Why should we test at all? £ £ REMEMBER Testing is just one step in QA £ £ £ £ £
Testing different layers Business Logic Unit Tests Web UI Selenium
Three tier architecture Web UI ASPX, ASCX, HTML, Flash, EpiServer Page Templates etc Business Logic Code libraries (DLLs) Business Logic (DLL) Database access Data Access Layer
Testing business logic Code libraries (DLLs) Business Logic (DLL) Unit Tests (DLL) Unit Tests (DLLs) Database access Data Access Layer
Why have unit tests? Why have unit tests? Find bugs early / fast feedback Increase QA Why not to have unit tests Increases development time? CostOfWritingUnitTests  <  Sum(BugFixing)
Unit Testing  is not a Silver Bullet
What is a unit test? “..tests if individual units of source code are fit for use.” Should be Small Specific (only test 1 thing) Clear pass / fail criteria
What does a unit test look like?  Using NUnit.Framework; [TestFixture] public class CarTests { 	[Test] 	public void Test_Car_Paint ()  	{ 		// Arrange Color paint = Color.Red; 		Car car = new Car(); 		// Act car.paint(Color.Red); 	// Assert Assert.AreEqual(car.Color, paint); 	} 	… } Arrange Act Assert
Example unit test : Running Running unit tests manually with NUnit
An example scenario { Code Example } Objects Car Properties ColorColor double Value double FuelLevel double FuelCapacity FuelTypeEnumFuelType Methods Car.Crush() Car.Paint(Color) Car.AddFuel(FuelTypeEnum, double) Car.VeryImportantMethod()
Automating unit testing
Testing Web UI (Selenium) What if we want to test the UI?  Manual recording and running Can export to NUnit Examples :  Community Fund Form H1 checking** { Code Example }
Test driven development (TDD) Write your tests, even BEFORE your code! Make sure all tests initially fail Then implement the code that the tests are testing (Encourages Designing for Testing)
Code coverage What % of your code base are you testing?
Summary	 Test as early as possible Design code to test Separate BL from UI Improve QA Make unit tests part of CI
Appendixes Wikipedia testing definitions
Testing Terminology (Wikipedia) Unit test “..a programmer tests if individual units of source code are fit for use.” Integration test “..individual software modules are combined and tested as a group. It occurs after unit testing and before system testing.” System test / functional test “..testing conducted on a complete, integrated system to evaluate the system's compliance with its specified requirements.  Regression test “..seeks to uncover software errors by partially retesting a modified program. The intent of regression testing is to assure that a bug fix has been successfully corrected .. , while providing a general assurance that no other errors were introduced in the process of fixing the original problem.” Continuous integration Automated checkout, building and testing of code from source control Source : Wikipedia

Contenu connexe

Tendances

Understanding Unit Testing
Understanding Unit TestingUnderstanding Unit Testing
Understanding Unit Testingikhwanhayat
 
Basic software-testing-concepts
Basic software-testing-conceptsBasic software-testing-concepts
Basic software-testing-conceptsmedsherb
 
Automation Testing using Selenium
Automation Testing using SeleniumAutomation Testing using Selenium
Automation Testing using SeleniumNaresh Chintalcheru
 
Unit testing & TDD concepts with best practice guidelines.
Unit testing & TDD concepts with best practice guidelines.Unit testing & TDD concepts with best practice guidelines.
Unit testing & TDD concepts with best practice guidelines.Mohamed Taman
 
Agile QA presentation
Agile QA presentationAgile QA presentation
Agile QA presentationCarl Bruiners
 
JUnit- A Unit Testing Framework
JUnit- A Unit Testing FrameworkJUnit- A Unit Testing Framework
JUnit- A Unit Testing FrameworkOnkar Deshpande
 
Test Automation Framework Design | www.idexcel.com
Test Automation Framework Design | www.idexcel.comTest Automation Framework Design | www.idexcel.com
Test Automation Framework Design | www.idexcel.comIdexcel Technologies
 
TDD (Test Driven Design)
TDD (Test Driven Design)TDD (Test Driven Design)
TDD (Test Driven Design)nedirtv
 
UNIT TESTING PPT
UNIT TESTING PPTUNIT TESTING PPT
UNIT TESTING PPTsuhasreddy1
 
Testing strategy for agile projects updated
Testing strategy for agile projects updatedTesting strategy for agile projects updated
Testing strategy for agile projects updatedTharinda Liyanage
 

Tendances (20)

Understanding Unit Testing
Understanding Unit TestingUnderstanding Unit Testing
Understanding Unit Testing
 
Unit Testing (C#)
Unit Testing (C#)Unit Testing (C#)
Unit Testing (C#)
 
Unit Testing
Unit TestingUnit Testing
Unit Testing
 
Agile testing
Agile testingAgile testing
Agile testing
 
Basic software-testing-concepts
Basic software-testing-conceptsBasic software-testing-concepts
Basic software-testing-concepts
 
Automation Testing using Selenium
Automation Testing using SeleniumAutomation Testing using Selenium
Automation Testing using Selenium
 
Unit testing & TDD concepts with best practice guidelines.
Unit testing & TDD concepts with best practice guidelines.Unit testing & TDD concepts with best practice guidelines.
Unit testing & TDD concepts with best practice guidelines.
 
Agile QA presentation
Agile QA presentationAgile QA presentation
Agile QA presentation
 
JUnit- A Unit Testing Framework
JUnit- A Unit Testing FrameworkJUnit- A Unit Testing Framework
JUnit- A Unit Testing Framework
 
Junit
JunitJunit
Junit
 
JUnit Presentation
JUnit PresentationJUnit Presentation
JUnit Presentation
 
JUNit Presentation
JUNit PresentationJUNit Presentation
JUNit Presentation
 
Automation testing
Automation testingAutomation testing
Automation testing
 
Test Automation Framework Design | www.idexcel.com
Test Automation Framework Design | www.idexcel.comTest Automation Framework Design | www.idexcel.com
Test Automation Framework Design | www.idexcel.com
 
TDD (Test Driven Design)
TDD (Test Driven Design)TDD (Test Driven Design)
TDD (Test Driven Design)
 
UNIT TESTING PPT
UNIT TESTING PPTUNIT TESTING PPT
UNIT TESTING PPT
 
Java Unit Testing
Java Unit TestingJava Unit Testing
Java Unit Testing
 
Testing strategy for agile projects updated
Testing strategy for agile projects updatedTesting strategy for agile projects updated
Testing strategy for agile projects updated
 
Automation Testing
Automation TestingAutomation Testing
Automation Testing
 
Unit testing
Unit testingUnit testing
Unit testing
 

En vedette

Automated Unit Testing
Automated Unit Testing Automated Unit Testing
Automated Unit Testing Simon Boorsma
 
Unit tests for dummies
Unit tests for dummiesUnit tests for dummies
Unit tests for dummiescpsitgmbh
 
Unit testing best practices
Unit testing best practicesUnit testing best practices
Unit testing best practicesnickokiss
 
Introduction to Test Automation
Introduction to Test AutomationIntroduction to Test Automation
Introduction to Test AutomationPekka Klärck
 
Using evolutionary testing to improve efficiency and quality
Using evolutionary testing to improve efficiency and qualityUsing evolutionary testing to improve efficiency and quality
Using evolutionary testing to improve efficiency and qualityFaysal Ahmed
 
Test automation: the ROI myth
Test automation: the ROI mythTest automation: the ROI myth
Test automation: the ROI mythGilles Mantel
 
Automated Web Testing and Open Source Tools
Automated Web Testing and Open Source ToolsAutomated Web Testing and Open Source Tools
Automated Web Testing and Open Source ToolsHank Huang
 
자라나는 소프트웨어
자라나는 소프트웨어자라나는 소프트웨어
자라나는 소프트웨어jongbhin
 
Managing Projects With HomeSpot
Managing Projects With HomeSpotManaging Projects With HomeSpot
Managing Projects With HomeSpotDerek Smith
 
Robot Chickens! How a Netduino runs our backyard chicken coop
Robot Chickens!  How a Netduino runs our backyard chicken coopRobot Chickens!  How a Netduino runs our backyard chicken coop
Robot Chickens! How a Netduino runs our backyard chicken coopDerek Smith
 
Building data driven mobile apps with phone gap and webapi
Building data driven mobile apps with phone gap and webapiBuilding data driven mobile apps with phone gap and webapi
Building data driven mobile apps with phone gap and webapiDerek Smith
 
What's New in ASP.NET Identity - TRINUG Sept 2014
What's New in ASP.NET Identity - TRINUG Sept 2014What's New in ASP.NET Identity - TRINUG Sept 2014
What's New in ASP.NET Identity - TRINUG Sept 2014Derek Smith
 
Automated Testing Tools for Desktop, Web and Mobile Software
Automated Testing Tools for Desktop, Web and Mobile SoftwareAutomated Testing Tools for Desktop, Web and Mobile Software
Automated Testing Tools for Desktop, Web and Mobile SoftwareRanorex
 
Automation roi microsoft e4 d event
Automation roi microsoft e4 d eventAutomation roi microsoft e4 d event
Automation roi microsoft e4 d eventEyal Vardi
 
sql introduction
sql introductionsql introduction
sql introductioneleksdev
 
#1 unit testing
#1 unit testing#1 unit testing
#1 unit testingeleksdev
 
Automated Testing with Agile
Automated Testing with AgileAutomated Testing with Agile
Automated Testing with AgileKen McCorkell
 
Code Coverage in Theory and in practice form the DO178B perspective
Code Coverage in Theory and in practice form the DO178B perspective   Code Coverage in Theory and in practice form the DO178B perspective
Code Coverage in Theory and in practice form the DO178B perspective Engineering Software Lab
 

En vedette (19)

Automated Unit Testing
Automated Unit Testing Automated Unit Testing
Automated Unit Testing
 
Unit tests for dummies
Unit tests for dummiesUnit tests for dummies
Unit tests for dummies
 
Unit testing with JUnit
Unit testing with JUnitUnit testing with JUnit
Unit testing with JUnit
 
Unit testing best practices
Unit testing best practicesUnit testing best practices
Unit testing best practices
 
Introduction to Test Automation
Introduction to Test AutomationIntroduction to Test Automation
Introduction to Test Automation
 
Using evolutionary testing to improve efficiency and quality
Using evolutionary testing to improve efficiency and qualityUsing evolutionary testing to improve efficiency and quality
Using evolutionary testing to improve efficiency and quality
 
Test automation: the ROI myth
Test automation: the ROI mythTest automation: the ROI myth
Test automation: the ROI myth
 
Automated Web Testing and Open Source Tools
Automated Web Testing and Open Source ToolsAutomated Web Testing and Open Source Tools
Automated Web Testing and Open Source Tools
 
자라나는 소프트웨어
자라나는 소프트웨어자라나는 소프트웨어
자라나는 소프트웨어
 
Managing Projects With HomeSpot
Managing Projects With HomeSpotManaging Projects With HomeSpot
Managing Projects With HomeSpot
 
Robot Chickens! How a Netduino runs our backyard chicken coop
Robot Chickens!  How a Netduino runs our backyard chicken coopRobot Chickens!  How a Netduino runs our backyard chicken coop
Robot Chickens! How a Netduino runs our backyard chicken coop
 
Building data driven mobile apps with phone gap and webapi
Building data driven mobile apps with phone gap and webapiBuilding data driven mobile apps with phone gap and webapi
Building data driven mobile apps with phone gap and webapi
 
What's New in ASP.NET Identity - TRINUG Sept 2014
What's New in ASP.NET Identity - TRINUG Sept 2014What's New in ASP.NET Identity - TRINUG Sept 2014
What's New in ASP.NET Identity - TRINUG Sept 2014
 
Automated Testing Tools for Desktop, Web and Mobile Software
Automated Testing Tools for Desktop, Web and Mobile SoftwareAutomated Testing Tools for Desktop, Web and Mobile Software
Automated Testing Tools for Desktop, Web and Mobile Software
 
Automation roi microsoft e4 d event
Automation roi microsoft e4 d eventAutomation roi microsoft e4 d event
Automation roi microsoft e4 d event
 
sql introduction
sql introductionsql introduction
sql introduction
 
#1 unit testing
#1 unit testing#1 unit testing
#1 unit testing
 
Automated Testing with Agile
Automated Testing with AgileAutomated Testing with Agile
Automated Testing with Agile
 
Code Coverage in Theory and in practice form the DO178B perspective
Code Coverage in Theory and in practice form the DO178B perspective   Code Coverage in Theory and in practice form the DO178B perspective
Code Coverage in Theory and in practice form the DO178B perspective
 

Similaire à Unit Tests And Automated Testing

Automated Testing vs Manual Testing
Automated Testing vs Manual TestingAutomated Testing vs Manual Testing
Automated Testing vs Manual TestingDirecti Group
 
Automated+Testing+Vs+Manual+Testing
Automated+Testing+Vs+Manual+TestingAutomated+Testing+Vs+Manual+Testing
Automated+Testing+Vs+Manual+Testinggueste1e4db
 
Automated Testing vs Manual Testing
Automated Testing vs Manual TestingAutomated Testing vs Manual Testing
Automated Testing vs Manual Testingdidev
 
Mohammed Kharma-A flexible framework for quality assurance and testing of sof...
Mohammed Kharma-A flexible framework for quality assurance and testing of sof...Mohammed Kharma-A flexible framework for quality assurance and testing of sof...
Mohammed Kharma-A flexible framework for quality assurance and testing of sof...Mohammed Kharma
 
Lap Around Visual Studio 2010 Ultimate And TFS 2010
Lap Around Visual Studio 2010 Ultimate And TFS 2010Lap Around Visual Studio 2010 Ultimate And TFS 2010
Lap Around Visual Studio 2010 Ultimate And TFS 2010Ed Blankenship
 
Regression Testing with Symfony
Regression Testing with SymfonyRegression Testing with Symfony
Regression Testing with SymfonyJoachim Unger
 
12 Rational Solo Pruebas 2009
12 Rational Solo Pruebas 200912 Rational Solo Pruebas 2009
12 Rational Solo Pruebas 2009Pepe
 
Microsoft Stack Visual Studio 2010 Overview
Microsoft  Stack   Visual Studio 2010 OverviewMicrosoft  Stack   Visual Studio 2010 Overview
Microsoft Stack Visual Studio 2010 Overviewrfennell
 
Unit testing and test driven development using vs
Unit testing and test driven development using vsUnit testing and test driven development using vs
Unit testing and test driven development using vsAbhimanyu Singhal
 
Stepin evening presented
Stepin evening presentedStepin evening presented
Stepin evening presentedVijayan Reddy
 
Unit testing, UI testing and Test Driven Development in Visual Studio 2012
Unit testing, UI testing and Test Driven Development in Visual Studio 2012Unit testing, UI testing and Test Driven Development in Visual Studio 2012
Unit testing, UI testing and Test Driven Development in Visual Studio 2012Jacinto Limjap
 
Justmeans power point
Justmeans power pointJustmeans power point
Justmeans power pointjustmeanscsr
 
Whats New In 2010 (Msdn & Visual Studio)
Whats New In 2010 (Msdn & Visual Studio)Whats New In 2010 (Msdn & Visual Studio)
Whats New In 2010 (Msdn & Visual Studio)Steve Lange
 
No More No Repro
No More No ReproNo More No Repro
No More No ReproAnna Russo
 
The Magic Of Application Lifecycle Management In Vs Public
The Magic Of Application Lifecycle Management In Vs PublicThe Magic Of Application Lifecycle Management In Vs Public
The Magic Of Application Lifecycle Management In Vs PublicDavid Solivan
 
Ukfs Snr Dev Arch Forum Pres3 Re
Ukfs Snr Dev Arch Forum Pres3 ReUkfs Snr Dev Arch Forum Pres3 Re
Ukfs Snr Dev Arch Forum Pres3 ReAllyWick
 
Testes? Mas isso não aumenta o tempo de projecto? Não quero...
Testes? Mas isso não aumenta o tempo de projecto? Não quero...Testes? Mas isso não aumenta o tempo de projecto? Não quero...
Testes? Mas isso não aumenta o tempo de projecto? Não quero...Comunidade NetPonto
 

Similaire à Unit Tests And Automated Testing (20)

Automated Testing vs Manual Testing
Automated Testing vs Manual TestingAutomated Testing vs Manual Testing
Automated Testing vs Manual Testing
 
Automated+Testing+Vs+Manual+Testing
Automated+Testing+Vs+Manual+TestingAutomated+Testing+Vs+Manual+Testing
Automated+Testing+Vs+Manual+Testing
 
Automated Testing vs Manual Testing
Automated Testing vs Manual TestingAutomated Testing vs Manual Testing
Automated Testing vs Manual Testing
 
Mohammed Kharma-A flexible framework for quality assurance and testing of sof...
Mohammed Kharma-A flexible framework for quality assurance and testing of sof...Mohammed Kharma-A flexible framework for quality assurance and testing of sof...
Mohammed Kharma-A flexible framework for quality assurance and testing of sof...
 
Vsts 2
Vsts 2Vsts 2
Vsts 2
 
Lap Around Visual Studio 2010 Ultimate And TFS 2010
Lap Around Visual Studio 2010 Ultimate And TFS 2010Lap Around Visual Studio 2010 Ultimate And TFS 2010
Lap Around Visual Studio 2010 Ultimate And TFS 2010
 
Regression Testing with Symfony
Regression Testing with SymfonyRegression Testing with Symfony
Regression Testing with Symfony
 
12 Rational Solo Pruebas 2009
12 Rational Solo Pruebas 200912 Rational Solo Pruebas 2009
12 Rational Solo Pruebas 2009
 
Microsoft Stack Visual Studio 2010 Overview
Microsoft  Stack   Visual Studio 2010 OverviewMicrosoft  Stack   Visual Studio 2010 Overview
Microsoft Stack Visual Studio 2010 Overview
 
Coding Naked
Coding NakedCoding Naked
Coding Naked
 
Unit testing and test driven development using vs
Unit testing and test driven development using vsUnit testing and test driven development using vs
Unit testing and test driven development using vs
 
TDD - Agile
TDD - Agile TDD - Agile
TDD - Agile
 
Stepin evening presented
Stepin evening presentedStepin evening presented
Stepin evening presented
 
Unit testing, UI testing and Test Driven Development in Visual Studio 2012
Unit testing, UI testing and Test Driven Development in Visual Studio 2012Unit testing, UI testing and Test Driven Development in Visual Studio 2012
Unit testing, UI testing and Test Driven Development in Visual Studio 2012
 
Justmeans power point
Justmeans power pointJustmeans power point
Justmeans power point
 
Whats New In 2010 (Msdn & Visual Studio)
Whats New In 2010 (Msdn & Visual Studio)Whats New In 2010 (Msdn & Visual Studio)
Whats New In 2010 (Msdn & Visual Studio)
 
No More No Repro
No More No ReproNo More No Repro
No More No Repro
 
The Magic Of Application Lifecycle Management In Vs Public
The Magic Of Application Lifecycle Management In Vs PublicThe Magic Of Application Lifecycle Management In Vs Public
The Magic Of Application Lifecycle Management In Vs Public
 
Ukfs Snr Dev Arch Forum Pres3 Re
Ukfs Snr Dev Arch Forum Pres3 ReUkfs Snr Dev Arch Forum Pres3 Re
Ukfs Snr Dev Arch Forum Pres3 Re
 
Testes? Mas isso não aumenta o tempo de projecto? Não quero...
Testes? Mas isso não aumenta o tempo de projecto? Não quero...Testes? Mas isso não aumenta o tempo de projecto? Não quero...
Testes? Mas isso não aumenta o tempo de projecto? Não quero...
 

Plus de Lee Englestone

Augmented Reality On iOS With ARKit Xamarin and C#
Augmented Reality On iOS With ARKit Xamarin and C#Augmented Reality On iOS With ARKit Xamarin and C#
Augmented Reality On iOS With ARKit Xamarin and C#Lee Englestone
 
Reinventing Education Hackathon - LeARn
Reinventing Education Hackathon - LeARnReinventing Education Hackathon - LeARn
Reinventing Education Hackathon - LeARnLee Englestone
 
.NET Foundation website suggestions for improvement
.NET Foundation website suggestions for improvement.NET Foundation website suggestions for improvement
.NET Foundation website suggestions for improvementLee Englestone
 
25 Tips for Visual Studio
25 Tips for Visual Studio25 Tips for Visual Studio
25 Tips for Visual StudioLee Englestone
 
Tweet From Every Country Barcamp Manchester
Tweet From Every Country Barcamp ManchesterTweet From Every Country Barcamp Manchester
Tweet From Every Country Barcamp ManchesterLee Englestone
 
Organisational Learning
Organisational LearningOrganisational Learning
Organisational LearningLee Englestone
 
Familee bootstrapped-biz
Familee bootstrapped-bizFamilee bootstrapped-biz
Familee bootstrapped-bizLee Englestone
 
Visual Studio 2010 and ASP.Net 4
Visual Studio 2010 and ASP.Net 4Visual Studio 2010 and ASP.Net 4
Visual Studio 2010 and ASP.Net 4Lee Englestone
 

Plus de Lee Englestone (12)

Introduction to C#
Introduction to C#Introduction to C#
Introduction to C#
 
Augmented Reality On iOS With ARKit Xamarin and C#
Augmented Reality On iOS With ARKit Xamarin and C#Augmented Reality On iOS With ARKit Xamarin and C#
Augmented Reality On iOS With ARKit Xamarin and C#
 
Reinventing Education Hackathon - LeARn
Reinventing Education Hackathon - LeARnReinventing Education Hackathon - LeARn
Reinventing Education Hackathon - LeARn
 
.NET Foundation website suggestions for improvement
.NET Foundation website suggestions for improvement.NET Foundation website suggestions for improvement
.NET Foundation website suggestions for improvement
 
25 Tips for Visual Studio
25 Tips for Visual Studio25 Tips for Visual Studio
25 Tips for Visual Studio
 
Tweet From Every Country Barcamp Manchester
Tweet From Every Country Barcamp ManchesterTweet From Every Country Barcamp Manchester
Tweet From Every Country Barcamp Manchester
 
Organisational Learning
Organisational LearningOrganisational Learning
Organisational Learning
 
Lincoln Hack 2018
Lincoln Hack 2018Lincoln Hack 2018
Lincoln Hack 2018
 
MVC Training Part 2
MVC Training Part 2MVC Training Part 2
MVC Training Part 2
 
MVC Training Part 1
MVC Training Part 1MVC Training Part 1
MVC Training Part 1
 
Familee bootstrapped-biz
Familee bootstrapped-bizFamilee bootstrapped-biz
Familee bootstrapped-biz
 
Visual Studio 2010 and ASP.Net 4
Visual Studio 2010 and ASP.Net 4Visual Studio 2010 and ASP.Net 4
Visual Studio 2010 and ASP.Net 4
 

Dernier

Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfNeo4j
 
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security ObservabilityGlenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security Observabilityitnewsafrica
 
Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...itnewsafrica
 
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...itnewsafrica
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI AgeCprime
 
A Glance At The Java Performance Toolbox
A Glance At The Java Performance ToolboxA Glance At The Java Performance Toolbox
A Glance At The Java Performance ToolboxAna-Maria Mihalceanu
 
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...Jeffrey Haguewood
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Mark Goldstein
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 
Infrared simulation and processing on Nvidia platforms
Infrared simulation and processing on Nvidia platformsInfrared simulation and processing on Nvidia platforms
Infrared simulation and processing on Nvidia platformsYoss Cohen
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfpanagenda
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterMydbops
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Strongerpanagenda
 
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS:  6 Ways to Automate Your Data IntegrationBridging Between CAD & GIS:  6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integrationmarketing932765
 
Landscape Catalogue 2024 Australia-1.pdf
Landscape Catalogue 2024 Australia-1.pdfLandscape Catalogue 2024 Australia-1.pdf
Landscape Catalogue 2024 Australia-1.pdfAarwolf Industries LLC
 
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxGenerative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxfnnc6jmgwh
 
QCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesQCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesBernd Ruecker
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 

Dernier (20)

Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdf
 
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security ObservabilityGlenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
 
Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...
 
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI Age
 
A Glance At The Java Performance Toolbox
A Glance At The Java Performance ToolboxA Glance At The Java Performance Toolbox
A Glance At The Java Performance Toolbox
 
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 
Infrared simulation and processing on Nvidia platforms
Infrared simulation and processing on Nvidia platformsInfrared simulation and processing on Nvidia platforms
Infrared simulation and processing on Nvidia platforms
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL Router
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
 
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS:  6 Ways to Automate Your Data IntegrationBridging Between CAD & GIS:  6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
 
Landscape Catalogue 2024 Australia-1.pdf
Landscape Catalogue 2024 Australia-1.pdfLandscape Catalogue 2024 Australia-1.pdf
Landscape Catalogue 2024 Australia-1.pdf
 
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxGenerative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
 
QCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesQCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architectures
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 

Unit Tests And Automated Testing

  • 1. Unit Tests & Automated Testing Lee Englestone presents.. www.manchesterdeveloper.com
  • 2. Agenda Terminology What, Why, How Automating unit tests & testing Advanced stuff Test driven development (TDD) Code coverage What we wont be covering Continuous Integration (in any depth)
  • 3. Terminology (for the next hour) Unit test Tests a small bit of code (from code) Integration test Test after addition of code System test / functional test Test for adherence to user requirements Regression test Test that fixing / adding code hasn’t introduced bugs Continuous integration Automated checkout, building and testing of code from source control Source : Lee & Wikipedia
  • 4. Why should we TEST? Why should we test at all? £ £ REMEMBER Testing is just one step in QA £ £ £ £ £
  • 5. Testing different layers Business Logic Unit Tests Web UI Selenium
  • 6. Three tier architecture Web UI ASPX, ASCX, HTML, Flash, EpiServer Page Templates etc Business Logic Code libraries (DLLs) Business Logic (DLL) Database access Data Access Layer
  • 7. Testing business logic Code libraries (DLLs) Business Logic (DLL) Unit Tests (DLL) Unit Tests (DLLs) Database access Data Access Layer
  • 8. Why have unit tests? Why have unit tests? Find bugs early / fast feedback Increase QA Why not to have unit tests Increases development time? CostOfWritingUnitTests < Sum(BugFixing)
  • 9. Unit Testing is not a Silver Bullet
  • 10. What is a unit test? “..tests if individual units of source code are fit for use.” Should be Small Specific (only test 1 thing) Clear pass / fail criteria
  • 11. What does a unit test look like? Using NUnit.Framework; [TestFixture] public class CarTests { [Test] public void Test_Car_Paint () { // Arrange Color paint = Color.Red; Car car = new Car(); // Act car.paint(Color.Red); // Assert Assert.AreEqual(car.Color, paint); } … } Arrange Act Assert
  • 12. Example unit test : Running Running unit tests manually with NUnit
  • 13. An example scenario { Code Example } Objects Car Properties ColorColor double Value double FuelLevel double FuelCapacity FuelTypeEnumFuelType Methods Car.Crush() Car.Paint(Color) Car.AddFuel(FuelTypeEnum, double) Car.VeryImportantMethod()
  • 15. Testing Web UI (Selenium) What if we want to test the UI? Manual recording and running Can export to NUnit Examples : Community Fund Form H1 checking** { Code Example }
  • 16. Test driven development (TDD) Write your tests, even BEFORE your code! Make sure all tests initially fail Then implement the code that the tests are testing (Encourages Designing for Testing)
  • 17. Code coverage What % of your code base are you testing?
  • 18. Summary Test as early as possible Design code to test Separate BL from UI Improve QA Make unit tests part of CI
  • 19.
  • 21. Testing Terminology (Wikipedia) Unit test “..a programmer tests if individual units of source code are fit for use.” Integration test “..individual software modules are combined and tested as a group. It occurs after unit testing and before system testing.” System test / functional test “..testing conducted on a complete, integrated system to evaluate the system's compliance with its specified requirements. Regression test “..seeks to uncover software errors by partially retesting a modified program. The intent of regression testing is to assure that a bug fix has been successfully corrected .. , while providing a general assurance that no other errors were introduced in the process of fixing the original problem.” Continuous integration Automated checkout, building and testing of code from source control Source : Wikipedia

Notes de l'éditeur

  1. There are no silver bullets in development.Developers have are there disposal an arsenal tools, and they must be used in the right way to fit company processes