To get a trial key
fill out the form below
Team license
Enterprise license
** By clicking this button you agree to our Privacy Policy statement

Request our prices
New License
License Renewal
--Select currency--
* By clicking this button you agree to our Privacy Policy statement

Free PVS-Studio license for Microsoft MVP specialists
** By clicking this button you agree to our Privacy Policy statement

To get the licence for your open-source project, please fill out this form
** By clicking this button you agree to our Privacy Policy statement

I am interested to try it on the platforms:
** By clicking this button you agree to our Privacy Policy statement

Message submitted.

Your message has been sent. We will email you at

If you haven't received our response, please do the following:
check your Spam/Junk folder and click the "Not Spam" button for our message.
This way, you won't miss messages from our team in the future.

Philosophy of Static Code Analysis: We …

Philosophy of Static Code Analysis: We Have 100 Developers, the Analyzer Found Few Bugs, Is Analyzer Useless?

Oct 16 2017

People often think incorrectly about static code analysis.

It is often possible to meet such an opinion expressed in the following paragraph:

We have a large project. Dozens (hundreds) of developers work on it. This is that very case about which you are writing, that needs static code analysis application. I downloaded the code analyzer, performed a analysis and found very few bugs. Obviously, the code analyzer is simply useless!

Unfortunately, it seems that the way of promoting static code analysis via checking open source projects plays tricks on some people. People EXPECT that having run the analyzer on a random project, they will NECESSARILY find a bunch of errors. Of course this is not true, here is why.

Let us suppose we have a project involving 10 developers, 3 QAs and 1 project manager. We will consider an interval of one month (21 working days). The interval was selected randomly and it is not that important.

Let in the first working day the developers wrote code and introduced 5 errors. The next day, the QAs found these 5 bugs and wrote back to programmers. On the third day the programmers fixed 5 bugs. Here we have formed such a "tuple" or a cohort: one day they make errors, the second day they find them, the third day they correct them.

Obviously, this cohort moves through time, and every day the bugs are added, errors are detected and fixed. Although in every moment of time there are not not so many errors, but this "window" moves and the general number of fulfilled work on detecting and fixing bugs is quite significant. On the last day of the 21-days working cycle, a project manager gets tired, he shouts at everybody, and all errors are fixed. As a result, at the end of the month, there is 0 errors in a project. This, of course, will not last long, but the manager is happy about the nice month totals.

Let us suppose that on this 21st day someone from programmers downloaded the code analyzer, performed the check, got 0 errors (and a couple of stupid false positives) and made the obvious, but wrong conclusion: code analyzers just don't work and aren't needed!

Now we will look at the moving of the cohort if the analyzer is used regularly.

On the first day of the programmers also made 5 errors. But thanks to the automatic code analysis, 3 bugs have been found and were fixed immediately even at the stage of coding. So, the next day, the testers will find just 2 errors. On the third day the programmers will have much less work on edits, because some errors have been fixed on the first day. It turns out that the analyzer has reduced the amount of work on errors fixing more than twice that significantly accelerates the development process as a whole.

Of course, the numbers above are relative. The most important thing is that we can make the right important conclusion. Static analysis is the most useful when it is used not as a one-time activity, but as a regular process.

Popular related articles
PVS-Studio's data flow analysis untangles more and more related variables

Date: Aug 08 2022

Author: Artem Rovenskii

This is the second article about related variables and how the PVS-Studio analyzer deals with them. This time, let's talk about how we enhanced the mechanism we created, and what problems of the anal…
I want to use PVS-Studio in my project. The manager is against it. How to convince them?

Date: Aug 02 2022

Author: Sergey Vasiliev

You decided to integrate PVS-Studio into your project. But suddenly it turns out that the manager is against it, because... because why, actually? Let's try to figure out what to do with potential ob…
Intermodular analysis of C and C++ projects in detail. Part 2

Date: Jul 14 2022

Author: Oleg Lisiy

In part 1 we discussed the basics of C and C++ projects compiling. We also talked over linking and optimizations. In part 2 we are going to delve deeper into intermodular analysis and discuss its ano…
Intermodular analysis of C and C++ projects in detail. Part 1

Date: Jul 08 2022

Author: Oleg Lisiy

Starting from PVS-Studio 7.14, the C and C++ analyzer has been supporting intermodular analysis. In this two-part article, we'll describe how similar mechanisms are arranged in compilers and reveal s…
PVS-Studio evolution: data flow analysis for related variables

Date: Apr 28 2022

Author: Nikita Lipilin

Related variables are one of the main problems of static analysis. This article covers this topic and describes how PVS-Studio developers are fighting false positives caused by different relationship…

Comments (0)

Next comments
Unicorn with delicious cookie
Our website uses cookies to enhance your browsing experience.