Search code examples
tfsvisual-studio-2017tfs-2015

Which tests should be run since a previous TFS build?


My managers want we to determine which tests might have to be run, based on coding changes that were made to the application we are testing.

But, it is hard to know which tests are actually needed to be re-verified as a result of a code change. What we have done is common to test the entire area where the code change occurred / or the entire proj, solution.

We were told this could be achieved by TFS build or MTM tools. Could someone share the details?

PM:We are running on TFS 2015 update4,VS2017.


Solution

  • There is a concept of Test Impact Analysis which helps in analysis of impact of development on existing tests. Using TIA, developers know exactly which tests need to be verified as a result of their code change.

    The Test Impact Analysis (TIA) feature specifically enables this – TIA is all about incremental validation by automatic test selection. For a given code commit entering the pipeline TIA will select and run only the relevant tests required to validate that commit. Thus, that test run is going to complete faster, if there is a failure you will get to know about it faster, and because it is all scoped by relevance, analysis will be faster as well.

    Test Impact Analysis for managed automated tests is available via a checkbox in the 2.* preview version of the VSTest task.

    enter image description here

    If enabled, only the relevant set of managed automated tests that need to be run to validate a given code change will run. Test Impact Analysis requires the latest version of Visual Studio, and is presently supported in CI for managed automated tests.

    However this is only available with TFS2017 update1(need 2.* preview version of VSTS task). More details please refer this blog: Accelerated Continuous Testing with Test Impact Analysis