Book Image

Software Testing with Visual Studio Team System 2008

By : N Satheesh Kumar, Subashni. S
Book Image

Software Testing with Visual Studio Team System 2008

By: N Satheesh Kumar, Subashni. S

Overview of this book

<p>We all know that software testing is the most important part of the Software development life cycle and the quality of the end product is mostly dependent on how well we test our products. But, testing is neither an easy process nor remotely exciting for all the developers.<br /><br />For testing your applications on the Microsoft platform, Visual Studio Team System 2008 offers you a range of powerful tools for different types of testing. This Microsoft product makes the testing process easier as well as more exciting, not boring anymore.<br /><br />This concise guide will lead you through the bewildering range of features offered by Visual Studio Team System 2008 to test your software applications before going live. It is packed with simple examples and screenshots to get you comfortable with the VS Team System 2008 testing environment.<br /><br />The book introduces you to the main types of testing available in VS Team System 2008 for both desktop and web applications, and then walks you through deploying, running, and interpreting the results of tests. If you've been testing applications in Visual Studio 2005, the book will show you how you can move this easily to Visual Studio 2008.<br /><br />You will learn about the Unit test, Manual test, Web test, Load test, Ordered test, and Generic test, and the support for them in VS Team System 2008. By the end of the book you will be using the tools to manage and run your tests, collect and analyze your test results, and improve the reliability of your software applications.<br /><br />Later, you will prepare reports to monitor the quality of your software applications, using the available reporting templates in Visual Studio 2008 Team system and Team Foundation Server.</p>
Table of Contents (15 chapters)
Software Testing with Visual Studio Team System 2008
Credits
About the Authors
Preface
10
Working with Test Results

Preface

The first time we looked at the Visual Studio Team System 2008, we realized that there were lot of features that used to be different individual products on their own, that were very well integrated, and readily available under a single IDE. Some of these were available with earlier versions of Visual Studio, but this version is tightly integrated with the Team Foundation Server.

Microsoft Visual Studio Team System 2008 suite contains several tools that satisfy the needs of developers, testers, managers, and architects. Not only are the tools available, but they are also well integrated to collect information at every stage of the project life cycle and to maintain this information under one roof. The Visual Studio Team System 2008 is supported by Team Foundation Server, which is the central repository system that provides version control, process guidance and templates, automated build, manual and automated testing, bug tracking, work item tracking, and reporting.

Visual Studio Team System 2008 Team Suite provides all of the integrated tools for different team members. There are different editions for specific team members, including Architecture Edition, Test Edition, Database Edition, and Development Edition. This book covers the tools for the test and development phase of a project and for reporting the project status.

This book will help developers to get to know how to use the tools for automated unit testing, code analysis, and profiling to test their own code and to find out the performance and quality of their code. Testers will learn more about creating the web test, load test, and manual test, to determine the quality of the product, and also to raise defects and assign them to the developers for fixing.

VSTS provides different tools, such as the Test List Editor, Test View, and Test Configuration user interfaces, to easily manage the multiple tests created during the project life cycle. This book covers in-depth details of creating and maintaining different test types using VSTS.

What This Book Covers

Chapter 1, Software Testing and Visual Studio Team System 2008—This chapter gives an overall introduction to software testing and the types of testing involved in the software development life cycle (SDLC). It also provides an introduction to the different tools available in Visual Studio Team System 2008 to support different testing types for the SDLC.

Chapter 2, Unit Testing—This chapter explains the testing tool used by developers to make sure that the code produces the expected result. Creating unit tests, generating code and different assert statements, and the types used for testing are explained in detail in this chapter. Various attributes used for differentiating classes from test classes and methods from test methods, along with the initializing and cleaning methods are also explained in detail in this chapter.

Chapter 3, Web Testing—This chapter walks us through the tool used for testing web applications developed using .NET. This tool is used for recording a test scenario and then testing it with sample data from different data sources. Applying validation and extraction rules, adding data sources, and adding transactions are explained in detail using a sample application in Visual Studio Team System 2008. Some of the features, such as adding Plug-ins, parameterizing the web server, and running and debugging the web tests, are covered in this chapter.

Chapter 4, Advanced Web Testing—Generating coded web tests from recorded web tests and creating coded web tests using the Visual Studio Team System 2008 tool are explained in detail and with examples. Some of the other advanced topics covered in this chapter include adding dynamic parameters, adding rules to the coded web test, creating custom rules, and running the coded web test.

Chapter 5, Load Testing—This chapter explains how to use unit testing or web testing, and how to simulate a realistic scenario such as the number of concurrent users that have different browsers and different network speed, and are accessing the system from multiple locations. This testing collects the application performance and stability data in different scenarios, and is used for analyzing this data in order to scale the application for better performance.

Chapter 6, Manual, Generic, and Ordered Test—This chapter explains different tools that support testing an application manually, without using an automated testing tool. In the case of multiple interdependent tests, we can easily define the tests to be run in a specific order so that the dependent tests don't fail. Visual studio supports all these including Generic and Smoke tests which are explained here.

Chapter 7, Managing and Configuring Tests—Even though we have a lot of testing types and tools, managing these tests is sometimes a very difficult task. This chapter explains the easy way to organize the tests into lists, to enable and disable tests, configure the tests and test runs, view the tests using the Test View window and the test list editor, and run the tests in Visual Studio Team System 2008.

Chapter 8, Deploying and Running the tests—Once we are ready with the required type of test for the application, we have to deploy it on the test machines, run the test application, and collect the results for analysis. There are multiple ways of deploying the application and running the application using some of the advanced features provided by Visual Studio Team system 2008, and these are explained in detail in this chapter.

Chapter 9, Command Line—There are different ways of running a test based on the environment and requirements. In some situations, we may need a test to be run from the command line without using the user interface. The test works in the same way, but it runs without any user interaction. This chapter explains the different command line options and parameters used for running a test using command line commands.

Chapter 10, Working with Test Results—The main objective of running the tests is to collect the results and analyze them to correct any application errors, to make sure that the test is producing the expected result, and to increase the performance and stability of the application. This chapter explains in detail how to look at the test results and code coverage, and publish the test results.

Chapter 11, Reporting—Reporting is one of the main areas of software development in which the software quality is reported and monitored. Visual Studio Team System 2008 provides lot of reporting templates and features that can be used to upload the test results and publish them to the management and the team, in order to monitor the project's quality and performance. This chapter explains the detailed steps involved in publishing the results and creating and customizing the report using the available reporting templates in Visual Studio Team System 2008 and Team Foundation Server.

What You Need for This Book

This book requires a basic knowledge of Visual Studio Team System 2008 and of integrating this with Team Foundation Server. The reader must be familiar with the Visual Studio IDE. Most testers might have used different testing tools, but they should be little bit familiar with coding in Visual Studio if they are intent on using the coded web test and their own unit testing. The following tools are required by testers and developers in order to make the most of all of the chapters of this book.

  1. 1. Visual Studio Team System 2008 Team Suite, Test Edition, or Developer edition

  2. 2. SQL Server Express

  3. 3. Team Foundation Server 2005 or later

  4. 4. Microsoft Office (Word is required for Manual testing)

  5. 5. SQL Server Analysis and Reporting Server (for customizing reports and publishing them)

Who is This Book For

This book is for Microsoft developers and testers who are working with Visual Studio 2008, and who need to create a structured testing environment for their applications. No prior knowledge of testing is required. The reader will need to be familiar with the standard Visual Studio 2008 environment, but anyone who has previously created and compiled code in this environment will easily follow this book.

Conventions

In this book, you will find a number of styles of text that distinguish between different kinds of information. Here are some examples of these styles, and an explanation of their meaning.

Code words in text are shown as follows: "We can include other contexts through the use of the include directive."

A block of code will be set as follows:

<Deployment>
<DeploymentItem filename="Test.dll" />
<DeploymentItem filename="ClassLibrary1.dll" />
<DeploymentItem filename="CustomeRules.dll" />
</Deployment>

When we wish to draw your attention to a particular part of a code block, the relevant lines or items will be shown in bold:

pdbFile="C:\Workspace\WebTestPluginSample\ bin\Debug\WebTestPluginSample.pdb" instrumentInPlace="true" />
<CodeCoverageItem binaryFile="C:\Workspace\ WebTestPluginSample\bin\Debug\ WebTestPluginSampleTwo.dll"
pdbFile="C:\Workspace\WebTestPluginSample\ bin\Debug\WebTestPluginSampleTwo.pdb" instrumentInPlace="true" />

</Regular>

Any command-line input and output is shown as follows:

mstest /testmetadata:[file name] /testlist:[test list name]

New terms and important words are shown in bold. Words that you see on the screen, for example in menus or dialog boxes, appear in the text like this: "Select the test project, right click, and choose Add. Then select the option Web test from the context menu."

Note

Warnings or important notes appear in a box like this.

Note

Tips and tricks appear like this.

Reader Feedback

Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or may have disliked. Reader feedback is important for us to develop titles that you really get the most out of.

To send us general feedback, simply send an email to , making sure that you mention the book title in the subject of your message.

If there is a book that you need and would like to see us publish, please send us a note via the SUGGEST A TITLE form on www.packtpub.com, or send an email to us at .

If there is a topic that you have expertise in and you are interested in either writing or contributing to a book on, see our author guide on www.packtpub.com/authors.

Customer Support

Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.

Downloading the Example Code for the Book

Visit http://www.packtpub.com/files/code/5586_Code.zip to directly download the example code.

The downloadable files contain instructions on how to use them.

Errata

Although we have taken every care to ensure the accuracy of our contents, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or in the example code code—we would be grateful if you would report this to us. By doing this you can save other readers from frustration, and help to improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/support, selecting your book, clicking on the let us know link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata added to any list of existing errata. Any existing errata can be viewed by selecting your title from http://www.packtpub.com/support.

Piracy

Piracy of copyright material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works in any form on the Internet, please provide the location address or website name to us immediately, so that we can pursue a remedy.

Please contact us at with a link to the suspected pirated material.

We appreciate your help in protecting our authors, and supporting our ability to bring you valuable content.

Questions

You can contact us at if you are having a problem with some aspect of the book, and we will do our best to address it.