MSDN Magazine - October 2008 - (Page 59) VENDOR-SPONSORED CONTENT Visual Studio Team System 2008 Development Edition and Database Edition Key Features Development Edition • Static and Dynamic Code Analysis to improve code quality and security • Code Profiler to measure code performance and find performance bottlenecks • Unit Testing with code coverage to test code early and often and measure the effectiveness of your tests • Code Metrics to identify complex and error-prone code and measure code quality Database Edition • Database Refactoring to manage renaming, schema move and more • Schema Compare to keep two schema versions synchronized • Data Compare to keep the data in two databases synchronized • Offline Database Projects for change isolation • Data Generator to define sets of repeatable test data • Schema reporting to easily document your database schema will give you a basic understanding of the business needs the application solves for its users. While you’re at it, you should quickly look at some of the reported bugs that have already been fixed. See what types of bugs have been reported, and what requirements they’ve been associated with. This will start to give you an idea of the weaknesses in the application, as well. You might even run some ad-hoc reports against the data warehouse to determine which code has been associated with a large number of bugs. Bugs tend to cluster around areas of poor code, and these quick reports will show you which code files to watch out for. Open up the Class Designer to get a look at the existing class hierarchy. With this view you’ll begin to understand the overall structure of the existing solution. Next you can run the solution through the code metrics engine. Take a look at the Depth of Inheritance metric. This will show you how deep the inheritance hierarchies go, and will alert you to possible maintenance or other issues if the inheritance goes too deep. Also, look at the Class Coupling metric. This will help you understand if the architecture is loosely coupled, or if you’ll need to pay extra attention to side effects as you code. So far, you’ve just begun to examine the code base, and already you’re beginning to get a solid understanding of the structure and flow of the code. You can now use Visual Studio Team System 2008 Development Edition and Database Edition to look more deeply at the code itself and start to look at the quality of the code in the application. Once again, the code metrics will help. Take a look at the Cyclomatic Complexity metric. You’ll need to drill down to the method level to get the best understanding. If you have many methods with high complexity, it could mean that the previous developer was trying to accomplish too much in each method. This makes understanding the code and debugging problems more difficult. On the other hand, if the cyclomatic complexity is low, you should be getting a more comfortable feeling about the understandability and maintainability of the code. Then glance over to the Lines of Code metric. This one is useful at many resolutions. At the method level, it will give you insight as the bulk of each discrete function. At the class level, it will provide insight as to which classes do the most work, and are likely the more complex classes. And finally, at the project level it will provide a rough estimate of the size of the project. Visual Studio Team System 2008 Development Edition Helps You Increase the Quality of Your Code You have seen that using just some of the features of Visual Studio Team System 2008 Development Edition and Database Edition you can determine the quality of an existing code base, but how about making sure the quality is good to begin with? Visual Studio Team System 2008 Development Edition and Database Edition provide tools to enhance unit testing (for both code and the database) and analysis tools to determine where problems are likely to occur in the future. This lets you proactively address potential issues before they ever become issues and find issues in your existing code faster. Static Code Analysis tools let you verify your code (and database code) against known security, portability, design, naming and globalization areas, to name just a few. If the code fits the pattern for these known issues, the Development Edition provides you specific solutions on how to change the code to alleviate the issue before it becomes a problem. This not only increases quality on the front end, but reduces the complexity of maintenance tasks after release. You can perform this analysis as part of the regular Team Foundation Server Build process to help you stay on top of these issues with very little effort on your part. In addition, you can prevent these from ever creeping into your code through the use of Check-In policies in Team Foundation Server, which prevent code check-in if the code violates a given set of conditions! Visual Studio Team System 2008 Development Edition can help you verify that your code works the way it should. Unit testing is available in Visual Studio
For optimal viewing of this digital publication, please enable JavaScript and then refresh the page. If you would like to try to load the digital publication without using Flash Player detection, please click here.