<div class="separator" style="clear:both;text-align:center;">
</div><h2>Introduction</h2>Performance testing determine how a application act under a specific workload .To measure, validate or verify responsiveness and stability of the application and resource usage for smooth operation.
<h2>Background</h2>Performance testing is used to uncover performance problems that can result from lack of server-side resources, inappropriate network bandwidth, inadequate data- base capabilities, faulty or weak operating system capabilities, poorly designed Application functionality, and other hardware or software issues that can lead to degraded client-server performance.
<h2>Why is Performance Testing required ?</h2><ul><li>Eliminate system failure and user dissatisfaction.</li><li>Eliminate system deployment delay due to performance issues.</li><li>Eliminate system rework due to performance issues.</li><li>Eliminate additional and unnecessary hardware acquisition costs.</li><li>Eliminate maintenance costs due to performance problems in production.</li><li>Eliminate additional operational overhead for handling system.</li></ul><div><h2>Performance Testing Cover</h2></div><div>The number of simultaneous users grows, transactions increases, or the amount of data increases,
performance testing will help answer the following questions:
<ul><li>Response time degrade to a point where it is noticeable and unacceptable?</li><li>At what point does performance become unacceptable?</li><li>What system components are responsible for performance degradation?</li><li>What is the average response time for users under a variety of loading conditions?</li><li>Does performance degradation have an impact on system security?</li><li>Is Apps reliability or accuracy affected as the load on the system grows?</li><li>What happens when loads that are greater than maximum server capacity are applied?</li></ul><h2>What are the testing mechanism to avoid the situation ?</h2><ol><li>Load testing is conducted to understand the behavior of the system under a specific expected load ,concurrent user ,no of transaction within a specific time and data volume.This test will give out the response times of  a transactions and then it can point towards bottleneck of application software.</li><li>Stress Testing is normally used to understand the upper limits or breaking point of capacity of the application.</li><li>Spike testing is done to observe the behavior of the system by suddenly increasing number of concurrent user and transaction . The goal is to determine whether the system will fail, or it will be able to handle dramatic changes in load.</li></ol></div><h1>Walk through</h1>We will walk through to conduct performance and load testing to know the application behavior at diffier situation .Our goal is to predicate and find out the bottle neck status whenever number of concurrent user,data base size ,number of transaction become high and low band width status.
<ol><li>Web Performance Tests</li><li>Load Testing</li></ol><h1>Testing Environment </h1>
<ol><li>Visual Studio 2013 Ultimate installation .</li><li>SQL Server 2012 or higher</li></ol>Load test result are kept in a database named LoadTest2010 .Now you need to configure that using Mange Test Controllers from Load Test menu. Note that the selected Controller is set to . Select the ellipses button to setup the connection string to the load test results store.
                                        
In the Connection Properties window use a Server Name of PCSW, use Windows Authentication, and use the default database name. Once you have the database connection properties in place, select the OK button to save.Select the Close button to exit out of the Manage Test Controller window.
<h2>Start the Journey</h2>Open Project :
<ol><li>Open Visual Studio , go to  File > New > Project</li><li>From the New Project window, Go to Test > select the Web Performance and Load Test Project template and finally select the OK button.</li><li>The new web and load test project has created .</li></ol>
                                       
                                                                        Figure :New load test project
Specifying Test Settings :
When you add a Web Performance and Load test project to a solution, a default Local.testsettings file is created automatically. You will found it in solution explorear , file name “Local.testsettings”. It is added automatically to the solution under the Solution Items folder. This runs your tests locally without diagnostic data adapters selected. You can add or edit a .testsettings file to specify diagnostic data adapters and test controllers.
You need to customize the Local.testsettings file according to your testing /deployment environment .To do that you need to Click on the file Local.testsettings.You will found the below dialog box :
                                              
                                                                            Figure : Test Setting dialog box
General
Roles
          Here you can select the option where test to run on your local machine or to run remotely.
<ul><li>Local execution is the default. It means that the tests and the application run on your Visual Studio machine, or on the build server after you have checked in the code.</li><li>Local execution with remote collection is a typical configuration for testing a web app or client-server system. The test code runs on the local machine, but you can also collect test data from the components of the application that are installed on other machines.</li><li>Remote execution is used where you do not want to run any part of your application locally. This is a typical configuration where the application requires particular platforms, such as a specific web browser or database. You can collect test data and configure the test environment on each machine.</li></ul>Data and Diagnostics
You need to select diagnostic data adapters according to your testing requirement.Say if you want to change the Network configuration / communication way (i.e. modem ,LAN etc) then select Network Emulation check Enable and press on Configuration button you will get several option select any one of them.If listed item is not match then you have to create new network profile. You will get all network profile on following folder :                                                                                             C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\Templates\LoadTest\Networks

                                                
                                                            Figure :Configure data Diagnostic adapter.
Diagnostic data adapter List:
ASP.NET Client Proxy for IntelliTrace and Test Impact:
This proxy allows you to collect information about the http calls from a client to a Web server for the IntelliTrace and Test Impact diagnostic data adapters.
IntelliTrace :
You can configure the diagnostic data adapter for IntelliTrace to collect specific diagnostic trace information to help isolate bugs that are difficult to reproduce. This adapter creates an IntelliTrace file that has an extension of .iTrace that contains this information. When a test fails, you can create a bug. The IntelliTrace file that is saved with the test results is automatically linked to this bug. The data that is collected in the IntelliTrace file increases debugging productivity by reducing the time that is required to reproduce and diagnose an error in the code. From this IntelliTrace file the local session can be simulated on another computer, this reduces the possibility of a bug being non-reproducible.
ASP.NET profiler :
You can create a test setting that includes ASP.NET profiling, which collects performance data on ASP.NET Web applications.This diagnostic data adapter is for use only with load tests that use websites that require Visual Studio Ultimate.
Code coverage (Visual Studio 2010) :
You can create a test setting that includes code coverage information that is used to investigate how much of your code is covered by tests.This diagnostic data adapter is only applicable to Visual Studio test settings. It is not used for test settings in Microsoft Test Manager.This is for compatibility with Visual Studio 2010 only.
Event log :
You can configure a test setting to include event log collecting, which will be included in the test results.
Network emulation :
You can specify that you want to place an artificial network load on your test using a test setting. Network emulation affects the communication to and from the machine by emulating a particular network connection speed, such as dial-up.This diagnostic data adapter is only applicable to Visual Studio test settings. It is not used for test settings in Microsoft Test Manager.Network emulation cannot be used to increase the network connection speed.
System information :
A test setting can be set up to include the system information about the machine that the test is run on. The system information is specified in the test results by using a test setting.
Test impact :
You can collect information about which methods of your applications code were used when a test case was running. This information can be used together with changes to the application code made by developers to determine which tests were impacted by those development changes.
Video Recorder :
You can create a video recording of your desktop session when you run an automated test. This video recording can be useful to view the user actions for a coded UI test. The video recording can help other team members isolate application issues that are difficult to reproduce.

Deployment
<ol><li>To create a separate directory for deployment every time that you run your tests, select Enable deployment.If you select to do this, you can continue to build your application when you run your tests.To add a file to the directory you are using to run your tests that you need for the tests, choose Add file and then select the file that you want to add.</li><li>To add a directory to the directory you are using to run your tests that you need for the tests, choose Add directory and then select the directory that you want to add.</li></ol>Setup and Cleanup Scripts
<ol><li>To run scripts before and after your tests, choose the Setup and Cleanup Scripts page in the Test Settings dialog box.</li><li>Type the location of the script file in Setup script or choose the ellipsis () to locate the setup script.</li><li>Type the location of the script file in Cleanup script or choose the ellipsis () to locate the cleanup script.</li></ol>Hosts
<ol><li>To run your tests using a different host, choose the Hosts page in the Test Settings dialog box.</li><li>To run your unit tests in the same process as an ASP.NET site, select ASP.NET in Host type.</li><li>Use the Run test in 32-bit or 64-bit process to select if you want your test to run as 32-bit or 64-bit processes.
For maximum flexibility, you should compile your test projects with the Any CPU configuration. Then you can run on both 32- and 64-bit agents. There is no advantage to compiling test projects with the 64-bit configuration.</li></ol>Test Timeouts
<ol><li>To limit the period of time for each test run and individual tests, choose the Test Timeouts. page in the Test Settings dialog box.</li><li>To abort a test run when a time limit is exceeded, select Abort a test run if the total time exceeds and then type a value for this limit.</li><li>To fail an individual test if a time limit is exceeded, select Mark an individual test as failed if its execution time exceeds, and type a value for this limit.</li></ol>Unit Test
 If you have to specify assembly locations that your unit tests need to load, choose Unit Test.
<ol><li>For Root folder for the assemblies to be loaded, choose Browse to locate the folder and populate the text box.
The root folder that is specified can contain environment variables and represents the directory that will be used as the ApplicationBase of the AppDomain that the tests are run in. All the assemblies in this directory will be loadable by your unit tests. In a production environment, a good practice is to set this to the directory where your code under test assemblies are installed. In a development environment, a good practice is to set this to the directory where your code under test assemblies are built to. This ensures that any references that you have to the product binaries can be loaded and resolved during the discovery and execution of the tests without the need to copy the product binaries around with the tests.
If no value is set here, the ApplicationBase of the AppDomain that the tests are run in is set to the directory that contains the tests.</li><li>Select or clear the check box for Use the Load Context for assemblies in the test directory.
By default, most assemblies are loaded into the correct “Load Context.” Usually, you should leave Use the Load Context for assemblies in the test directory selected. However, there are some conditions when you might want to turn this off:
If there are a large number of assemblies in your test directory, and you have specified a location under Root folder for the assemblies to be loaded, and your tests are not dependent on being loaded in the Load Context, you could see a performance increase if you do not use the Load Context to load these test assemblies.
If your tests depend on being loaded in a context other than the Load Context (not typical).
Under Folders to use when the tests are run, choose Add folder.</li><li>The Browse For Folder dialog box is displayed.</li><li>Locate the folder to use and choose OK.
The Folders to use when the tests are run setting is the setting that you will probably use the most frequently. You can specify multiple paths to folders that assemblies should be resolved from during discovery and execution of the tests. Each of the paths that are specified in this section can contain environment variables. Together with each of the paths that are specified here, there are two options that are associated with it:
First option   Select the Use Load Context check box to specify that the directory should use the load context when resolving assemblies from the directory (if the load context is not required for the tests to run correctly you might see a performance improvement by clearing this check box).
Second option   Select the Include sub-folders check box to specify using any sub-folder to include when resolving assemblies from the directory.</li><li>Under Additional folders to use when discovering tests, choose Add Folder.
The Browse For Folder dialog box is displayed.</li><li>Locate the folder to use and choose OK.</li></ol>Web Test
<ol><li>Select either Fixed run count, or One run per data source row.</li><li>Use the Browser type drop-down list to select the Web browser to use with your Web performance test. For example, Internet Explorer 10.0.</li><li> Select Simulate think times to enable simulated human pausing.</li><li>Select Use request URL’s directory as the default path for cookies.</li></ol>Through the above steps we’ve completed the testing profile as we need to execute our test senario.You can also open the Local.testsettings. Right click on Local.testsettings file and press open with :
                                    
                                         Figure : Local.testsettings file
After that following dialog box will appear, you can open the file any of the following way :
                                   
<div class="separator" style="clear:both;text-align:center;"> </div>