Test Impact Analysis
This is Syed Aslam Basha here from Relationship experience division (RXD) team.
Test impact analysis helps developers to quickly identify the tests(unit/CUIT) that need to be run for the latest code change. It’s one of the features in visual studio 2010 (VS) available in Premium and Ultimate editions. It works with only managed code.
Let me show Test impact analysis with a Sample web application which has a web page and a class along with Test project.
- Launch visual studio 2010
- Click on new project ->Visual C# - Test – Test Project ( make sure you have selected .NET Framework4 to see the test project)
- Give appropriate project name and save the project
- Close VS
- Launch VS 2010
- Click file-> New project - > Web -> select ASP.NET web application
- Give appropriate project name and save the project
- Right click and add new class and close the solution.
- Open the test project and add the website. The solution will look like
- Create a simple method in class file as DisplayText which returns string
- Create unit test for the above method in UnitTest1.cs as
- Launch test impact view by clicking on Test -> Windows - > Test impact view
- If the test impact diagnostic data is not enabled, click on the link in test impact view window to enable it. Alternatively, you can also set it in test settings as below ( Test -> Edit test settings - > Data and diagnostics)
- Now build the solution and run the unit test to baseline data
- Click on Test-> Windows -> Test view
- Select the test method and click on run
- At this point the test impact view will look like
- Now, lets change the code in DisplayText method and add line of code as
- Since there is change in code it shows up in impacted tests as
- Select the impacted test and click on run tests. Make sure the unit test passes to ensure the code change hasn’t effected the test case.
- Syed Aslam Basha ( syedab@microsoft.com )
Relationship experience division (RXD) Team
Test Lead
---------------------------------------------------------
Please leave a comment if the blog post has helped you.
Comments
Anonymous
June 08, 2011
This helps. And I'd love to understand how this feature works with manual test cases and CodedUI tests. Thanks!Anonymous
June 15, 2011
The comment has been removed