Book Image

PowerShell Troubleshooting Guide

By : Mike Shepard
Book Image

PowerShell Troubleshooting Guide

By: Mike Shepard

Overview of this book

Table of Contents (15 chapters)
PowerShell Troubleshooting Guide
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Unit testing


Unit testing is the logical continuation of modularizing code. Once you have broken the problem into smaller pieces or units, the next step is to test those units. To perform unit testing means that we will write tests that exercise each unit with a variety of inputs that will ensure that the code is correct. One emphasis of unit testing is that the tests need to be automatic. That is, we're not reading a list of test cases off of a piece of paper and running the code with each to verify that the results are as expected. Unit tests are code and are just as important as the code being tested (and as such should be checked into your version control system). Developers are familiar with automated unit testing, but the use of unit tests by system administrators is growing. As system administration begins to involve more and more code, the knowledge that the code we use is correct is of utmost importance.

You might hear discussion of Test Driven Development (TDD), which relies on...