1. | As a developer on a large team, you are required to perform unit testing on all of your code before other developers can work with it. What is the goal of unit testing?
|
|
2. | After you check in a component that you have completed, your testers perform integration testing with related components. What is the goal of integration testing?
|
|
3. | You are a tester on a large team that is in the later phases of developing a complex application. The team is currently occupied in fixing bugs that have been discovered by beta testers. You are performing regression testing on the application as each bug fix is completed. What is the goal of regression testing?
|
|
4. | When testing your application for localization considerations, which one of these is not something that you need to be concerned about?
|
|
5. | You need to debug a component that is running on your web server. You have installed the Visual Studio .NET remote components on the server, but you are still getting error messages and are unable to debug the remote component. What is the most likely cause?
|
|
6. | You are debugging your XML Web service code by using a test client application. When you step through your code in Break mode, you would like to see what code in the Web service proxy class is being executed. How can you cause Visual Studio .NET to step into the proxy class?
|
|
7. | You have placed Trace.Write statements in your application to write output to a text file, but you notice that the text file is difficult to read because all the messages run together. How can you quickly fix this problem?
|
|
8. | When you are developing applications, you frequently use Trace.Assert statements in your code to alert you when there are unexpected conditions during application execution. These statements cause a problem during automated testing—they cause the application to go into Break mode and display a message box. How can you get the information provided by these Trace.Assert messages and still allow your applications to run uninterrupted?
|
|
9. | During development of your application, you are content to allow debug and trace output to be written to the DefaultTraceListener. Where should you look for this output in the Visual Studio .NET menus?
|
|
10. | You have added a TextWriterTraceListener to your application and have Trace.Write statements in most procedures to track application execution. You run your application to test various features, but when you look at the error log text file, it is blank. What is the most likely cause of this problem?
|
|
11. | What happens when you set the Level property of a TraceSwitch to TraceError?
|
|
12. | You would like to add instrumentation to your application for performance monitoring, and to log significant errors that might occur while your application is in use. Which would best describe a good strategy for this?
|
|
13. | You have created a component (DLL) that will be used by ASP.NET developers. Before releasing this component for others to use, you need to debug it to resolve some intermittent errors. How should you set up the Visual Studio .NET IDE to debug a DLL?
|
|
14. | In order to capture the XML markup of a SOAP message, you need to have SOAP extension code run at the appropriate stage of processing. At which stages should you run your code?
|
|
15. | The SoapExtensionAttribute.Priority property is used for what purpose?
|
|
Answers
1. | A The goal of unit testing is to make sure that each component performs correctly before it is put into use by other developers. This is typically done by testing the functions with a range of valid and invalid input values. Unit testing finds and fixes defects at the earliest possible point in the development cycle. |
2. | D The goal of integration testing is to test the interfaces between each set of components to make sure values are being passed correctly. By testing the interaction between each pair of components, it is easier to determine where a problem is occurring. |
3. | C The goal of regression testing is to make sure that any changes or bug fixes made to one component in the application do not cause errors to occur in other parts of the application. Regression testing involves retesting the entire application after changes are made to make sure that no new errors have been introduced. Creating performance benchmarks and testing performance is a separate form of testing. |
4. | B Testing for maximum user load is part of testing for scalability. Localization requires translating your user interface from one language to another. Therefore, strings should not be hard-coded; they should be stored in a resource file, and the user interface should be able to accommodate text strings of varying lengths. You should also make sure that dates, numbers, and currency indicators are interpreted correctly. |
5. | C Remote debugging requires that you install the Visual Studio .NET remote components on the remote machine and that you are a member of the Debugger Users group on the remote machine. You do not need a full copy of Visual Studio .NET or a type library for debugging, and you do not need to have Administrator privileges on the remote server. |
6. | D The <DebuggerStepThrough()> attribute causes code in the proxy class to be skipped over during debugging. You can remove this attribute to step into the proxy class. Setting either of the applications as the startup project will have no effect on the debugging behavior, as concerns the proxy class. <DebuggerStepInto()> is not a valid attribute name. |
7. | B Trace.WriteLine will automatically place a line-ending character after each message. Trace.WriteLineIf is used when you want to evaluate a conditional expression to determine whether the message should be output. Trace.Warn is not a valid method of the Trace class. The Trace.AutoFlush property does not affect message formatting. |
8. | C Add an <assert> tag to the application configuration file that has the appropriate values set. This will redirect the Assert message to a text log file. Unchecking the Define TRACE Constant check box will suppress all trace messages in your application, producing no output. Adding the #Const TRACE = True is unnecessary in Visual Studio .NET because this option is set automatically. The <trace> tag in a configuration file does not control the output of the Assert method. |
9. | C Output from the DefaultTraceListener is sent to the Output window. |
10. | B You must call the Flush and/or Close methods of the TextWriterTraceListener to cause the output to be written to the file and for the file to be released. You do not need to create a separate file object for the trace listener, so you do not need to call any methods on the file itself. |
11. | D You can test for the Level property of a TraceSwitch and use that information to determine which messages should be output. Trace statements can be placed in an error handler or anywhere else in code. Trace statements are output during the normal course of application execution, not only if a runtime error occurs. Message boxes that force the application to break are the typical behavior of Trace.Assert statements. |
12. | A Trace.Write statements will output messages to a TraceListener, which determines where the output is sent. TraceSwitches are used to turn output on and off, or to filter messages based on a priority level. Trace.Assert statements are used to test conditions during application execution; they do not work with TraceListeners or TraceSwitches. It is preferred to use Trace statements for instrumentation that will remain in the application; Debug statements are for the developer’s use and are not included in the compiled executable when a Release build is produced. |
13. | D A DLL (created by a Visual Studio .NET Class Library project) can be debugged in Visual Studio .NET by using the project Property Pages dialog box to specify an external program that will reference and use the DLL. This can be any type of client application, either a Windows form, WebForm, or console application. A DLL project cannot be started directly in Visual Studio .NET. |
14. | B To capture the XML markup of incoming SOAP requests, you must run code in the BeforeDeserialize stage, while it is still in its XML wire format. For outgoing messages, the correct stage is AfterSerialize. |
15. | C The SoapExtensionAttribute.Priority property determines the order in which extension code is run, when there are multiple SOAP extensions specified for a single Web method. |