Program Analysis
Software is transforming the way that we live and work. We communicate with friends via social media on smartphones and use websites to buy what we need and to learn about anything in the world. At work, the software helps us organize our businesses, reach customers, and distinguish ourselves from competitors. Unfortunately, it is still challenging to produce high-quality software, and much of the software we do use has bugs and security vulnerabilities.
So to improve these conditions and provide better services the term PROGRAM ANALYSIS comes into action. Program analysis is all about analyzing software code and learning about its properties. In computer science, it is the process of automatically analyzing the behaviour of computer programs regarding a property such as correctness, robustness, safety and liveness. It focuses on two major areas: program optimization and program correctness. The main focus is to improve the program's performance while reducing resources used and also keeping the ultimate goal of the program the same as its original one.
Program analysis can be performed without executing the program (static program analysis), during runtime (dynamic program analysis) or in a combination of both.
Static Program Analysis:
Considering program correctness, static analysis can discover vulnerabilities during the phase of development of the program. It simply means debugging the program even before it is run. the Bugs are found easier in this as it goes to the root of the problem.
Due to many forms of static analysis being computationally undecidable, the mechanisms for doing it will not always end with the right answer – either because they sometimes return a false negative ("no problems found" when the code does have problems) or a false positive, or because they never return the wrong answer but sometimes never end. The first type of mechanism might reduce the number of vulnerabilities, while the second can sometimes give strong assurance of the lack of a certain class of vulnerabilities.
Only correct optimizations are highly desirable. Thus, for program optimization two main strategies are applied to tackle the problems of computationally undecidable analysis:
- An optimizer that is expected to complete in a relatively short amount of time, such as the optimizer in an optimizing compiler, may use a shortened version of an analysis that is guaranteed to complete in a fixed amount of time, and guaranteed to only find correct optimizations.
- A third-party optimization tool may be implemented in such a way as to never produce an incorrect optimization, but in some situations, it can continue running indefinitely until it finds one. In this case, the developer using the tool would have to stop the tool and avoid running the tool on that piece of code again or even modify the code.
Dynamic Program Analysis:
- Static analysis - Style checkers and data flow analysis.
- Dynamic analysis - Memory use monitors and profilers.
Static analysis advantages:
- It can find weaknesses in the code at the exact location.
- It can be conducted by trained software assurance developers who fully understand the code.
- It allows a quicker turnaround for fixes.
- It is relatively fast if automated tools are used.
- Automated tools can scan the entire code base.
- Automated tools can provide mitigation recommendations, reducing the research time.
- It permits weaknesses to be found earlier in the development life cycle, reducing the cost to fix.
Static analysis limitations:
- It is time-consuming if conducted manually.
- Automated tools do not support all programming languages.
- Automated tools produce false positives and false negatives.
- There are not enough trained personnel to thoroughly conduct static code analysis.
- Automated tools can provide a false sense of security that everything is being addressed.
- Automated tools only as good as the rules they are using to scan with.
- It does not find vulnerabilities introduced in the runtime environment.
Dynamic analysis advantages:
- It identifies vulnerabilities in a runtime environment.
- Automated tools provide flexibility on what to scan for.
- It allows for the analysis of applications in which you do not have access to the actual code.
- It identifies vulnerabilities that might have been false negatives in the static code analysis.
- It permits you to validate static code analysis findings.
- It can be conducted against any application.
Dynamic analysis limitations:
- Automated tools provide a false sense of security that everything is being addressed.
- Automated tools produce false positives and false negatives.
- Automated tools are only as good as the rules they are using to scan with.
- There are not enough trained personnel to thoroughly conduct dynamic code analysis [as with static analysis].
- It is more difficult to trace the vulnerability back to the exact location in the code, taking longer to fix the problem.
Excellent information
ReplyDeleteWell drafted and very useful..Thanks
ReplyDeleteGreat workππ
ReplyDeleteReally helpful for my studies
ReplyDeleteKeep this good work going !!!!π€π€π€π€π€π€
ReplyDeleteExcellent blog, nice information
ReplyDeletevery Good article, convered all related point
ReplyDeleteExcellent π
ReplyDeleteInformative ! !
ReplyDeleteShort and informative article.Good workπ
ReplyDelete