Consulting Training Blog Careers About Us Contact Us

Unit Testing in Visual Studio 2012 Training

Course ID: ACC-UTVS2012
Duration: 2 Days

Upcoming Classes

Sorry, nothing scheduled right now. Click the Get Notified button below to be alerted when a class is scheduled.

Get Notified

On Site/Private

Can't find a class that fits right for you? Contact us to inquire about scheduling your own private class

Contact Us

Description

This two-day, instructor-led course provides students with the knowledge and skills to effectively use Visual Studio 2012 to design, write, and run high-quality .NET unit tests. The course focuses on the applicable features and capabilities of Visual Studio as it relates to unit testing and Test-Driven Development (TDD). This course also introduces other, popular unit testing tools and techniques, and demonstrates how they integrate with Visual Studio and your development lifecycle.

Bring This Course To You

For groups of 5 or more, let Intertech bring this course to your location. Customized versions tailored towards your objectives are also available.

Learn More

Learning Objectives

This course teaches students how to effectively design, write, and run high-quality unit tests using Visual Studio 2012. At course completion, attendees will have had exposure to:

  • Why unit tests are critical to software quality
  • How to effectively refactor within TDD
  • How unit tests and integration tests differ
  • Why and how to refactor legacy code
  • Popular unit testing frameworks
  • Happy path vs. sad path testing
  • The anatomy of a unit test
  • Testing boundary conditions
  • The 3A pattern (Arrange, Act, Assert)
  • Organizing tests and test assemblies
  • Assertions and expected exceptions
  • Behavior-Driven Development principles
  • Test class inheritance
  • How to use data-driven unit tests
  • Testing private methods
  • Why and how to calculate code coverage
  • Visual Studio 2012 test projects
  • Why and how to use test impact analysis
  • Visual Studio 2012 test windows and tools
  • Team Foundation Server support for testing
  • How basic and standard unit tests differ
  • Team Foundation Build support for testing
  • How and when to use categories and lists
  • Why and how to use continuous integration
  • How and when to use ordered tests
  • Using dummies, fakes, stubs, and mocks
  • Running tests and managing test results
  • Why and how to use Microsoft Fakes
  • The importance of Test-Driven Development
  • Why and how to use Rhino Mocks
  • Implementing TDD in Visual Studio 2012
  • Why and how to use Microsoft Pex
     

Audience

This course is intended for current software development professionals who are involved with building high-quality .NET applications. Students will use Visual Studio 2012 while learning how to design, write, and run unit tests. They will also learn many relevant practices and techniques, such as TDD, CI, refactoring, and how to test difficult code.

Prerequisites

Before attending this course, students should have experience or familiarity with:

  • Building a high-quality software product • Visual Studio 2012 (or an earlier version)
  • Writing, debugging, and maintaining code • Their organization’s development lifecycle
  • The Visual C# language
     

Course Outline

Unit Testing in .NET

This module introduces the concepts of unit testing and how it is supported by various unit testing frameworks and tools for .NET, including MSTest and NUnit. The anatomy of a unit test is also detailed in this module.

  • The role of the developer
  • Unit tests explained
  • .NET unit testing frameworks (MSTest.exe and others)
  • Writing unit tests

Unit Testing in Visual Studio 2012

This module introduces Visual Studio 2012 test projects, the testing windows, and the functionality for effectively writing and running unit tests and managing test results.

  • Testing support in Visual Studio 2012
  • Test projects
  • Test Explorer and other windows
  • Unit testing in Visual Studio 2012
  • Managing a large number of tests
  • Running tests
  • Managing test results

Test-Driven Development (TDD)

This module introduces Test Driven Development (TDD) and the business case for why you should practice it. Refactoring as well as a discussion of how to work with legacy code are also a part of this module.

  • TDD overview, benefits, and common objections
  • Implementing TDD in Visual Studio 2012
  • Refactoring
  • Legacy Code

Writing Good Unit Tests

Just knowing how to write unit tests and being disciplined in TDD is not enough. This module will demonstrate several other practices for ensuring that you write high-quality unit tests.

  • Know your code
  • Path testing (i.e. sad path)
  • Right BICEP
  • Testing for expected exceptions
  • Maintaining high-quality test code
  • Behavior-Driven Development (BDD)
  • BDD naming conventions
  • Organizing test libraries (assemblies)

Advanced Unit Testing Tools

This module examines additional unit testing features found in Visual Studio, including code coverage, data-driven unit tests, and test impact analysis. In addition, many unit-testing specific features in Team Foundation Server and Team Foundation Build will be part of the discussion.

  • Code coverage
  • Data-driven unit tests
  • Test impact analysis
  • Team Foundation Server
  • Testing check-in policy
  • Team Foundation Build
  • Build verification tests (BVTs)
  • Gated check-ins
  • Continuous Integration (CI)

Testing Difficult Code

This module introduces some tools and techniques for testing difficult code, such as code that can’t be tested without being hosted in another environment (i.e.ASP.NET, SharePoint, etc.)

  • The need to isolate code under test
  • Doubles (dummies, stubs, fakes, and mocks)
  • Mocking frameworks (Rhino Mocks, Moles, etc.)
  • Fakes framework for Visual Studio 2012 (Ultimate edition)
  • Microsoft Pex

Free Resources from Intertech

Free eBook: Can a Project Be Too Small for Test Automation?

Free eBook: Top Freeware Picks for Developers

Free Whitepaper: Java QA - Tools for Unit Testing

X