📜 ⬆️ ⬇️

How to test only what you need

Manual testing is a painstaking and sometimes routine process. One of the problems is that when changes are made to the code, it is difficult to predict which tests should be done anew to make sure that everything works as it should. For this resort to regression testing and re-run all the tests. Such operations require a lot of time. But if you are developing your solutions on the .NET platform, then you have a chance to significantly reduce the labor costs of testers, because you will know exactly which tests should be carried out and which are not , since the changes in the code did not affect their behavior. Sounds good?

Tool code processing and Test Impact.


Changes that programmers make to the application code, with a version control system and a continuous integration process, can be clearly identified. Moreover, if we carry out tests from build to build, then by analyzing the Code Coverage information of manual tests and saving it for each test plan passed, we can clearly predict which test broke, and which tests are not affected by the changes that the programmers made. At first glance, this is very fantastic, but nevertheless it already works in conjunction with Team Foundation Server 2013 and Microsoft Test Manager 2013.

Detailed script to make everything clear.


Consider the example of a calculator detailed scenario. In Microsoft Test Manager, we have defined a basic test plan, and for each PBI the corresponding function tests:


In the test settings it is necessary to indicate that during the test run we will have a Test Impact analysis:

')
Additionally, be sure to specify the same option in the build rules for the build:


Build build and start testing our application according to the plan:

This is the first build of our product, it is obvious that we must do all the tests to make sure that everything works as it should. When passing tests, Microsoft Test Manager analyzes the code execution paths corresponding to each test and writes this information to the database.
We pass all the tests of the features of our product:


We have in terms of 4 tests, multiplication, division, subtraction and addition. In the results window we see that we checked all the features of our calculator and passed all the tests of the plan:


We make changes to the code


Imagine now that programmers have made changes in some part of the code of our solution. Let it be functions of multiplication and division:


Make a check and collect a new build. He will be checked by testers. After the build is assembled in the report, in addition to standard information about how many unit tests passed, what percentage of Code Coverage we also get information about which tests were affected. Real magic!


In addition to the information in the report, the tester can also get a list of affected tests directly in Microsoft Test Manager. Before getting the list of recommended tests, let's assign a new build to the test plan. In this case, we will be given a recommendation to analyze the list of recommended tests:


At the same time, the tester has the opportunity to do an analysis of the recommended tests from build to build:


Thus, the tester can significantly save time on checking the build, and conduct only those tests that were subject to changes made by programmers in the application code.

Source: https://habr.com/ru/post/198696/


All Articles