You are previewing Software Testing using Visual Studio 2012.
O'Reilly logo
Software Testing using Visual Studio 2012

Book Description

Learn different testing techniques and features of Visual Studio 2012 with detailed explanations and real-time samples

  • Using Test Manager and managing test cases and test scenarios

  • Exploratory testing using Visual Studio 2012

  • Learn unit testing features and coded user interface testing

  • Advancement in web performance testing and recording of user scenarios

In Detail

Testing is one of the main phases in the software development lifecycle. Managing the test scenarios, test cases, defects, and linking each one of these is bit of a challenge without using any tools. For frequently changing businesses, it is essential to address testing requirements by matching the pace of the business. This can only be achieved through automation of the possible testing scenarios to reduce the turnaround time of testing.

Software Testing Using Visual Studio 2012 is a practical, hands-on guide that provides a number of clear, step-by-step exercises, which will help you to take advantage of the new features and real power of Visual Studio 2012.

Software Testing Using Visual Studio 2012 starts with the basics of testing types and managing the tests using Test Explorer and a few other tools. Practical examples are added to help you understand the usage of various tools and features in a better way. Software Testing Using Visual Studio 2012 is written from a developer point of view and helps you take advantage of the unit testing features and customize the tests by generating the code and fine-tuning it as per your needs. The Test Manager is a standalone tool which is part of the Visual Studio tools family and takes care of test management. Software Testing Using Visual Studio 201 covers the usage of the test plan, test suite, manual testing, and exploratory testing using Test Manger and managing these aspects using these tools.

Software Testing Using Visual Studio 2012 also covers the recording of user actions and creating automated tests out of it. This book covers generating and adding parameters to the recording and replacing it at runtime, adding validation and extraction rules to the tests, running the tests using command line commands, looking at the details of test results, and configuring the running the load test out of web performance or unit tests.

This book helps you to understand the complete testing features and how to make use of automation features as well. It will appeal to both developers and testers.

Table of Contents

  1. Software Testing using Visual Studio 2012
    1. Table of Contents
    2. Software Testing using Visual Studio 2012
    3. Credits
    4. About the Authors
    5. About the Reviewers
    6. www.PacktPub.com
      1. Support files, eBooks, discount offers and more
        1. Why Subscribe?
        2. Free Access for Packt account holders
      2. Instant Updates on New Packt Books
    7. Preface
      1. What this book covers
      2. What you need for this book
      3. Who this book is for
      4. Conventions
      5. Reader feedback
      6. Customer support
        1. Downloading the example code
        2. Errata
        3. Piracy
        4. Questions
    8. 1. Visual Studio 2012 Test Types
      1. Software testing in Visual Studio 2012
      2. Testing as part of software development life cycle
      3. Types of testing
        1. Unit testing
        2. Manual testing
        3. Exploratory testing
        4. Web performance tests
        5. Coded UI Test
        6. Load testing
        7. Ordered test
        8. Generic test
      4. Test management in Visual Studio 2012
        1. Introduction to testing tools
          1. Test Explorer
          2. Code coverage results
      5. Microsoft Test Manager
        1. Connecting to Team Project
        2. Test Plans, suites, and test cases
        3. Defining test cases
        4. Lab Center
      6. Summary
    9. 2. Test Plan, Test Suite, and Manual Testing
      1. Test Plan
      2. Test Suite and its types
        1. Static Test Suites
        2. Query-based Test Suites
        3. Requirement-based Test Suites
      3. Running manual tests
        1. Action recording
      4. Shared steps and action recording for shared steps
        1. Creating shared steps
        2. Action recording for shared steps
      5. Adding parameters to manual tests
      6. Summary
    10. 3. Automated Tests
      1. Coded UI tests from action recordings
        1. Files generated for coded UI test
          1. CodedUITest1.cs
          2. UIMap.Designer.cs
          3. UIMap.cs
          4. UiMap.uitest
        2. Data-driven coded UI test
        3. Adding controls and validation to coded UI test
      2. Summary
    11. 4. Unit Testing
      1. Creating unit tests
      2. Assert statements
        1. Types of Asserts
          1. Assert
            1. Assert.AreEqual
            2. Assert.AreNotEqual
            3. Assert.AreSame
            4. Assert.AreNotSame
            5. Assert.Fail
            6. Assert.Inconclusive
            7. Assert.IsTrue
            8. Assert.IsFalse
            9. Assert.IsNull
            10. Assert.IsNotNull
            11. Assert.IsInstanceOfType
          2. StringAsserts
            1. StringAssert.Contains
            2. StringAssert.Matches
            3. StringAssert.DoesNotMatch
            4. StringAssert.StartsWith
            5. StringAssert.EndsWith
        2. Downloading the example code
          1. CollectionAssert
            1. CollectionAssert.AllItemsAreNotNull
            2. CollectionAssert.AreEquivalent
            3. CollectionAssert.AreNotEquivalent
            4. CollectionAssert.AllItemsAreInstancesOfType
            5. CollectionAssert.IsSubsetOf
            6. CollectionAssert.IsNotSubsetOf
            7. CollectionAssert.AllItemsAreUnique
            8. CollectionAssert.Contains
            9. CollectionAssert.DoesNotContain
            10. CollectionAssert.AreEqual
            11. ollectionAssert.AreNotEqual
          2. AssertFailedException
          3. UnitTestAssertionException
          4. ExpectedExceptionAttribute
      3. Unit Tests and Generics
      4. Data-driven unit testing
      5. Unit Testing using Fakes
        1. Stubs
        2. Shims
        3. Difference between Stubs and Shims
      6. Code coverage unit test
        1. Blocks and lines
        2. Excluding elements
      7. Summary
    12. 5. Web Performance Test
      1. Creating the web performance test
        1. Recording a test
          1. Adding comments
          2. Cleaning the recorded tests
          3. Copying the requests
          4. Adding Loops
      2. Web performance test editor
        1. Web test properties
        2. Web test request properties
        3. Other request properties
          1. Form POST Parameters
          2. QueryString parameters
          3. Extraction rules
          4. Validation rules
          5. Transactions
        4. Conditional rules
        5. Toolbar properties
          1. Add data source
          2. Setting credentials
          3. Add recording
          4. Parameterize web server
            1. Context parameters
          5. Adding a web test plugin
      3. Debugging and running the web test
        1. Settings in the .testsettings file
          1. General
          2. Roles
          3. Data and Diagnostics
          4. Deployment
          5. Setup and Cleanup Scripts
          6. Hosts
          7. Test Timeouts
          8. Unit test
          9. Web test
        2. Running the test
          1. Web Browser
          2. Request
          3. Response
          4. Context
          5. Details
      4. Summary
    13. 6. Advanced Web Testing
      1. Dynamic parameters in web testing
      2. Coded web test
        1. Generating code from a recorded test
        2. Transactions in coded tests
        3. Custom code
        4. Adding a comment
        5. Running the coded web test
      3. Debugging coded web test
      4. Custom rules
        1. Extraction rules
        2. Validation rules
      5. Summary
    14. 7. Load Testing
      1. Creating a Load Test
        1. Load Test Wizard
          1. Specifying a scenario
            1. Knowing about think time
            2. Defining the Load Pattern
              1. Constant load
              2. Step load
            3. Defining the Test Mix Model
              1. Test Mix Model based on total number of tests
              2. Test Mix Model based on number of virtual users
              3. Test Mix Model based on user pace
              4. Test Mix Model based on sequential test order
            4. Defining the Network Mix
            5. Defining browser mix
          2. Counter sets
          3. Run Settings
            1. Threshold rules
        2. Editing Load Tests
          1. Adding context parameters
        3. Storing results in central result store
        4. Running the Load Test
        5. Analyzing and exporting Test Results
          1. Graphical view
          2. Summary view
          3. Tables view
          4. Detail view
          5. Exporting to Microsoft Excel
        6. Using Test Controller and Test Agents
          1. Test Controller and Test Agent Configuration
      2. Summary
    15. 8. Ordered and Generic Tests
      1. Ordered tests
        1. Creating an ordered test
        2. Executing an ordered test
      2. Generic tests
        1. Creating a generic test
        2. The summary results file
      3. Summary
    16. 9. Managing and Configuring Tests
      1. Using Test settings
        1. The General option
        2. The Roles option
        3. Data and Diagnostics
        4. The Deployment section
        5. Setup and Cleanup Scripts
        6. The Hosts option
        7. The Test Timeouts option
        8. The Unit Test option
          1. Editing the Test Run configuration file
            1. Editing the deployment section
        9. The Web Test option
        10. Configuring unit tests using the .runsettings file
      2. Summary
    17. 10. The Command Line
      1. VSTest.Console utility
        1. Running tests using VSTest.Console
          1. The /Tests option
          2. The /ListTests option
      2. MSTest utility
        1. Running a test from the command line
          1. The /testcontainer option
          2. The /testmetadata option
          3. The /test option
          4. The /unique option
          5. The /noisolation option
          6. The /testsettings option
          7. The /resultsfile option
          8. The /noresults option
          9. The /nologo option
          10. The /detail option
        2. Publishing Test Results
          1. The /publish option
          2. The /publishbuild option
          3. The /flavour option
          4. The /platform option
          5. The /publishresultsfile option
            1. Step 1 – create/use existing Test Project
            2. Step 2 – running the test
            3. Step 3 – creating a build
            4. Step 4 – building the project
            5. Step 5 – publishing the result
        3. TCM command line utility
          1. Importing tests to a Test Plan
          2. Running tests in a Test Plan
      3. Summary
    18. 11. Working with Test Results
      1. Test Runs and Test Results
        1. Test as part of the Team Foundation Server build
        2. Building report and Test Result
          1. Creating a work item from the result
      2. Summary
    19. 12. Exploratory Testing and Reporting
      1. Exploratory testing
      2. Reports using Team Foundation Server
        1. Bug status report
        2. Test case readiness report
        3. Status on all iterations
        4. Other out-of-the-box reports
      3. Creating a report definition using Visual Studio 2012
      4. Summary
    20. 13. Test and Lab Center
      1. Connecting to Team Project
      2. Testing Center
        1. Testing Center – Plan tab
        2. Testing Center – Test tab
        3. Testing Center – Track tab
        4. Testing Center – Organize tab
      3. Lab Center
        1. Environments
        2. Deployed environments
      4. Summary
    21. Index