98 379 Enu 2.2 LP
98 379 Enu 2.2 LP
98 379 Enu 2.2 LP
Unit testing
• Unit tests are automated tests that verify functionality at the
component, class, method, or property level.
• The primary goal of unit testing is to take the smallest piece of
testable software in the application, isolate it from the remainder of
the code, and determine whether it behaves exactly as you expect.
• Each unit is tested separately before integrating them into
components to test the interfaces between units.
• Unit tests should be written before (or very soon after) a method is
written. Often, developers building the class or method designs the
unit test themselves.
LECTURE Lesson 2.2
Scenario:
Jay Henningsen is managing a team of developers working on an
application that will organize recreational basketball leagues and maintain
team and individual statistics as the season progresses. The team has
broken the algorithm down into pieces, with each member building a
method to solve one part of the problem. Using Microsoft® Visual Studio®
testing tools will be critical for the success of the team. Jay has decided to
ask each member to review the Test Explorer.
Directions:
Create a new project in Visual Studio 2012. Name the project Lesson 2.2-IC.
• Complete the Quick start: Test driven development with Test Explorer
http://msdn.microsoft.com/en-us/library/hh212233.aspx
IN-CLASS ACTIVITY Lesson 2.2
Follow up:
After completing the walkthrough activity, share your experiences with
a partner.
MSDN® Resources
Unit Testing http://msdn.microsoft.com/en-
us/library/aa292197.aspx
Unit Testing: Testing the Inside http://msdn.microsoft.com/en-
us/library/jj159340.aspx
Integration Testing http://msdn.microsoft.com/en-
us/library/aa292128.aspx
Unit testing, component level http://blogs.msdn.com/b/raulperez/archive
testing and UI testing, what to /2010/04/29/unit-testing-component-
use and when level-testing-and-ui-testing-what-to-use-
and-when.aspx