Practice Questions

Question 1

You are developing an application for use by users in many offices. You have performed top-down and bottom-up code testing, eliminating all identified errors and configuring the application to break on unhandled exceptions. After this, you want to provide a statement of functionality to the Chief Information Officer. Which of the following is the most correct statement regarding your application?

  • A. The application is bug free.

  • B. The application has no known errors and is very reliable.

  • C. The application has no known errors and is very robust.

  • D. The application has no known errors and will stop on unhandled exceptions.

A1:

Answer D is correct. You have ensured that all known errors have been corrected, and you have provided support to break the code's execution on unhandled exceptions. Answer A is incorrect because you cannot prove through testing that no other errors exist, because your testing process may not have encompassed all possible types of errors a user may create. Answers B and C are potentially correct, but neither is the most correct answer in this case. If your application repeatedly functions as expected, you may consider it to have fulfilled the reliability requirement for testing, and its ability to handle invalid data or incorrect actions would define its robustness. However, because you are not told the specific testing methods used in this scenario, you cannot be certain of the reliability or robustness of the application.

Question 2

Which of the elements of testing involve the program's response to valid data? [Select all that apply.]

  • A. Correctness

  • B. Reliability

  • C. Robustness

  • D. Integration

A2:

Answers A and B are correct. Correctness is determined by the ability of a program to return an expected value for a given set of valid data, whereas reliability involves the application's ability to do this over multiple iterations. Robustness is a measure of the application's ability to handle invalid data or incorrect responses, thus making answer C incorrect. Answer D is incorrect because integration testing involves checking how modules fit together rather than checking the application's response to particular valid data.

Question 3

Which type of testing should you perform on an application after fixing a bug reported by a user? (Assume that fixing the bug does not require writing an entire new module.)

  • A. Unit

  • B. Integration

  • C. Regression

  • D. Robustness

A3:

Answer C is correct. Regression testing is performed after any change in an application to ensure that the application performs as desired and to ensure that the change did not introduce any new errors. This process involves rerunning all the existing tests against the code and comparing the results to those before the change. Unit testing involves the testing of a single module or code segment, whereas integration testing involves testing greater levels of complexity when integrating units into larger structures. Therefore, answers A and B incorrect. Answer D is incorrect because robustness is a measure of the application's response to invalid data rather than a type of testing.

Question 4

If you start with unit testing and continue expanding your testing through to the full integration of all modules, which form of integration testing would occur?

  • A. Bottom-up

  • B. Top-down

  • C. Umbrella

  • D. Regression

A4:

Answer A is correct. Bottom-up testing involves testing the individual code elements first and then testing in greater levels of integration. Top-down testing involves testing functionality from the front end of an application, using code stubs as placeholders for pending code elements. Therefore, answer B is incorrect. Answer C is incorrect because umbrella testing involves a sequenced or multiphase development process where a limited form of an application is tested and released, with later versions released as added functionality is tested . Answer D is incorrect because regression testing covers retesting an application that has already been through a full testing pass.

Question 5

Which member of the Trace and Debug classes is used to determine whether a specified condition has been met?

  • A. Assert

  • B. Close

  • C. Fail

  • D. Flush

A5:

Answer A is correct. The Assert method returns a True value if a specified condition is met. Answer B is incorrect because the Close method is used to flush the output buffer and close all trace listeners. Answer C is incorrect because the Fail method is used to return an error message. Answer D is incorrect because the Flush method is used to flush the output buffers and pass the values to the trace listeners.

Question 6

Which object type should be used to write an output message to a flat file?

  • A. The DefaultTraceListener class

  • B. The TextWriterTraceListener class

  • C. The EventLogTraceListener class

  • D. The TraceListener class

A6:

Answers B is correct. The TextWriterTraceListener object class is used to output messages to objects deriving from the Stream class, including external flat files. Answer A is incorrect because the DefaultTraceListener class is used to write messages to the Output window. Answer C is incorrect because the EventLogTraceListener class is used to write output to the Windows Event Log. Answer D is incorrect because the TraceListener class is a MustInherit class that cannot be used directly in your code.

Question 7

If you select a trace level of 3, which types of trace messages will be returned? [Select all that apply.]

  • A. Error

  • B. Informational

  • C. Verbose

  • D. Warning

A7:

Answers A, B, and D are correct. Trace level 3 ( Info ) will return informational, warning, and error messages. In order to return verbose messages, you must set the trace level to 4 (Verbose). Therefore, answer C is incorrect.

Question 8

Which property of the TraceSwitch class will return a True value if the trace level is set to 1? [Select the best answer.]

  • A. The TraceError property

  • B. The TraceInfo property

  • C. The TraceVerbose property

  • D. The TraceWarning property

A8:

Answer A is correct. The TraceError property returns True if the Level property is set to anything other than 0. Answers B and C are incorrect because the TraceInfo property returns True only if the trace level is 3 or 4, and the TraceVerbose property returns True for a trace level of 4 only. The TraceWarning property returns True only when the Level property is greater than 1. Therefore, answer D is incorrect.

Question 9

Your program is running in Debug mode and you are stepping through the application to locate an error. The next few lines of code are as follows :

 Dim I As Integer = GetResults() txtResult.Text = I If I > 0 Then 

You are certain that the error does not lie in the GetResults method. Which debugging action should you take to assign the return value of GetResults to I without viewing the code within GetResults ?

  • A. Continue

  • B. Step Over

  • C. Step Into

  • D. Step Out

A9:

Answer B is correct. The Step Over action will execute the called method without displaying the code in the method or forcing you to go through the method one line at a time. Answer A is incorrect because the Continue action will end the debugging session and return to normal program execution. Answer C is incorrect because Step Into will cause the debugger to load the GetResults method and step through it one line at a time. Answer D is incorrect because Step Out is used to abandon a Step Into action.

Question 10

Which windows can be used to display information about the variables in use at the current breakpoint? [Select all that apply.]

  • A. Autos

  • B. Call Stack

  • C. Immediate

  • D. Locals

  • E. Watch

A10:

Answers A, C, D, and E are correct. The Autos window shows information on the variables in the current and previous statements. The Immediate window can be used to return values of current variables through the Command window. The Locals window shows all variables local to the current execution context, and each Watch window can display the value of a specified variable. Answer B is incorrect because the Call Stack window is used to display the path of execution used to get to the current location in the application's execution.



Developing and Implementing WindowsR-based Applications with Visual BasicR. NET and Visual StudioR. NET Exam CramT 2 (Exam 70-306)
Developing and Implementing WindowsR-based Applications with Visual BasicR. NET and Visual StudioR. NET Exam CramT 2 (Exam 70-306)
ISBN: N/A
EAN: N/A
Year: 2002
Pages: 188

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