SlideShare ist ein Scribd-Unternehmen logo
1 von 28
unit testing, ui testing, & test-
driven development in visual
studio 2012




Jon Limjap
C# MVP
Agenda
• Overview of Unit Testing, UI Testing and
  Test Driven Development
• Unit testing UI and code in Visual Studio
  2012
what’s up with all these tests?
         overview of unit testing, ui
         testing, and test driven
         development
Let’s talk about unit testing
• What is Unit Testing?
• What is UI Testing?
• What is Test Driven Development?
What is a unit test?
• Code that test a single unit of functionality
  (obviously!)
• A single unit is any block of code that has
  ONE and only ONE responsibility:
  – Method
  – Function
  – Class
What is User Interface Testing?
   Using unit tests to validate user
    interaction
   Automates user actions: clicking and
    typing
   Automated UI tests allow your machine to
    do repetitive tasks across an application’s
    interface for you ;)
What is Test Driven
Development?
   Using unit tests to design software
   Allows change in code without fear of
    changing functionality
   Produces loosely coupled objects and
    methods with single responsibilities
   Unit tests become a tool to guide code
    design
Red Green Refactor
red
   New code
       Write test before implementing class
       Internal workings of classes and methods
        should not matter
   Existing code
       Write test to reproduce bug
green
   Write least possible code to pass all tests
   Take shortcuts if necessary
refactor
   Refactor both implementation code and
    test code
   Change code without fear – you have
    automated tests!
   Remove implementation shortcuts – make
    sure software design makes sense
   Optimize for
    design/performance/maintainability
rinse and repeat!
Customer feedback on MS Test
• MS Test Framework Issues
  – MS-Test too slow
  – MS-Test missing new features
• Experience Issues
  – Designed for testers and not for developers
  – Not good for Agile & TDD
what’s new

        unit testing in
        visual studio 2012
The Visual Studio 2012 Unit
     Testing experience is
   focused on developers
writing and running unit tests
 while they write their code.
Yey new features!
•   Developer focused user experience
•   MS-Test improvements
•   Built-in and Third-party test frameworks
•   Continuous Testing
•   Debug Selected Tests
•   Code Coverage
Developer Focused User Experience
MS-Test Improvements
• Many performance and scale improvements
   – Especially when you stick to “classic” unit testing
• Support for testing Async
   [TestMethod]
   public async Task MyAsyncTest()
   {
      var result = await SomeLongRunningOperation();
      Assert.IsTrue( result );
   }


• Proper support for 64-bit and .Net multi-targeting
• Available in Express!
Supported Test Frameworks
• Built-in
  – .NET
  – Native C/C++
• Third-party
  – NUnit
  – xUnit.net
  – MbUnit
  – QUnit/Jasmine
  – Selenium
some ui testing in the web

        ui testing with nunit, selenium
        and visual studio 2012
Red Green Refactor
some genuine test driven development
        test driven development
        with nunit and visual
        studio 2012
Continuous Testing
• If you’re not testing you’re just compiling,
  not building
• Make sure you don’t break your code and
  tests – everytime you build!
Code Coverage
• Analyze your code
  coverage with a single
  click
• Analyze for selected
  tests to help find how
  specific tests are
  covering your system
• Supports all managed
  & native frameworks
Non C# unit testing coolness
• Unit Testing Browser-based Javascript
  (via Qunit/Jasmine)
• Unit Testing Native C++ Applications
let’s see it!


          demo
Just contact maybe :p
• twitter.com/lattex
• jonlimjap@gmail.com
• dotnet.kapenilattex.com
References
• Peter Provost:
  http://channel9.msdn.com/Events/TechEd/Europe/
  2012/DEV214?format=html5
• Jason Zander:
  http://blogs.msdn.com/b/jasonz/archive/2012/05/
  22/my-favorite-features-unit-testing-
  enhancements-in-visual-studio-11.aspx
• Ben Hall:
  http://blog.benhall.me.uk/2008/05/nxtgenug-
  coventry-red-green-refactor.html
• Anoop Shetty:
  http://anoopjshetty.wordpress.com/2012/02/08/cr
  eating-test-automation-framework-using-c-

Weitere ähnliche Inhalte

Was ist angesagt? (20)

Unit Testing Fundamentals
Unit Testing FundamentalsUnit Testing Fundamentals
Unit Testing Fundamentals
 
Test driven development in .Net - 2010 + Eclipse
Test driven development in .Net - 2010 + EclipseTest driven development in .Net - 2010 + Eclipse
Test driven development in .Net - 2010 + Eclipse
 
Unit Testing Concepts and Best Practices
Unit Testing Concepts and Best PracticesUnit Testing Concepts and Best Practices
Unit Testing Concepts and Best Practices
 
Unit Testing
Unit TestingUnit Testing
Unit Testing
 
Unit test
Unit testUnit test
Unit test
 
How and what to unit test
How and what to unit testHow and what to unit test
How and what to unit test
 
Automated Unit Testing
Automated Unit TestingAutomated Unit Testing
Automated Unit Testing
 
Unit Testing
Unit TestingUnit Testing
Unit Testing
 
Testing In Java
Testing In JavaTesting In Java
Testing In Java
 
Testing and Mocking Object - The Art of Mocking.
Testing and Mocking Object - The Art of Mocking.Testing and Mocking Object - The Art of Mocking.
Testing and Mocking Object - The Art of Mocking.
 
Unit Testing (C#)
Unit Testing (C#)Unit Testing (C#)
Unit Testing (C#)
 
Unit tests & TDD
Unit tests & TDDUnit tests & TDD
Unit tests & TDD
 
Best practices unit testing
Best practices unit testing Best practices unit testing
Best practices unit testing
 
An Introduction to Unit Testing
An Introduction to Unit TestingAn Introduction to Unit Testing
An Introduction to Unit Testing
 
Unit Testing And Mocking
Unit Testing And MockingUnit Testing And Mocking
Unit Testing And Mocking
 
Unit testing, principles
Unit testing, principlesUnit testing, principles
Unit testing, principles
 
Unit testing
Unit testingUnit testing
Unit testing
 
Understanding Unit Testing
Understanding Unit TestingUnderstanding Unit Testing
Understanding Unit Testing
 
Unit Testing 101
Unit Testing 101Unit Testing 101
Unit Testing 101
 
Roy Osherove on Unit Testing Good Practices and Horrible Mistakes
Roy Osherove on Unit Testing Good Practices and Horrible MistakesRoy Osherove on Unit Testing Good Practices and Horrible Mistakes
Roy Osherove on Unit Testing Good Practices and Horrible Mistakes
 

Andere mochten auch

IT Risk Management & Leadership 30 March - 02 April 2014 Dubai UAE
IT Risk Management & Leadership 30 March - 02 April 2014 Dubai UAEIT Risk Management & Leadership 30 March - 02 April 2014 Dubai UAE
IT Risk Management & Leadership 30 March - 02 April 2014 Dubai UAE360 BSI
 
Visual Studio ALM 2013 - Edition Comparison
Visual Studio ALM 2013 - Edition ComparisonVisual Studio ALM 2013 - Edition Comparison
Visual Studio ALM 2013 - Edition ComparisonSteve Lange
 
Application Lifecycle management Utilizando ferramentas Microsoft
Application Lifecycle management Utilizando ferramentas MicrosoftApplication Lifecycle management Utilizando ferramentas Microsoft
Application Lifecycle management Utilizando ferramentas MicrosoftLuís Cesar Teodoro
 
What's new in Visual Studio 2013 & TFS 2013
What's new in Visual Studio 2013 & TFS 2013What's new in Visual Studio 2013 & TFS 2013
What's new in Visual Studio 2013 & TFS 2013Danijel Malik
 
Visual Studio Team Services Extensions by Taavi Kõosaar (@melborp)
Visual Studio Team Services Extensions by Taavi Kõosaar (@melborp)Visual Studio Team Services Extensions by Taavi Kõosaar (@melborp)
Visual Studio Team Services Extensions by Taavi Kõosaar (@melborp).NET Crowd
 
Advanced Coded UI Testing
Advanced Coded UI TestingAdvanced Coded UI Testing
Advanced Coded UI TestingShai Raiten
 
Scaling Agile: SAFe with Visual Studio Team Foundation Server
Scaling Agile: SAFe with Visual Studio Team Foundation Server Scaling Agile: SAFe with Visual Studio Team Foundation Server
Scaling Agile: SAFe with Visual Studio Team Foundation Server InCycle Software
 
Agile project management with visual studio tfs 2013 - My presentation at Reg...
Agile project management with visual studio tfs 2013 - My presentation at Reg...Agile project management with visual studio tfs 2013 - My presentation at Reg...
Agile project management with visual studio tfs 2013 - My presentation at Reg...Om Prakash Bang
 

Andere mochten auch (10)

IT Risk Management & Leadership 30 March - 02 April 2014 Dubai UAE
IT Risk Management & Leadership 30 March - 02 April 2014 Dubai UAEIT Risk Management & Leadership 30 March - 02 April 2014 Dubai UAE
IT Risk Management & Leadership 30 March - 02 April 2014 Dubai UAE
 
Visual Studio ALM 2013 - Edition Comparison
Visual Studio ALM 2013 - Edition ComparisonVisual Studio ALM 2013 - Edition Comparison
Visual Studio ALM 2013 - Edition Comparison
 
Application Lifecycle management Utilizando ferramentas Microsoft
Application Lifecycle management Utilizando ferramentas MicrosoftApplication Lifecycle management Utilizando ferramentas Microsoft
Application Lifecycle management Utilizando ferramentas Microsoft
 
What's new in Visual Studio 2013 & TFS 2013
What's new in Visual Studio 2013 & TFS 2013What's new in Visual Studio 2013 & TFS 2013
What's new in Visual Studio 2013 & TFS 2013
 
Visual Studio Team Services Extensions by Taavi Kõosaar (@melborp)
Visual Studio Team Services Extensions by Taavi Kõosaar (@melborp)Visual Studio Team Services Extensions by Taavi Kõosaar (@melborp)
Visual Studio Team Services Extensions by Taavi Kõosaar (@melborp)
 
Advanced Coded UI Testing
Advanced Coded UI TestingAdvanced Coded UI Testing
Advanced Coded UI Testing
 
Scrum with VS2010
Scrum with VS2010  Scrum with VS2010
Scrum with VS2010
 
ASP.NET Web form
ASP.NET Web formASP.NET Web form
ASP.NET Web form
 
Scaling Agile: SAFe with Visual Studio Team Foundation Server
Scaling Agile: SAFe with Visual Studio Team Foundation Server Scaling Agile: SAFe with Visual Studio Team Foundation Server
Scaling Agile: SAFe with Visual Studio Team Foundation Server
 
Agile project management with visual studio tfs 2013 - My presentation at Reg...
Agile project management with visual studio tfs 2013 - My presentation at Reg...Agile project management with visual studio tfs 2013 - My presentation at Reg...
Agile project management with visual studio tfs 2013 - My presentation at Reg...
 

Ähnlich wie Unit testing, UI testing and Test Driven Development in Visual Studio 2012

Introduction to Automated Testing
Introduction to Automated TestingIntroduction to Automated Testing
Introduction to Automated TestingLars Thorup
 
Introduction to-automated-testing
Introduction to-automated-testingIntroduction to-automated-testing
Introduction to-automated-testingBestBrains
 
Unit testing with visual studio 2012
Unit testing with visual studio 2012Unit testing with visual studio 2012
Unit testing with visual studio 2012Abhimanyu Singhal
 
Getting Started with Coded UI Testing: Building Your First Automated Test
Getting Started with Coded UI Testing: Building Your First Automated TestGetting Started with Coded UI Testing: Building Your First Automated Test
Getting Started with Coded UI Testing: Building Your First Automated TestImaginet
 
Client Side Unit Testing
Client Side Unit TestingClient Side Unit Testing
Client Side Unit Testingcloud chen
 
Getting Started With Coded UI testing: Building Your First Automated Test
Getting Started With Coded UI testing: Building Your First Automated TestGetting Started With Coded UI testing: Building Your First Automated Test
Getting Started With Coded UI testing: Building Your First Automated TestImaginet
 
Getting Started with Visual Studio’s Coded UI Testing: Building Your First Au...
Getting Started with Visual Studio’s Coded UI Testing: Building Your First Au...Getting Started with Visual Studio’s Coded UI Testing: Building Your First Au...
Getting Started with Visual Studio’s Coded UI Testing: Building Your First Au...Imaginet
 
Udvid din test portefølje med coded ui test og cloud load test
Udvid din test portefølje med coded ui test og cloud load testUdvid din test portefølje med coded ui test og cloud load test
Udvid din test portefølje med coded ui test og cloud load testPeter Lindberg
 
Automation Testing with Test Complete
Automation Testing with Test CompleteAutomation Testing with Test Complete
Automation Testing with Test CompleteVartika Saxena
 
Tools for Software Testing
Tools for Software TestingTools for Software Testing
Tools for Software TestingMohammed Moishin
 
Test Driven Development using QUnit
Test Driven Development using QUnitTest Driven Development using QUnit
Test Driven Development using QUnitsatejsahu
 
Automated Software Testing Framework Training by Quontra Solutions
Automated Software Testing Framework Training by Quontra SolutionsAutomated Software Testing Framework Training by Quontra Solutions
Automated Software Testing Framework Training by Quontra SolutionsQuontra Solutions
 
Software presentation
Software presentationSoftware presentation
Software presentationJennaPrengle
 
Topic production code
Topic production codeTopic production code
Topic production codeKavi Kumar
 
A Day in the Life: Developer Enhancements with Visual Studio 2012
A Day in the Life: Developer Enhancements with Visual Studio 2012A Day in the Life: Developer Enhancements with Visual Studio 2012
A Day in the Life: Developer Enhancements with Visual Studio 2012Imaginet
 
Testing & continuous delivery
Testing & continuous deliveryTesting & continuous delivery
Testing & continuous deliveryNelson Melina
 
Testing tools in visual studio
Testing tools in visual studioTesting tools in visual studio
Testing tools in visual studioMahdi Esmailoghli
 
Unit testing
Unit testing Unit testing
Unit testing dubbu
 

Ähnlich wie Unit testing, UI testing and Test Driven Development in Visual Studio 2012 (20)

Introduction to Automated Testing
Introduction to Automated TestingIntroduction to Automated Testing
Introduction to Automated Testing
 
Introduction to-automated-testing
Introduction to-automated-testingIntroduction to-automated-testing
Introduction to-automated-testing
 
Unit testing with visual studio 2012
Unit testing with visual studio 2012Unit testing with visual studio 2012
Unit testing with visual studio 2012
 
Getting Started with Coded UI Testing: Building Your First Automated Test
Getting Started with Coded UI Testing: Building Your First Automated TestGetting Started with Coded UI Testing: Building Your First Automated Test
Getting Started with Coded UI Testing: Building Your First Automated Test
 
Client Side Unit Testing
Client Side Unit TestingClient Side Unit Testing
Client Side Unit Testing
 
Getting Started With Coded UI testing: Building Your First Automated Test
Getting Started With Coded UI testing: Building Your First Automated TestGetting Started With Coded UI testing: Building Your First Automated Test
Getting Started With Coded UI testing: Building Your First Automated Test
 
Getting Started with Visual Studio’s Coded UI Testing: Building Your First Au...
Getting Started with Visual Studio’s Coded UI Testing: Building Your First Au...Getting Started with Visual Studio’s Coded UI Testing: Building Your First Au...
Getting Started with Visual Studio’s Coded UI Testing: Building Your First Au...
 
Udvid din test portefølje med coded ui test og cloud load test
Udvid din test portefølje med coded ui test og cloud load testUdvid din test portefølje med coded ui test og cloud load test
Udvid din test portefølje med coded ui test og cloud load test
 
Automation Testing with Test Complete
Automation Testing with Test CompleteAutomation Testing with Test Complete
Automation Testing with Test Complete
 
Tools for Software Testing
Tools for Software TestingTools for Software Testing
Tools for Software Testing
 
Test Driven Development using QUnit
Test Driven Development using QUnitTest Driven Development using QUnit
Test Driven Development using QUnit
 
Automated Software Testing Framework Training by Quontra Solutions
Automated Software Testing Framework Training by Quontra SolutionsAutomated Software Testing Framework Training by Quontra Solutions
Automated Software Testing Framework Training by Quontra Solutions
 
Software presentation
Software presentationSoftware presentation
Software presentation
 
Topic production code
Topic production codeTopic production code
Topic production code
 
A Day in the Life: Developer Enhancements with Visual Studio 2012
A Day in the Life: Developer Enhancements with Visual Studio 2012A Day in the Life: Developer Enhancements with Visual Studio 2012
A Day in the Life: Developer Enhancements with Visual Studio 2012
 
Testing & continuous delivery
Testing & continuous deliveryTesting & continuous delivery
Testing & continuous delivery
 
Testing tools in visual studio
Testing tools in visual studioTesting tools in visual studio
Testing tools in visual studio
 
Unit testing
Unit testing Unit testing
Unit testing
 
Agile Testing - What is it?
Agile Testing - What is it?Agile Testing - What is it?
Agile Testing - What is it?
 
Agile Testing
Agile Testing  Agile Testing
Agile Testing
 

Mehr von Jacinto Limjap

Maintainable UI Tests with Selenium and C#
Maintainable UI Tests with Selenium and C#Maintainable UI Tests with Selenium and C#
Maintainable UI Tests with Selenium and C#Jacinto Limjap
 
Refactoring to Microservices
Refactoring to MicroservicesRefactoring to Microservices
Refactoring to MicroservicesJacinto Limjap
 
Donetconf2016: The Future of C#
Donetconf2016: The Future of C#Donetconf2016: The Future of C#
Donetconf2016: The Future of C#Jacinto Limjap
 
C# and the Evolution of a Programming Language
C# and the Evolution of a Programming LanguageC# and the Evolution of a Programming Language
C# and the Evolution of a Programming LanguageJacinto Limjap
 
N-tier and oop - moving across technologies
N-tier and oop - moving across technologiesN-tier and oop - moving across technologies
N-tier and oop - moving across technologiesJacinto Limjap
 
MSDN Ramp-Up Part 3: Business logic
MSDN Ramp-Up Part 3: Business logicMSDN Ramp-Up Part 3: Business logic
MSDN Ramp-Up Part 3: Business logicJacinto Limjap
 
Developing windows phone 7 applications
Developing windows phone 7 applicationsDeveloping windows phone 7 applications
Developing windows phone 7 applicationsJacinto Limjap
 
Automated Unit Testing in Silverlight for Windows Phone 7
Automated Unit Testing in Silverlight for Windows Phone 7Automated Unit Testing in Silverlight for Windows Phone 7
Automated Unit Testing in Silverlight for Windows Phone 7Jacinto Limjap
 
Dynamics & Object Runtime Composition with C# 4.0
Dynamics & Object Runtime Composition with C# 4.0Dynamics & Object Runtime Composition with C# 4.0
Dynamics & Object Runtime Composition with C# 4.0Jacinto Limjap
 
Three Developer Abilities They Dont Teach In College
Three Developer  Abilities They Dont Teach In CollegeThree Developer  Abilities They Dont Teach In College
Three Developer Abilities They Dont Teach In CollegeJacinto Limjap
 

Mehr von Jacinto Limjap (11)

Maintainable UI Tests with Selenium and C#
Maintainable UI Tests with Selenium and C#Maintainable UI Tests with Selenium and C#
Maintainable UI Tests with Selenium and C#
 
Refactoring to Microservices
Refactoring to MicroservicesRefactoring to Microservices
Refactoring to Microservices
 
Donetconf2016: The Future of C#
Donetconf2016: The Future of C#Donetconf2016: The Future of C#
Donetconf2016: The Future of C#
 
C# and the Evolution of a Programming Language
C# and the Evolution of a Programming LanguageC# and the Evolution of a Programming Language
C# and the Evolution of a Programming Language
 
SQL vs NoSQL
SQL vs NoSQLSQL vs NoSQL
SQL vs NoSQL
 
N-tier and oop - moving across technologies
N-tier and oop - moving across technologiesN-tier and oop - moving across technologies
N-tier and oop - moving across technologies
 
MSDN Ramp-Up Part 3: Business logic
MSDN Ramp-Up Part 3: Business logicMSDN Ramp-Up Part 3: Business logic
MSDN Ramp-Up Part 3: Business logic
 
Developing windows phone 7 applications
Developing windows phone 7 applicationsDeveloping windows phone 7 applications
Developing windows phone 7 applications
 
Automated Unit Testing in Silverlight for Windows Phone 7
Automated Unit Testing in Silverlight for Windows Phone 7Automated Unit Testing in Silverlight for Windows Phone 7
Automated Unit Testing in Silverlight for Windows Phone 7
 
Dynamics & Object Runtime Composition with C# 4.0
Dynamics & Object Runtime Composition with C# 4.0Dynamics & Object Runtime Composition with C# 4.0
Dynamics & Object Runtime Composition with C# 4.0
 
Three Developer Abilities They Dont Teach In College
Three Developer  Abilities They Dont Teach In CollegeThree Developer  Abilities They Dont Teach In College
Three Developer Abilities They Dont Teach In College
 

Kürzlich hochgeladen

My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
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
 
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
 
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
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
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
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGSujit Pal
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
[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
 
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
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 

Kürzlich hochgeladen (20)

My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
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
 
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
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAG
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
[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
 
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
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 

Unit testing, UI testing and Test Driven Development in Visual Studio 2012

  • 1. unit testing, ui testing, & test- driven development in visual studio 2012 Jon Limjap C# MVP
  • 2. Agenda • Overview of Unit Testing, UI Testing and Test Driven Development • Unit testing UI and code in Visual Studio 2012
  • 3. what’s up with all these tests? overview of unit testing, ui testing, and test driven development
  • 4. Let’s talk about unit testing • What is Unit Testing? • What is UI Testing? • What is Test Driven Development?
  • 5. What is a unit test? • Code that test a single unit of functionality (obviously!) • A single unit is any block of code that has ONE and only ONE responsibility: – Method – Function – Class
  • 6. What is User Interface Testing?  Using unit tests to validate user interaction  Automates user actions: clicking and typing  Automated UI tests allow your machine to do repetitive tasks across an application’s interface for you ;)
  • 7. What is Test Driven Development?  Using unit tests to design software  Allows change in code without fear of changing functionality  Produces loosely coupled objects and methods with single responsibilities  Unit tests become a tool to guide code design
  • 9. red  New code  Write test before implementing class  Internal workings of classes and methods should not matter  Existing code  Write test to reproduce bug
  • 10. green  Write least possible code to pass all tests  Take shortcuts if necessary
  • 11. refactor  Refactor both implementation code and test code  Change code without fear – you have automated tests!  Remove implementation shortcuts – make sure software design makes sense  Optimize for design/performance/maintainability
  • 13. Customer feedback on MS Test • MS Test Framework Issues – MS-Test too slow – MS-Test missing new features • Experience Issues – Designed for testers and not for developers – Not good for Agile & TDD
  • 14. what’s new unit testing in visual studio 2012
  • 15. The Visual Studio 2012 Unit Testing experience is focused on developers writing and running unit tests while they write their code.
  • 16. Yey new features! • Developer focused user experience • MS-Test improvements • Built-in and Third-party test frameworks • Continuous Testing • Debug Selected Tests • Code Coverage
  • 18. MS-Test Improvements • Many performance and scale improvements – Especially when you stick to “classic” unit testing • Support for testing Async [TestMethod] public async Task MyAsyncTest() { var result = await SomeLongRunningOperation(); Assert.IsTrue( result ); } • Proper support for 64-bit and .Net multi-targeting • Available in Express!
  • 19. Supported Test Frameworks • Built-in – .NET – Native C/C++ • Third-party – NUnit – xUnit.net – MbUnit – QUnit/Jasmine – Selenium
  • 20. some ui testing in the web ui testing with nunit, selenium and visual studio 2012
  • 22. some genuine test driven development test driven development with nunit and visual studio 2012
  • 23. Continuous Testing • If you’re not testing you’re just compiling, not building • Make sure you don’t break your code and tests – everytime you build!
  • 24. Code Coverage • Analyze your code coverage with a single click • Analyze for selected tests to help find how specific tests are covering your system • Supports all managed & native frameworks
  • 25. Non C# unit testing coolness • Unit Testing Browser-based Javascript (via Qunit/Jasmine) • Unit Testing Native C++ Applications
  • 27. Just contact maybe :p • twitter.com/lattex • jonlimjap@gmail.com • dotnet.kapenilattex.com
  • 28. References • Peter Provost: http://channel9.msdn.com/Events/TechEd/Europe/ 2012/DEV214?format=html5 • Jason Zander: http://blogs.msdn.com/b/jasonz/archive/2012/05/ 22/my-favorite-features-unit-testing- enhancements-in-visual-studio-11.aspx • Ben Hall: http://blog.benhall.me.uk/2008/05/nxtgenug- coventry-red-green-refactor.html • Anoop Shetty: http://anoopjshetty.wordpress.com/2012/02/08/cr eating-test-automation-framework-using-c-

Hinweis der Redaktion

  1. Hi my name is Jon Limjap, I’m a Microsoft Most Valuable Professional for C#,
  2. This afternoon I’m going to discuss about unit testing, test driven development, C# and the new unit testing features of Visual Studio 2012
  3. Ask the audience these questions:How do they define unit testing?Do they use unit testing at work?How do they define test-driven development?Do they use test driven development at work?
  4. Unit testing is all about object oriented programmingTest driven development was designed to keep you from overdesigning and overcomplicating your API
  5. RedNew codeWrite test before implementing classInternal workings of classes and methods should not matterExisting codeWrite test to reproduce bugGreenWrite least possible code to pass all testsTake shortcuts if necessaryRefactorRefactor both implementation code and test codeChange code without fear – you have automated tests!Remove implementation shortcuts – make sure software design makes senseOptimize for design/performance/maintainability
  6. The main problem with Visual Studio is that it couldn’t do TDD
  7. Whether or not you write test-first test driven development style or test-after, the best time to write your tests is while you’re writing relevant code
  8. I don’t have time to demo all of these so we’ll only demo some
  9. RedNew codeWrite test before implementing classInternal workings of classes and methods should not matterExisting codeWrite test to reproduce bugGreenWrite least possible code to pass all testsTake shortcuts if necessaryRefactorRefactor both implementation code and test codeChange code without fear – you have automated tests!Remove implementation shortcuts – make sure software design makes senseOptimize for design/performance/maintainability
  10. To build is to build a working product, not a broken oneThe faster we know that we broke