Adding Unit Tests for Each New Bug

issue-trackingqaunit testing

In my job all developers that resolve a bug have to add a new unit test that warns about this type of bugs (in the case it occours again). If a unit test is not possible (for example, a webpage design issue), then QA department has to create a test case to manually check it.

The idea behind this is that if a defect has not been detected before the product release is because there isn't an appropriate unit test to detect it. So the developer has to add it.

The question is: is this common in any software development methodology? This technique has a name? I would like to learn more about it, but I need some information to start with it.

Best Answer

This is quite common. We use this in our team. For Every production defect, the developer must add a note on the root cause of the problem , add a failing unit test and add a test impact analysis before the ticket can be pushed to dev state to check in the code.

The failing unit test must pass before we can push the code to production.

I don't think this has a specific name except that general "regression testing". This is very useful and we have started seeing a rise in the quality of the product after we started following this process.

Related Topic