How can I verify that I did not break anything during refactoring?

I am going to start refactoring some functions in my code. I have a good number of unit tests that ensure that I don't break anything, but I'm not sure what they give me. Are there any tools that can analyze the code and see that the functionality remains the same?

I plan to reorganize some fairly isolated code, so I don’t need to check the entire program, only the areas that I'm working on.

In context, the code I'm working on is in C / C ++, and I work on Linux with GCC and VIM.

+3
source share
5

gcov .

, , .

, , - , .

: GNU -

+10
+7

, , , , , . , , , , , () - .

+5

. , , - . , ( ).

+2

I'm not sure about your particular platform of choice, but you looked at code coverage tools like Bullseye . This will not give you an analysis of the overall functionality (and if it deviates), but it will help you ensure that the target libraries perform your tests adequately. These are commercial applications, but I know that there are similar versions of OSS for other languages, if you need it, there may be free licenses.

+1
source

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


All Articles