Chapter 11Unit Testing Code Downloads for this Chapter

The code downloads for this chapter are found at on the Download Code tab. The code and any related support files are located in their own folder for this chapter.

Application testing is one of the most important parts of writing software. Research into the costs of software maintenance have revealed that a software defect can cost up to 25 times more to fix if it makes it to a production environment than if it had been caught during ­development. At the same time, a lot of testing involves repetitive, dull, and error-prone work that must be undertaken every time you make a change to your code base. The easiest way to counter this is to produce repeatable automated tests that can be executed by a computer on demand. This chapter looks at a specific type of automated testing that focuses on individual components, or units, of a system. Having a suite of automated unit tests gives you the power to verify that your individual components all work as specified even after making radical changes to them.

Visual Studio 2015 has a built-in framework for authoring, executing, and reporting on test cases. This chapter focuses ...

Get Professional Visual Studio 2015 now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.