Home » Microsoft » 70-498 » Which three practices should you implement?
You are developing a new application. The application will require rapid changes after it is in production.
You need to implement practices that promote high quality and ensure the code is maintainable.
Which three practices should you implement? (Each correct answer presents part of the solution. Choose three.)
A. Refactor code based on code metrics from the maintainability index.
B. Keep the code tightly coupled.
C. Create as few classes as possible.
D. Create unit tests and monitor code coverage.
E. Create as few assemblies as possible.
F. Refactor code based on code clone analysis.
Correct Answer: ADF
Explanation/Reference:
A: Using Code Metrics feature of Visual Studio (or Code Metrics Power Tools if you don’t have Premium or Ultimate edition) you can get some good information about which unit of code or components are candidates for refactoring.
Developers can use Visual Studio Application Lifecycle Management to generate code metrics data that measure the complexity and maintainability of their managed code. Code metrics data can be generated for an entire solution or a single project.
Reference: Visual Studio, Measuring Complexity and Maintainability of Managed Code
F: The code clone tool searches for duplicate or highly similar code in Visual C# and Visual Basic projects throughout your Visual Studio solution. You can often refactor the code to eliminate the duplication for a more maintainable solution.
Note: Code refactoring is the process of restructuring existing computer code changing the factoring without changing its external behavior. Refactoring improves nonfunctional attributes of the software.
D: To determine what proportion of your project’s code is actually being tested by coded tests such as unit tests, you can use the code coverage feature of Visual Studio. To guard effectively against bugs, your tests should exercise or ‘cover’ a large proportion of your code.
Reference: Using Code Coverage to Determine How Much Code is being Tested