SlideShare a Scribd company logo
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

More Related Content

What's hot

Unit Test Presentation
Unit Test PresentationUnit Test Presentation
Unit Test PresentationSayedur Rahman
 
UNIT TESTING PPT
UNIT TESTING PPTUNIT TESTING PPT
UNIT TESTING PPTsuhasreddy1
 
Types of test tools
Types of test toolsTypes of test tools
Types of test toolsVaibhav Dash
 
Unit testing best practices
Unit testing best practicesUnit testing best practices
Unit testing best practicesnickokiss
 
Test Automation Framework Designs
Test Automation Framework DesignsTest Automation Framework Designs
Test Automation Framework DesignsSauce Labs
 
Beginners - Get Started With Unit Testing in .NET
Beginners - Get Started With Unit Testing in .NETBeginners - Get Started With Unit Testing in .NET
Beginners - Get Started With Unit Testing in .NETBaskar K
 
Software Testing Life Cycle (STLC) | Software Testing Tutorial | Edureka
Software Testing Life Cycle (STLC) | Software Testing Tutorial | EdurekaSoftware Testing Life Cycle (STLC) | Software Testing Tutorial | Edureka
Software Testing Life Cycle (STLC) | Software Testing Tutorial | EdurekaEdureka!
 
Automated vs manual testing
Automated vs manual testingAutomated vs manual testing
Automated vs manual testingKanoah
 
An Introduction to Unit Testing
An Introduction to Unit TestingAn Introduction to Unit Testing
An Introduction to Unit TestingJoe Tremblay
 
Unit & integration testing
Unit & integration testingUnit & integration testing
Unit & integration testingPavlo Hodysh
 
Test Automation
Test AutomationTest Automation
Test Automationrockoder
 
What is Integration Testing? | Edureka
What is Integration Testing? | EdurekaWhat is Integration Testing? | Edureka
What is Integration Testing? | EdurekaEdureka!
 
An introduction to unit testing
An introduction to unit testingAn introduction to unit testing
An introduction to unit testingAdam Stephensen
 
What is Regression Testing? | Edureka
What is Regression Testing? | EdurekaWhat is Regression Testing? | Edureka
What is Regression Testing? | EdurekaEdureka!
 

What's hot (20)

Unit Testing
Unit TestingUnit Testing
Unit Testing
 
Unit Test Presentation
Unit Test PresentationUnit Test Presentation
Unit Test Presentation
 
UNIT TESTING PPT
UNIT TESTING PPTUNIT TESTING PPT
UNIT TESTING PPT
 
Types of test tools
Types of test toolsTypes of test tools
Types of test tools
 
Unit testing best practices
Unit testing best practicesUnit testing best practices
Unit testing best practices
 
Test Automation Framework Designs
Test Automation Framework DesignsTest Automation Framework Designs
Test Automation Framework Designs
 
Beginners - Get Started With Unit Testing in .NET
Beginners - Get Started With Unit Testing in .NETBeginners - Get Started With Unit Testing in .NET
Beginners - Get Started With Unit Testing in .NET
 
Unit test
Unit testUnit test
Unit test
 
Software Testing Life Cycle (STLC) | Software Testing Tutorial | Edureka
Software Testing Life Cycle (STLC) | Software Testing Tutorial | EdurekaSoftware Testing Life Cycle (STLC) | Software Testing Tutorial | Edureka
Software Testing Life Cycle (STLC) | Software Testing Tutorial | Edureka
 
Cypress Automation
Cypress  AutomationCypress  Automation
Cypress Automation
 
Automated vs manual testing
Automated vs manual testingAutomated vs manual testing
Automated vs manual testing
 
An Introduction to Unit Testing
An Introduction to Unit TestingAn Introduction to Unit Testing
An Introduction to Unit Testing
 
JUnit Presentation
JUnit PresentationJUnit Presentation
JUnit Presentation
 
Unit & integration testing
Unit & integration testingUnit & integration testing
Unit & integration testing
 
Test Automation
Test AutomationTest Automation
Test Automation
 
Introduction to Software Test Automation
Introduction to Software Test AutomationIntroduction to Software Test Automation
Introduction to Software Test Automation
 
What is Integration Testing? | Edureka
What is Integration Testing? | EdurekaWhat is Integration Testing? | Edureka
What is Integration Testing? | Edureka
 
Java Unit Testing
Java Unit TestingJava Unit Testing
Java Unit Testing
 
An introduction to unit testing
An introduction to unit testingAn introduction to unit testing
An introduction to unit testing
 
What is Regression Testing? | Edureka
What is Regression Testing? | EdurekaWhat is Regression Testing? | Edureka
What is Regression Testing? | Edureka
 

Viewers also liked

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
 
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
 
JUnit- A Unit Testing Framework
JUnit- A Unit Testing FrameworkJUnit- A Unit Testing Framework
JUnit- A Unit Testing FrameworkOnkar Deshpande
 
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
 

Viewers also liked (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
 
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
 
JUnit- A Unit Testing Framework
JUnit- A Unit Testing FrameworkJUnit- A Unit Testing Framework
JUnit- A Unit Testing Framework
 
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
 

Similar to Unit Tests And Automated Testing

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
 
Automated Testing vs Manual Testing
Automated Testing vs Manual TestingAutomated Testing vs Manual Testing
Automated Testing vs Manual TestingDirecti Group
 
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
 

Similar to 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...
 

More from 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
 

More from 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
 

Recently uploaded

Buy Epson EcoTank L3210 Colour Printer Online.pptx
Buy Epson EcoTank L3210 Colour Printer Online.pptxBuy Epson EcoTank L3210 Colour Printer Online.pptx
Buy Epson EcoTank L3210 Colour Printer Online.pptxEasyPrinterHelp
 
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)Julian Hyde
 
Demystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John StaveleyDemystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John StaveleyJohn Staveley
 
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...CzechDreamin
 
PLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. StartupsPLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. StartupsStefano
 
Top 10 Symfony Development Companies 2024
Top 10 Symfony Development Companies 2024Top 10 Symfony Development Companies 2024
Top 10 Symfony Development Companies 2024TopCSSGallery
 
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...CzechDreamin
 
ECS 2024 Teams Premium - Pretty Secure
ECS 2024   Teams Premium - Pretty SecureECS 2024   Teams Premium - Pretty Secure
ECS 2024 Teams Premium - Pretty SecureFemke de Vroome
 
Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024Patrick Viafore
 
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...FIDO Alliance
 
WSO2CONMay2024OpenSourceConferenceDebrief.pptx
WSO2CONMay2024OpenSourceConferenceDebrief.pptxWSO2CONMay2024OpenSourceConferenceDebrief.pptx
WSO2CONMay2024OpenSourceConferenceDebrief.pptxJennifer Lim
 
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...FIDO Alliance
 
Designing for Hardware Accessibility at Comcast
Designing for Hardware Accessibility at ComcastDesigning for Hardware Accessibility at Comcast
Designing for Hardware Accessibility at ComcastUXDXConf
 
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdfSimplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdfFIDO Alliance
 
IoT Analytics Company Presentation May 2024
IoT Analytics Company Presentation May 2024IoT Analytics Company Presentation May 2024
IoT Analytics Company Presentation May 2024IoTAnalytics
 
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...FIDO Alliance
 
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...FIDO Alliance
 
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdfThe Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdfFIDO Alliance
 
AI revolution and Salesforce, Jiří Karpíšek
AI revolution and Salesforce, Jiří KarpíšekAI revolution and Salesforce, Jiří Karpíšek
AI revolution and Salesforce, Jiří KarpíšekCzechDreamin
 
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptxUnpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptxDavid Michel
 

Recently uploaded (20)

Buy Epson EcoTank L3210 Colour Printer Online.pptx
Buy Epson EcoTank L3210 Colour Printer Online.pptxBuy Epson EcoTank L3210 Colour Printer Online.pptx
Buy Epson EcoTank L3210 Colour Printer Online.pptx
 
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
 
Demystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John StaveleyDemystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John Staveley
 
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
 
PLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. StartupsPLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. Startups
 
Top 10 Symfony Development Companies 2024
Top 10 Symfony Development Companies 2024Top 10 Symfony Development Companies 2024
Top 10 Symfony Development Companies 2024
 
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
 
ECS 2024 Teams Premium - Pretty Secure
ECS 2024   Teams Premium - Pretty SecureECS 2024   Teams Premium - Pretty Secure
ECS 2024 Teams Premium - Pretty Secure
 
Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024
 
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
 
WSO2CONMay2024OpenSourceConferenceDebrief.pptx
WSO2CONMay2024OpenSourceConferenceDebrief.pptxWSO2CONMay2024OpenSourceConferenceDebrief.pptx
WSO2CONMay2024OpenSourceConferenceDebrief.pptx
 
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
 
Designing for Hardware Accessibility at Comcast
Designing for Hardware Accessibility at ComcastDesigning for Hardware Accessibility at Comcast
Designing for Hardware Accessibility at Comcast
 
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdfSimplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
 
IoT Analytics Company Presentation May 2024
IoT Analytics Company Presentation May 2024IoT Analytics Company Presentation May 2024
IoT Analytics Company Presentation May 2024
 
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
 
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
 
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdfThe Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
 
AI revolution and Salesforce, Jiří Karpíšek
AI revolution and Salesforce, Jiří KarpíšekAI revolution and Salesforce, Jiří Karpíšek
AI revolution and Salesforce, Jiří Karpíšek
 
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptxUnpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
 

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

Editor's Notes

  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