• Blog
  • Info Support
  • Career
  • Training
  • International Group
  • Info Support
  • Blog
  • Career
  • Training
  • International Group
  • Search
logo InfoSupport
  • Latest blogs
  • Popular blogs
  • Experts
      • Alles
      • Bloggers
      • Speakers
  • Meet us
  • About us
    • nl
    • en
    • .NET
    • Advanced Analytics
    • Agile
    • Akka
    • Alexa
    • Algorithms
    • Api's
    • Architectuur
    • Artificial Intelligence
    • ATDD
    • Augmented Reality
    • AWS
    • Azure
    • Big Data
    • Blockchain
    • Business Intelligence
    • Cloud
    • Code Combat
    • Cognitive Services
    • Communicatie
    • Containers
    • Continuous Delivery
    • CQRS
    • Cyber Security
    • Dapr
    • Data
    • Data & Analystics
    • Data Science
    • Data Warehousing
    • Databricks
    • DevOps
    • Digital Days
    • Docker
    • eHealth
    • Enterprise Architecture
    • Hacking
    • Infrastructure & Hosting
    • Innovatie
    • Integration
    • Internet of Things
    • Java
    • Machine Learning
    • Microservices
    • Microsoft
    • Microsoft Bot Framework
    • Microsoft Data Platform
    • Mobile Development
    • Mutation Testing
    • Open source
    • Pepper
    • Power BI
    • Privacy & Ethiek
    • Python
    • Quality Assistance & Test
    • Quality Assurance & Test
    • Requirements Management
    • Scala
    • Scratch
    • Security
    • SharePoint
    • Software Architecture
    • Software development
    • Software Factory
    • SQL Server
    • SSL
    • Start-up
    • Startup thinking
    • Stryker
    • Test Quality
    • Testing
    • TLS
    • TypeScript
    • Various
    • Web Development
    • Web-scale IT
    • Xamarin
    • Alles
    • Bloggers
    • Speakers
Home » How to enable code coverage in Visual Studio 2010 Unit tests
  • How to enable code coverage in Visual Studio 2010 Unit tests

    • By Marcel de Vries
    • .NET 13 years ago
    • .NET 0 comments
    • .NET .NET
    How to enable code coverage in Visual Studio 2010 Unit tests

    *Moved to: http://fluentbytes.com/how-to-enable-code-coverage-in-visual-studio-2010-unit-tests/

    When you want to Enable code coverage in an Unit test run in Visual Studio 2010 you may find that the steps you need to take have changed.
    In Visual Studio 2010 you need to take the following steps:

    Open the Local.testsettings file and there you will see a set of items you can configure on the left hand of the dialog.
    image

    Here you need to select the “Execution Criteria” in the left list and then you can see at the bottom of the page the set of collectors that are enabled for a test run.

    In this list you need to select the “Code Coverage” item and mark the enabled check box. In the 2008 ide you would direct see the assemblies that are part of the coverage gathering during the run. In the 2010 dialog you can select the assemblies by first clicking on the “Code Coverage” row in the collectors list and then clicking the “Advanced…” button. Then you will see the more familiar dialog again as shown below:

    image 

    Here you need to pick the assembly that is under test and click “Ok”

    Now when you run another unit test you will see code coverage is now enabled.
    When you take  a further look into the set of collectors you might also see a set of new collectors that you have not seen before.

    image

    When you enable e.g. the video recorder, you will get an video capture of your computer while the test was running. While this is less interesting for a Unit test that has no UI interactions, this is very interesting when you create a new type of test called Code UI test that can run an previously recorded UI test and replay it on a test machine. You can see the channel 9 video that shows more about coded UI testing if you want some more information on that new feature.

    What is interested to see is enabling e.g. the Test Impact collector, that enables the Test Impact feature. Once this collector has run, you can see in the Visual Studio IDE a list of suggested tests based on code changes you have made to your local source. This enables you to run a minimum set of tests to verify changes you have made to the codebase. this test impact analysis can even be used during the Team Builds run e.g. every night on a server, so you can have a lean and mean build that runs only impacted tests to verify regression on previous tests.

    When you create a new Unit test in a solution you also might notice that there is a second “testsettings” file created called “TraceAndTestImpact.testsettings”. this file contains all the settings to run a set of unit tests with the correct settings that enable test impact analysis.

    Follow my new blog on http://fluentbytes.com

    Share this

Marcel de Vries

View profile

Related IT training

Go to training website

Related Consultancy solutions

Go to infosupport.com

Related blogs

  • Innovative patterns in software quality management

    Innovative patterns in software quality management Tom van den Berg - 2 months ago

  • Developing a Service Fabric service using another host

    Developing a Service Fabric service using another host Tim van de Lockand - 6 months ago

  • Adding a package to your private WinGet.RestSource feed…

    Adding a package to your private WinGet.RestSource feed… Léon Bouquiet - 11 months ago

Related downloads

  • Beslisboom voor een rechtmatig ‘kopietje productie’

  • Klantreferentie: Remmicom zet wetgeving om in intellige…

  • Klantreferentie RDW: Samenwerken voor veilig en vertrou…

  • Klantreferentie BeFrank: Strategische IT voor een innov…

  • Wie durft te experimenteren met data in de zorg?

Related videos

  • mijnverzekeringenopeenrij.nl

    mijnverzekeringenopeenrij.nl

  • Winnaar | Innovation Projects 2017

    Winnaar | Innovation Projects 2017

  • Explore | Info Support & HAN & Poliskluis

    Explore | Info Support & HAN & Poliskluis

  • LifeApps bij HagaZiekenhuis

    LifeApps bij HagaZiekenhuis

  • Info Support | Bedrijfsfilm

    Info Support | Bedrijfsfilm

Nieuwsbrief

* verplichte velden

Contact

  • Head office NL
  • Kruisboog 42
  • 3905 TG Veenendaal
  • T +31 318 552020
  • Call
  • Mail
  • Directions
  • Head office BE
  • Generaal De Wittelaan 17
  • bus 30 2800 Mechelen
  • T +32 15 286370
  • Call
  • Mail
  • Directions

Follow us

  • Twitter
  • Facebook
  • Linkedin
  • Youtube

Newsletter

Sign in

Extra

  • Media Library
  • Disclaimer
  • Algemene voorwaarden
  • ISHBS Webmail
  • Extranet
Beheer cookie toestemming
Deze website maakt gebruik van Functionele en Analytische cookies voor website optimalisatie en statistieken.
Functioneel
Altijd actief
De technische opslag of toegang is strikt noodzakelijk voor het legitieme doel het gebruik mogelijk te maken van een specifieke dienst waarom de abonnee of gebruiker uitdrukkelijk heeft gevraagd, of met als enig doel de uitvoering van de transmissie van een communicatie over een elektronisch communicatienetwerk.
Voorkeuren
De technische opslag of toegang is noodzakelijk voor het legitieme doel voorkeuren op te slaan die niet door de abonnee of gebruiker zijn aangevraagd.
Statistieken
De technische opslag of toegang die uitsluitend voor statistische doeleinden wordt gebruikt. De technische opslag of toegang die uitsluitend wordt gebruikt voor anonieme statistische doeleinden. Zonder dagvaarding, vrijwillige naleving door uw Internet Service Provider, of aanvullende gegevens van een derde partij, kan informatie die alleen voor dit doel wordt opgeslagen of opgehaald gewoonlijk niet worden gebruikt om je te identificeren.
Marketing
De technische opslag of toegang is nodig om gebruikersprofielen op te stellen voor het verzenden van reclame, of om de gebruiker op een website of over verschillende websites te volgen voor soortgelijke marketingdoeleinden.
Beheer opties Beheer diensten Beheer leveranciers Lees meer over deze doeleinden
Voorkeuren
{title} {title} {title}