Question 112


4.1.2 Question

Multiple Choices

You inherited a working application that began as a proof of concept but was eventually adopted as a production application without being refactored. Many new requirements need to be added. As part of your initial analysis, you notice a lot of problems with bad data.

Which solutions will help remediate this issue? (Choose all that apply.)

  • A. Running the Performance Wizard to sample CPU usage.
  • B. Adding code contracts to ensure that the input parameters have expected values
  • C. Adding code contracts to ensure that the return values meet specific criteria
  • D. Adding code contracts to ensure that objects do not become invalid during process
  • E. Running the Visual Studio profiler to analyze application flow

Answer:

BCD
Explanation
A. Incorrect: The Performance Wizard does not support management or identify data issues.
B. Correct: Preconditional code contracts ensure that incorrect information is not submitted to a method. This helps eliminate the possibility of bad data.
C. Correct: Postconditional code contracts ensure that incorrect information is not returned from a method. This helps eliminate the possibility of bad data.
D. Correct: Invariant code contracts ensure that objects do not get to an invalid state. This helps eliminate the possibility of bad data.
E. Incorrect: The Visual Studio profiler does not provide any support for managing or identifying data issues.