To get a trial key
fill out the form below
Team License (a basic version)
Enterprise License (an extended version)
* 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
Free PVS-Studio for those who develops open source projects

Date: Dec 22 2018

Author: Andrey Karpov

On the New 2019 year's eve, a PVS-Studio team decided to make a nice gift for all contributors of open-source projects hosted on GitHub, GitLab or Bitbucket. They are given free usage of PVS-Studio s…
PVS-Studio ROI

Date: Jan 30 2019

Author: Andrey Karpov

Occasionally, we're asked a question, what monetary value the company will receive from using PVS-Studio. We decided to draw up a response in the form of an article and provide tables, which will sho…
How PVS-Studio Proved to Be More Attentive Than Three and a Half Programmers

Date: Oct 22 2018

Author: Andrey Karpov

Just like other static analyzers, PVS-Studio often produces false positives. What you are about to read is a short story where I'll tell you how PVS-Studio proved, just one more time, to be more atte…
Appreciate Static Code Analysis!

Date: Oct 16 2017

Author: Andrey Karpov

I am really astonished by the capabilities of static code analysis even though I am one of the developers of PVS-Studio analyzer myself. The tool surprised me the other day as it turned out to be sma…
Characteristics of PVS-Studio Analyzer by the Example of EFL Core Libraries, 10-15% of False Positives

Date: Jul 31 2017

Author: Andrey Karpov

After I wrote quite a big article about the analysis of the Tizen OS code, I received a large number of questions concerning the percentage of false positives and the density of errors (how many erro…
Technologies used in the PVS-Studio code analyzer for finding bugs and potential vulnerabilities

Date: Nov 21 2018

Author: Andrey Karpov

A brief description of technologies used in the PVS-Studio tool, which let us effectively detect a large number of error patterns and potential vulnerabilities. The article describes the implementati…
PVS-Studio for Java

Date: Jan 17 2019

Author: Andrey Karpov

In the seventh version of the PVS-Studio static analyzer, we added support of the Java language. It's time for a brief story of how we've started making support of the Java language, how far we've co…
The Ultimate Question of Programming, Refactoring, and Everything

Date: Apr 14 2016

Author: Andrey Karpov

Yes, you've guessed correctly - the answer is "42". In this article you will find 42 recommendations about coding in C++ that can help a programmer avoid a lot of errors, save time and effort. The au…
The Last Line Effect

Date: May 31 2014

Author: Andrey Karpov

I have studied many errors caused by the use of the Copy-Paste method, and can assure you that programmers most often tend to make mistakes in the last fragment of a homogeneous code block. I have ne…
The way static analyzers fight against false positives, and why they do it

Date: Mar 20 2017

Author: Andrey Karpov

In my previous article I wrote that I don't like the approach of evaluating the efficiency of static analyzers with the help of synthetic tests. In that article, I give the example of a code fragment…

Comments (0)

Next comments
This website uses cookies and other technology to provide you a more personalized experience. By continuing the view of our web-pages you accept the terms of using these files. If you don't want your personal data to be processed, please, leave this site.
Learn More →