SlideShare a Scribd company logo
Unit testing in VS2012
      Ricci Gian Maria
   http://blogs.ugidotnet.org/rgm
    http://www.codewrecks.com
     alkampfer@nablasoft.com
             @alkampfer
Agenda


• A new shiny test runner
• Continuous test and code coverage made
  super-easy
• Real or fake? A world of shims.
• Coded-Ui test and Testing Team
• Visual Studio Specific tests
• Running test in a Build
A new shiny test runner

•   Integrated in VS
•   Pluggable test framework
•   Simpler to use
•   Faster than older runner     Test Runner
•   More agile-tester-oriented




                                 Agile Tester
Most important features on front

• One click Code coverage




• Continuous test runner
New features, revamp of older ones
and dropped functionalities
One-click code coverage
  No more oscure settings
  No more needs of test configuration for basic run
New features
  Continuous test (aka run test after builds)
  Agile test runner
  C++ unit test framework
Removed features
  No more dev test impact (only available on builds)
  No more tests lists
  Old test runner is gone
Compatibility with VS2010

Support for VS2010 test project file
New format of test project
  No need of .testsettings file
  New test project templates
Settings are obsolete and deprecated
  Used only for specific scenario like remote
  execution
  To use Diagnostic data adapter

  http://tinyurl.com/vs2012testupgrade
Some missing feature for old MsTest
users

• Test Lists –deprecated in 2010 no more
  supported
• Still no ability to group tests in test runner
• Run test by category only with command line
  test runner
  •   Vstest.console Calculator.test.dll
      /UseVsixExtensions:true /TestCaseFilter: «
      TestCategory=xxx»
  •   Works only for MSTest (or for provider that willingly
      parse the TestCategory attribute)
Isolation library – Visual Studio fakes

• A Stub is a Test Double with behavior set in
  the test to make test repeatable
• A shim or shiv is a small library that
  transparently interceps an API.. (Wikipedia)
• They makes untestable code testable
• Only available in VS Ultimate
• Is the last resort to test legacy code for
  refactoring/update/upgrade
Coded UI tests
• Record User – Software interaction
• Playback the application replaying user
  action
• Based on «pluggable» component
  •   Use better technology when possible
  •   Permits to third party company to support theirs controls (Es.
      Telerik)
• Records high level interation when possible
  •   Does not record mouse clicks or keyboard strokes only
  •   Try to understand what the user does
  •   Aggregates operations
• Collaboration with Test Teams using
  Microsoft Test Manager
Coded UI New features
• Support for IE9/IE10 (HTML5 support)
• New api focusing on hand-code CUIT
• Description and assertion message in CUIT
  test recorder

• News http://tinyurl.com/vs2012cuit
Coded UI Test Compatibility with
VS2010
• No Silverlight support (use VS2010 feature
  pack 2 unit test project)
• No Firefox support (use VS2010 feature
  pack 2 unit test project)
• New API (can be used only in VS2012 CUIT
  test project
• Cannot add CUIT to VS2010 test project
  that has not already a CUIT in it (create a
  CUIT with vs2010, then open in VS2012 to
  do repair process)
Web Performance tests
• Available since VS 2005 and evolved through
  each VS upgrade
• Request/replay based test
 •   Record in IE
 •   Manipulation from a specific editor in VS
 •   Advanced request/response correlation feature
 •   Advanced extraction rules to grab content from responses
 •   Easy to write plugin
 •   Advanced feature es. cycles
Run test in builds
• The new test engine is integrated with TFS2012
  builds
  •     Faster runner
  •     Supports test impact
  •     Supports third party framework
        http://tinyurl.com/VS2012TestDiscover

• Run Nunit, xUnit, etc in a build and have results
  automatically stored with the build
• Unit test in build indicates health of the project
• Is the grounding for Continuous Delivery
      http://tinyurl.com/TFSContinuousDelivery
Grazie agli sponsor

More Related Content

PDF
Make sure your code works
PDF
Mozilla: Mozmill meets L10n
PPTX
Protractor
PPTX
Automation using Javascript
PPTX
Presentation_Protractor
PPTX
Angular js automation using protractor
PPTX
Continuous Delivery concept overview. Continuous Integration Systems. DevOps ...
PPTX
Automated Testing using JavaScript
Make sure your code works
Mozilla: Mozmill meets L10n
Protractor
Automation using Javascript
Presentation_Protractor
Angular js automation using protractor
Continuous Delivery concept overview. Continuous Integration Systems. DevOps ...
Automated Testing using JavaScript

What's hot (20)

PDF
Continuous Integration with Mozmill
PPTX
Level Up Your Salesforce Unit Testing
ODP
Dot Net Notts Js Unit Testing at Microlise
ODP
Js unit testingpresentation
PPTX
Lap Around Visual Studio 2010 Ultimate And TFS 2010
PPTX
Part of the DLM Story: Automated database build and test with TeamCity
PPTX
Battle for Code Quality - A Story of One Java Project
PDF
Testing lightning components feb 15th 2018
PDF
Crowd-sourced Automated Firefox UI Testing
PPTX
Provar webinar 15-03-2018
PPTX
Protractor overview
PDF
TestingAR XX - Protractor e2e Test Framework - Introduction what we have lear...
PDF
Jenkins – przyjaciel każdego testera.
PDF
TestWorks Conf Robot framework - the unsung hero of test automation - Michael...
PDF
Sencha Roadshow 2017: Best Practices for Implementing Continuous Web App Testing
PDF
UI Testing Automation
PDF
EFL QA: Where Are We and Where Should We Go?
KEY
Mozmill Crowd
PDF
Mozilla: Automated Mozmill Tests
Continuous Integration with Mozmill
Level Up Your Salesforce Unit Testing
Dot Net Notts Js Unit Testing at Microlise
Js unit testingpresentation
Lap Around Visual Studio 2010 Ultimate And TFS 2010
Part of the DLM Story: Automated database build and test with TeamCity
Battle for Code Quality - A Story of One Java Project
Testing lightning components feb 15th 2018
Crowd-sourced Automated Firefox UI Testing
Provar webinar 15-03-2018
Protractor overview
TestingAR XX - Protractor e2e Test Framework - Introduction what we have lear...
Jenkins – przyjaciel każdego testera.
TestWorks Conf Robot framework - the unsung hero of test automation - Michael...
Sencha Roadshow 2017: Best Practices for Implementing Continuous Web App Testing
UI Testing Automation
EFL QA: Where Are We and Where Should We Go?
Mozmill Crowd
Mozilla: Automated Mozmill Tests
Ad

Similar to ALM@Work - Unit testing in Visual studio 2012 (20)

PPTX
Test automation proposal
PPTX
Refactoring Legacy Web Forms for Test Automation
PPTX
Testing tools in visual studio
PDF
Testlink Test Management with Teamforge
PPTX
TUTTO SU VISUAL STUDIO ALM 2015
PDF
Introduction to Protractor
PPTX
Automation Testing with Test Complete
PDF
Getting Started With Coded UI testing: Building Your First Automated Test
PPTX
Effective .NET Core Unit Testing with SQLite and Dapper
PPTX
Protractor survival guide
PPTX
Effective .NET Core Unit Testing with SQLite and Dapper
PPTX
Getting Started with Visual Studio’s Coded UI Testing: Building Your First Au...
PPTX
Whats New In 2010 (Msdn & Visual Studio)
PPTX
QAorHighway2016
PPTX
Test parallelization using Jenkins
PPTX
Katlon softrwate testing automation.pptx
PPTX
Unit testing, UI testing and Test Driven Development in Visual Studio 2012
PDF
Testing Angular
PPTX
#ATAGTR2020 Presentation - Universal Test Automation Framework
PPTX
FEDSPUG April 2014: Visual Studio 2013 for Application Lifecycle Management &...
Test automation proposal
Refactoring Legacy Web Forms for Test Automation
Testing tools in visual studio
Testlink Test Management with Teamforge
TUTTO SU VISUAL STUDIO ALM 2015
Introduction to Protractor
Automation Testing with Test Complete
Getting Started With Coded UI testing: Building Your First Automated Test
Effective .NET Core Unit Testing with SQLite and Dapper
Protractor survival guide
Effective .NET Core Unit Testing with SQLite and Dapper
Getting Started with Visual Studio’s Coded UI Testing: Building Your First Au...
Whats New In 2010 (Msdn & Visual Studio)
QAorHighway2016
Test parallelization using Jenkins
Katlon softrwate testing automation.pptx
Unit testing, UI testing and Test Driven Development in Visual Studio 2012
Testing Angular
#ATAGTR2020 Presentation - Universal Test Automation Framework
FEDSPUG April 2014: Visual Studio 2013 for Application Lifecycle Management &...
Ad

More from DomusDotNet (18)

PPTX
Application lifecycle management ... e quindi
PPTX
Unit testing in Visual Studio 2013
PPTX
Advanced ef code first 5.0 - EF@work
PPTX
ASP.NET MVC: sfruttare la piattaforma al 100%
PPTX
Push Notification, Live Tile e Background Agent
PDF
Sviluppare per Intel® Ultrabook™
PPTX
ALM@Work - Team collaboration with visual studio alm 2012
PPTX
ALM@Work - Lab management for everyone
PPTX
ALM@Work - Continuous delivery 101
PPTX
ALM@Work - Typical developer day
PPTX
We Want Web - Web Applications con MVC 3
PPTX
WeWantWeb - WCF Data Services
PPTX
ALM Revolutions - Non si vive di solo check-out e check-in
PPTX
ALM Revolutions - Process Template Customization
PPTX
ALM Revolutions - What's new in visual studio ALM 11
PDF
Pomeriggio Entity Framework - WP7 e SQL Compact Edition
PPTX
Pomeriggio Entity Framework - Database First
PPTX
Pomeriggio Entity Framework - Code First
Application lifecycle management ... e quindi
Unit testing in Visual Studio 2013
Advanced ef code first 5.0 - EF@work
ASP.NET MVC: sfruttare la piattaforma al 100%
Push Notification, Live Tile e Background Agent
Sviluppare per Intel® Ultrabook™
ALM@Work - Team collaboration with visual studio alm 2012
ALM@Work - Lab management for everyone
ALM@Work - Continuous delivery 101
ALM@Work - Typical developer day
We Want Web - Web Applications con MVC 3
WeWantWeb - WCF Data Services
ALM Revolutions - Non si vive di solo check-out e check-in
ALM Revolutions - Process Template Customization
ALM Revolutions - What's new in visual studio ALM 11
Pomeriggio Entity Framework - WP7 e SQL Compact Edition
Pomeriggio Entity Framework - Database First
Pomeriggio Entity Framework - Code First

Recently uploaded (20)

PDF
Approach and Philosophy of On baking technology
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PPTX
Spectroscopy.pptx food analysis technology
PDF
Encapsulation theory and applications.pdf
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Machine learning based COVID-19 study performance prediction
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
Approach and Philosophy of On baking technology
The Rise and Fall of 3GPP – Time for a Sabbatical?
Chapter 3 Spatial Domain Image Processing.pdf
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
The AUB Centre for AI in Media Proposal.docx
Encapsulation_ Review paper, used for researhc scholars
Mobile App Security Testing_ A Comprehensive Guide.pdf
Spectroscopy.pptx food analysis technology
Encapsulation theory and applications.pdf
Understanding_Digital_Forensics_Presentation.pptx
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
MYSQL Presentation for SQL database connectivity
Machine learning based COVID-19 study performance prediction
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Per capita expenditure prediction using model stacking based on satellite ima...
MIND Revenue Release Quarter 2 2025 Press Release
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Advanced methodologies resolving dimensionality complications for autism neur...
Reach Out and Touch Someone: Haptics and Empathic Computing

ALM@Work - Unit testing in Visual studio 2012

  • 1. Unit testing in VS2012 Ricci Gian Maria http://blogs.ugidotnet.org/rgm http://www.codewrecks.com alkampfer@nablasoft.com @alkampfer
  • 2. Agenda • A new shiny test runner • Continuous test and code coverage made super-easy • Real or fake? A world of shims. • Coded-Ui test and Testing Team • Visual Studio Specific tests • Running test in a Build
  • 3. A new shiny test runner • Integrated in VS • Pluggable test framework • Simpler to use • Faster than older runner Test Runner • More agile-tester-oriented Agile Tester
  • 4. Most important features on front • One click Code coverage • Continuous test runner
  • 5. New features, revamp of older ones and dropped functionalities One-click code coverage No more oscure settings No more needs of test configuration for basic run New features Continuous test (aka run test after builds) Agile test runner C++ unit test framework Removed features No more dev test impact (only available on builds) No more tests lists Old test runner is gone
  • 6. Compatibility with VS2010 Support for VS2010 test project file New format of test project No need of .testsettings file New test project templates Settings are obsolete and deprecated Used only for specific scenario like remote execution To use Diagnostic data adapter http://tinyurl.com/vs2012testupgrade
  • 7. Some missing feature for old MsTest users • Test Lists –deprecated in 2010 no more supported • Still no ability to group tests in test runner • Run test by category only with command line test runner • Vstest.console Calculator.test.dll /UseVsixExtensions:true /TestCaseFilter: « TestCategory=xxx» • Works only for MSTest (or for provider that willingly parse the TestCategory attribute)
  • 8. Isolation library – Visual Studio fakes • A Stub is a Test Double with behavior set in the test to make test repeatable • A shim or shiv is a small library that transparently interceps an API.. (Wikipedia) • They makes untestable code testable • Only available in VS Ultimate • Is the last resort to test legacy code for refactoring/update/upgrade
  • 9. Coded UI tests • Record User – Software interaction • Playback the application replaying user action • Based on «pluggable» component • Use better technology when possible • Permits to third party company to support theirs controls (Es. Telerik) • Records high level interation when possible • Does not record mouse clicks or keyboard strokes only • Try to understand what the user does • Aggregates operations • Collaboration with Test Teams using Microsoft Test Manager
  • 10. Coded UI New features • Support for IE9/IE10 (HTML5 support) • New api focusing on hand-code CUIT • Description and assertion message in CUIT test recorder • News http://tinyurl.com/vs2012cuit
  • 11. Coded UI Test Compatibility with VS2010 • No Silverlight support (use VS2010 feature pack 2 unit test project) • No Firefox support (use VS2010 feature pack 2 unit test project) • New API (can be used only in VS2012 CUIT test project • Cannot add CUIT to VS2010 test project that has not already a CUIT in it (create a CUIT with vs2010, then open in VS2012 to do repair process)
  • 12. Web Performance tests • Available since VS 2005 and evolved through each VS upgrade • Request/replay based test • Record in IE • Manipulation from a specific editor in VS • Advanced request/response correlation feature • Advanced extraction rules to grab content from responses • Easy to write plugin • Advanced feature es. cycles
  • 13. Run test in builds • The new test engine is integrated with TFS2012 builds • Faster runner • Supports test impact • Supports third party framework http://tinyurl.com/VS2012TestDiscover • Run Nunit, xUnit, etc in a build and have results automatically stored with the build • Unit test in build indicates health of the project • Is the grounding for Continuous Delivery http://tinyurl.com/TFSContinuousDelivery