..
We can define the process of static analysis of source code as a procedure by which portions are identified unsafe code without making the actual execution of the program.
'S static analysis can be performed automatically, that is, by its own specific tools useful to support the testing process. Observe how the phase of software testing, in its entirety, is a very complex process and typically done by programmers who decide to specialize in this particular area. Software tools dedicated to 'static code analysis thus help to reduce time and costs, providing a first hint on what sections of code to be Required to check more carefully.
The types of errors detected by the instruments mentioned are multiple and continuous updating, business development, in fact, this kind of software goes to great rhythm for a long time now.
Important in this respect the historical value of a program like Lint , released in 1979, that runs on Linux and dedicated to the programming language C . Lint is a real landmark for static code verification software, sometimes identified as "lint-like tools", or "lint like tools."
The modern static analyzers are also able to verify the code designed to run in parallel, providing specific suggestions for such applications.
In this article, we focus on this type of instrument, trying to offer a brief overview of the possibilities in the static code for programs running parallel language C + + (the most popular and versatile in nature). To begin, let's examine a generic software and flexible as a PC-Lint .
PC-Lint is designed to provide optimum performance in the analysis of programs that use the POSIX threads , but can be effectively used in a generic case. Do not want to say that the analysis made by the software is in every way automatic.
It appears necessary to manually specify the functions that the program will run in parallel (or even concurrently), so that PC-Lint can proceed to 'static analysis of fairness (that yes, automatic) just in these sections. To achieve this, you must use the option-always on the execution of PC-Lint command line. For example the statement:
lint-sem (func, thread)communicates with PC-Lint is necessary to analyze the function func, as it will run concurrently. You will now receive error messages related to the function keeping in mind that you must also handle parallel execution of the same, then pointing out, for example, if a shared variable is used or modified without proper definition of a critical section.
It was in this regard, if the mutual exclusion and synchronization primitives are implemented using POSIX threads typical of formalism, or, for example, pthread_mutex_lock and pthread_mutex_unlock, you will not need to specify anything about it from the command line. Otherwise, the guidelines will be used:
-Sem (access, thread_lock) -Sem (release, thread_unlock)to indicate that access to the critical section is made through a function called access and the release of that section is using the release function.
If, for a static analysis of our code but we wanted to have a slightly more powerful tools and independent of PC-Lint, VivaMP might be a good choice.
| |
AutoCAD (eBook)
Creation of architectural structures. At only 29 €. |
| |
Webmaster Advanced (Course)
Become a professional Webmaster. From 39 €. |
| |
XML (Course)
Creation of XML structures, XSL and other languages extensible. Starting from 29 €. |