Chapter 6. Introduction to Software Development

WHAT'S IN THIS CHAPTER?

  • New Visual Studio 2010 features of most interest to developers

  • Overview of test impact analysis

  • Code analysis improvements

  • Profiler enhancements

  • Tools for database development and extensibility to support multiple database vendors

  • Advanced debugging with IntelliTrace

  • Code editor improvements

  • Improvements to the "test-first" experience

Visual Studio has traditionally been the application to support development on the Microsoft platform with the tools to create and compile applications. However, over the course of many years, organizations often develop large and complex code bases. The code is typically edited by a number of developers as the application moves through the lifecycle, and the application also changes to meet the changing business requirements.

Soon, simply having the tools at your disposal to create applications is no longer enough. You need tools to help you to analyze existing code bases, and to help you to identify hot spots that might be causing you problems. You need tools to help identify the code with known maintainability or security issues. You need something that will help you make sense of this mass of code that you have inherited, and have confidence that not only does the application still work after making your changes, but that it is more efficient, and the quality of the code is improving as your team matures. This is where Visual Studio 2010 comes in.

Visual Studio 2010 is also very useful in new "green field" development, on the rare occasions that you are starting a project from scratch. The same tools that help you work with large code bases can be used from day one to ensure that all new code created maintains the same standards you envisaged during that project kick-off meeting. As the code base grows, and more developers come onto the project, you can ensure that you are not spending time prematurely optimizing code, but rather easily identifying new performance bottlenecks as they occur.

Visual Studio 2010 provides developers of both managed and unmanaged code with an enhanced set of advanced tools for identifying inefficient, insecure, or poorly written code. You can specify coding best practices, and ensure that those are checked with every build, as well as ensuring that the code is fully unit tested every time.

With Visual Studio 2010, Microsoft also acknowledges that development isn't just about code running on the client or on the Web server. An important factor of the development process occurs in the database. With Visual Studio 2010, you are able to do the same kind of change management and unit testing with your database schema as you can with source code. You may also gain a better understanding of your existing database schemas, and you have the capability to migrate any changes to those schemas in a repeatable, reversible, scripted manner.

The next few chapters will introduce the additional functionality provided by Visual Studio 2010 for the developer.

Initially, the discussions in the following chapters will focus on improving the quality and maintainability of your code through the unit testing capabilities included in Visual Studio. The discussions then examine potential issues in your code base using the code analysis and code metrics tools in both managed and unmanaged components. Then, you will learn about profiling and analyzing how your code is performing to determine which areas need the most attention. You will also learn about the advanced tools available to support database development, testing, and deployment in the team environment. Finally, you will become familiar with the advanced debugging tools.

WHAT'S NEW FOR DEVELOPERS IN VISUAL STUDIO 2010

Visual Studio 2010 introduces a number of new and important features. Obviously, the whole of Team Foundation Server is vitally important in the daily work of a developer (as is discussed Chapter 17), but there are a number of new tools and features also worth mentioning, including the following:

  • Test impact analysis

  • Improved code analysis

  • Profiler enhancements

  • Database extensibility

  • Improved "test first" development experience

  • Advanced debugging

TEST IMPACT ANALYSIS

Once you have established a set of programmatic unit tests for your code, the library of tests can become very large. Visual Studio 2010 checks which unit tests have been affected by a change to your managed source code and highlights this subset of the total test suite as recommended tests in the Test View window. When you have re-run your unit tests, it will highlight which ones have been verified as working. Chapter 7 provides more information on unit testing and test impact analysis.

IMPROVED CODE ANALYSIS

Earlier versions of Visual Studio shipped with code analysis functionality to allow developers to analyze source code to check for common issues and security flaws. In Visual Studio 2010, custom Code Analysis Rules Sets have been added that make it much easier to determine on which rules your development team should concentrate. Chapter 8 focuses on this.

PROFILER ENHANCEMENTS

The overall user interface (UI) experience of the profiler functionality in Visual Studio has been significantly improved, making it much easier to quickly understand the large amount of data captured in the code profiling functionality, and zoom into areas of concern. In addition, client-side JavaScript performance may be profiled, as well as the interactions between tiers in a typical n-tier system. Support for multi-threaded applications is much improved, including finding issues such as thread blocking. The code profiling experience is also now available when running inside a virtual machine. Chapter 9 provides more information on the profiler.

DATABASE EXTENSIBILITY

The database development functionality is now much more extensible. This allows for third-party developers to develop a Database Schema Provider to enable offline design, development, testing, and change management of database systems other than SQL Server. Quest Software provides Oracle support, IBM has demonstrated DB2 support, and Microsoft has indicated that it is working with other partners as well. Chapter 10 provides more information on database development, testing, and deployment.

Note

For information on additional Database Schema Providers, see http://msdn.microsoft.com/en-us/teamsystem/dd408380.aspx.

ADVANCED DEBUGGING WITH INTELLITRACE

Examined in depth in Chapter 11, the new advanced debugging features of Visual Studio 2010 play a similar role to that of a black box in an airplane. The debugger keeps track of a number of interesting events during the execution of your managed code program, thus allowing you at a later time to play back the execution and see what happened at those points. You can also load and debug a trace debugging log file attached to a bug logged by someone testing the application to inspect what happened in the run up to the crash.

IMPROVED "TEST-FIRST" DEVELOPMENT EXPERIENCE

While a pretty basic function of any Integrated Development Environment, the improvements in the code editor are worth mentioning in any recap of new features. The code editor has been re-implemented in Windows Presentation Foundation (WPF) and uses the Managed Extensibility Framework (MEF) for extensibility. Along the way, the experience when writing in a test-first style is much improved. It is now much easier to generate method stubs based on a call in a unit test that has not yet been implemented in the target class. Not only that, but the code navigation experience has received significant attention, making it much easier to navigate around your large code base than in previous releases of Visual Studio.

SUMMARY

This chapter provided a quick look at the areas of Visual Studio 2010 that will be of most interest to developers, and provided a preview of what to look forward to in this next section of the book.

Chapter 7 focuses in detail on the unit testing, why you should care about it as a developer, and what tools Visual Studio provides to not only help you unit test your code, but also to learn which code is being tested, and what tests were impacted by any changes made to your code.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset