SlideShare une entreprise Scribd logo
1  sur  21
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

Automated Testing with Agile
Automated Testing with AgileAutomated Testing with Agile
Automated Testing with AgileKen McCorkell
 
Automation testing strategy, approach & planning
Automation testing  strategy, approach & planningAutomation testing  strategy, approach & planning
Automation testing strategy, approach & planningSivaprasanthRentala1975
 
Test-Driven Development
Test-Driven DevelopmentTest-Driven Development
Test-Driven DevelopmentJohn Blum
 
Test Driven Development (TDD)
Test Driven Development (TDD)Test Driven Development (TDD)
Test Driven Development (TDD)David Ehringer
 
Agile testing - Testing From Day 1
Agile testing - Testing From Day 1Agile testing - Testing From Day 1
Agile testing - Testing From Day 1Kaizenko
 
6 Traits of a Successful Test Automation Architecture
6 Traits of a Successful Test Automation Architecture6 Traits of a Successful Test Automation Architecture
6 Traits of a Successful Test Automation ArchitectureErdem YILDIRIM
 
UNIT TESTING PPT
UNIT TESTING PPTUNIT TESTING PPT
UNIT TESTING PPTsuhasreddy1
 
Agile Testing Framework - The Art of Automated Testing
Agile Testing Framework - The Art of Automated TestingAgile Testing Framework - The Art of Automated Testing
Agile Testing Framework - The Art of Automated TestingDimitri Ponomareff
 
An introduction to unit testing
An introduction to unit testingAn introduction to unit testing
An introduction to unit testingAdam Stephensen
 
Software Testing - Part 1 (Techniques, Types, Levels, Methods, STLC, Bug Life...
Software Testing - Part 1 (Techniques, Types, Levels, Methods, STLC, Bug Life...Software Testing - Part 1 (Techniques, Types, Levels, Methods, STLC, Bug Life...
Software Testing - Part 1 (Techniques, Types, Levels, Methods, STLC, Bug Life...Ankit Prajapati
 

Tendances (20)

Workshop unit test
Workshop   unit testWorkshop   unit test
Workshop unit test
 
Agile Testing by Example
Agile Testing by ExampleAgile Testing by Example
Agile Testing by Example
 
Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven Development
 
Unit Testing
Unit TestingUnit Testing
Unit Testing
 
Automated Testing with Agile
Automated Testing with AgileAutomated Testing with Agile
Automated Testing with Agile
 
Unit testing
Unit testingUnit testing
Unit testing
 
Automation testing strategy, approach & planning
Automation testing  strategy, approach & planningAutomation testing  strategy, approach & planning
Automation testing strategy, approach & planning
 
Test-Driven Development
Test-Driven DevelopmentTest-Driven Development
Test-Driven Development
 
Test Driven Development (TDD)
Test Driven Development (TDD)Test Driven Development (TDD)
Test Driven Development (TDD)
 
Automation testing
Automation testingAutomation testing
Automation testing
 
Agile testing - Testing From Day 1
Agile testing - Testing From Day 1Agile testing - Testing From Day 1
Agile testing - Testing From Day 1
 
6 Traits of a Successful Test Automation Architecture
6 Traits of a Successful Test Automation Architecture6 Traits of a Successful Test Automation Architecture
6 Traits of a Successful Test Automation Architecture
 
Test Automation
Test AutomationTest Automation
Test Automation
 
UNIT TESTING PPT
UNIT TESTING PPTUNIT TESTING PPT
UNIT TESTING PPT
 
Agile Testing Framework - The Art of Automated Testing
Agile Testing Framework - The Art of Automated TestingAgile Testing Framework - The Art of Automated Testing
Agile Testing Framework - The Art of Automated Testing
 
Unit Testing (C#)
Unit Testing (C#)Unit Testing (C#)
Unit Testing (C#)
 
An introduction to unit testing
An introduction to unit testingAn introduction to unit testing
An introduction to unit testing
 
Software Testing - Part 1 (Techniques, Types, Levels, Methods, STLC, Bug Life...
Software Testing - Part 1 (Techniques, Types, Levels, Methods, STLC, Bug Life...Software Testing - Part 1 (Techniques, Types, Levels, Methods, STLC, Bug Life...
Software Testing - Part 1 (Techniques, Types, Levels, Methods, STLC, Bug Life...
 
Introduction to Software Test Automation
Introduction to Software Test AutomationIntroduction to Software Test Automation
Introduction to Software Test Automation
 
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
 
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
 

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

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

Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 

Dernier (20)

Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 

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