You can debug a test class as you would any class. After you set your breakpoints in the test class you can run your unit test in the debugger and step through the code to locate problems in your test classes.
Alternatively, you can right-click the test class node in the Projects window and choose Debug Test File (Ctrl-Shift-F6).
When you choose Debug Test File the IDE starts the test in the debugger and opens the Debugging window.