Saturday 15 October 2011

Debugging and Testing Questions Part 2

1. Why are there five tracing levels in System.Diagnostics.Trace Switcher?
The tracing dumps can be quite verbose. For applications that are
constantly running you run the risk of overloading the machine and the
hard drive. Five levels range from None to Verbose, allowing you to
fine-tune the tracing activities.

2. Where is the output of TextWriterTraceListener redirected?
To the Console or a text file depending on the parameter passed to the
constructor.

3. How do you debug an ASP.NET Web application?
Attach the aspnet_wp.exe process to the DbgClr debugger.

4. What are three test cases you should go through in unit
testing?

1. Positive test cases (correct data, correct output).
2. Negative test cases (broken or missing data, proper handling).
3. Exception test cases (exceptions are thrown and caught properly).

5. Can you change the value of a variable while debugging a C#
application?

Yes. If you are debugging via Visual Studio.NET, just go to Immediate
window.

No comments:

Post a Comment