SlideShare uma empresa Scribd logo
1 de 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-

Mais conteúdo relacionado

Mais procurados (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
 

Destaque

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
 

Destaque (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...
 

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

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

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

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

Último

The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 

Último (20)

The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 

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-

Notas do Editor

  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