Review Questions

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?

  1. To make sure that all methods of the class return accurate results with a range of valid input values and that they handle errors correctly when given invalid input data

  2. To create performance benchmarks for each of your functions, to make sure they meet performance targets set forth in the functional specification

  3. To make sure that any changes or fixes that you make in one component do not cause problems in other parts of the application

  4. To test the interfaces between each set of components that will exchange data, to make sure that correct values are being passed and return values are interpreted correctly

athe 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. 

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?

  1. To make sure that all methods of the class return accurate results with a range of valid input values and that they handle errors correctly when given invalid input data

  2. To create performance benchmarks for each of your functions, to make sure they meet performance targets set forth in the functional specification

  3. To make sure that any changes or fixes that you make in one component do not cause problems in other parts of the application

  4. To test the interfaces between each set of components that will exchange data, to make sure that correct values are being passed and return values are interpreted correctly

dthe 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. 

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?

  1. To make sure that all methods of the class return accurate results with a range of valid input values and that they handle errors correctly when given invalid input data

  2. To create performance benchmarks for each of your functions, to make sure they meet performance targets set forth in the functional specification

  3. To make sure that any changes or fixes that you make in one component do not cause problems in other parts of the application

  4. To test the interfaces between each set of components that will exchange data, to make sure that correct values are being passed and return values are interpreted correctly

cthe 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. 

When testing your application for localization considerations, which one of these is not something that you need to be concerned about?

  1. Making sure that text strings are not embedded in the source code

  2. Stress testing the application for maximum user load

  3. Making sure that dates are interpreted correctly

  4. Making sure that the user interface can handle text strings of varying lengths

btesting 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. 

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?

  1. You must have a copy of Visual Studio .NET on the remote machine in order to do debugging.

  2. You must have a copy of the type library for the component on your local machine.

  3. You do not have Debugger User privileges on the remote server.

  4. You do not have Administrator privileges on the remote server.

cremote 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. 

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?

  1. Set the test application as the startup project.

  2. Set the XML Web service as the startup project.

  3. Add a <DebuggerStepInto()> attribute to the proxy class.

  4. Remove the <DebuggerStepThrough()> attribute from the proxy class.

dthe - 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. 

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?

  1. Use Trace.Warn to highlight important messages.

  2. Use Trace.WriteLine to separate messages.

  3. Use Trace.WriteLineIf to separate messages.

  4. Use Trace.AutoFlush = True to separate messages.

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. 

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?

  1. Uncheck the Define TRACE Constant check box in the project Property Pages dialog box.

  2. Add the #Const TRACE = True declaration to your application.

  3. Add an <assert> tag with appropriate value settings to the application configuration file.

  4. Add a <trace> tag with appropriate value settings to the application configuration file.

cadd 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. 

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?

  1. Debug Ø Windows Ø Immediate

  2. Debug Ø Windows Ø Watch

  3. View Ø Other Windows Ø Output

  4. View Ø Other Windows Ø Command Window

coutput from the defaulttracelistener is sent to the output window.

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?

  1. You did not call the WriteLine method of the TextWriterTraceListener.

  2. You did not call the Flush method of the TextWriterTraceListener.

  3. You did not call the Close method of the file.

  4. You did not call the Dispose method of the file.

byou 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. 

What happens when you set the Level property of a TraceSwitch to TraceError?

  1. Output will be written only if there is a runtime error in the application.

  2. Output will be written only if the Trace.Write statement is in an error handler.

  3. All output messages will be written as message boxes that force the application to end.

  4. Output messages will only be written if you set the trace level to 1.

dyou 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. 

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?

  1. Use Trace.Write statements in your code to log messages during application execution, use a TraceListener to direct output to a log, and use a TraceSwitch to control when output is produced.

  2. Use Trace.Assert statements in your code to log messages during application execution, use a TraceSwitch to direct output to a log, and use a TraceListener to control when output is produced.

  3. Use Trace.Write statements in your code to keep track of the performance information and use Debug.Write statements to log errors.

  4. Use Debug.Write statements in your code to keep track of the performance information and use Trace.Write statements to log errors.

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. 

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?

  1. You cannot debug the DLL; the ASP.NET developers will have to do that when they debug their ASP.NET pages.

  2. Set a breakpoint and start the application normally; you will go into Break mode at the appropriate line of code.

  3. Use the project Property Pages dialog box to specify ASP.NET debugging.

  4. Use the project Property Pages dialog box to designate an external program that references and will call functions in the DLL.

da 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. 

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?

  1. Capture incoming SOAP requests in the AfterDeserialize stage, and outgoing SOAP responses in the BeforeSerialize stage.

  2. Capture incoming SOAP requests in the BeforeDeserialize stage, and outgoing SOAP responses in the AfterSerialize stage.

  3. Capture incoming SOAP requests in the AfterSerialize stage, and outgoing SOAP responses in the BeforeDeserialize stage.

  4. Capture incoming SOAP requests in the BeforeSerialize stage, and outgoing SOAP responses in the AfterDeserialize stage.

bto 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. 

The SoapExtensionAttribute.Priority property is used for what purpose?

  1. To determine at which stage of SOAP message processing the extension code is run.

  2. To determine whether a SOAP message should be written to a log file.

  3. When you have specified multiple SOAP extensions for a single Web method, it determines the order in which the extensions are run.

  4. When you have specified multiple SOAP extensions for a single Web method, it determines which one of the extensions is run.

cthe soapextensionattribute.priority property determines the order in which extension code is run, when there are multiple soap extensions specified for a single web method.

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.



MCAD/MCSD(c) Visual Basic. NET XML Web Services and Server Components Study Guide
MCAD/MCSD: Visual Basic .NET XML Web Services and Server Components Study Guide
ISBN: 0782141935
EAN: 2147483647
Year: 2005
Pages: 153

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net