Automated Source Code Analysis Whitepaper

Share |

An abstract syntax tree, or AST for short, is simply a tree-structured representation of the source code as might be typically generated by the preliminary parsing stages of a compiler.





















(I-Newswire) March 15, 2010 - Abstract Syntax Trees

An abstract syntax tree, or AST for short, is simply a tree-structured representation of the source code as might be typically generated by the preliminary parsing stages of a compiler. This tree contains a rich breakdown of the structure of the code in a non-ambiguous manner, allowing for simple searches to be performed for anomalous syntax.

Consider the example of an organization wishing to enforce a set of corporate coding standards. Stated in the standard is the basic requirement for the use of a compound statement block rather than single statements as the body of a loop (e.g. a for-loop). In this case,

Code Path Analysis
Consider now a more complex example. This time instead of looking for style violations, we wish to check whether an attempted dereference of a pointer should be expected to succeed or fail:

if( x & 1 )
ptr = NULL;
*ptr = 1;

In this case it is obvious from manual inspection that the variable “ptr” can assume a NULL value whenever the variable “x” is odd, and that this condition will cause an unavoidable zero-page dereference.

Attempting to find a bug of this type using AST scanning, however, is seriously non-trivial. Consider the (simplified, for clarity) AST that would be created from that snippet of code:

Statement Block
If-statement
Check-Expression
Binary-operator &
x
1
True-Branch
Expression-statement
Assignment-operator =
ptr
0
Expression-statement
Assignment-operator =
Dereference-pointer - ptr
1

In this case, there is no obvious tree search or simple node enumeration that could cover the attempted, and at least occasionally illegal, dereferencing of “ptr” in anything like a reasonably generalized form. So for cases such as this, it is necessary to take a step beyond simply searching for patterns of syntax.

What type of issues can be found?
In this section, we will walk through a number of examples of problems that can be identified using modern static source code analysis tools, showing how they occur and what can happen if they are not remedied before shipment. Whilst many more types of weakness can be found using Klocwork’s tools, these examples should give the reader a firm grounding in what a good static analysis suite can do, regardless of the vendor.

Note that the examples given here are shown in a variety of C/C++ and Java. Where appropriate, the relevant capabilities within the product are available in all supported languages, however.
Security vulnerabilities
Traditionally of interest to developers working on consumer-facing applications, security is becoming more and more critical to developers in all types of environments, even those that have until recently considered source code security to be a non-issue. Some of the more important areas of security that can be found with automated source code analysis are:

• Denial of service
• SQL injection
• Buffer overflow
• Cross-site scripting (XSS)
Process/file injection


Notes for Editors

Gwyn Fisher is the CTO of Klocwork, a leading developer of source code analysis software and he is expert in static code analysis software. At klocwork, he is responsible for guiding the company's technical direction and strategy of automated source code analysis.

He is responsible for guiding the company's technical direction and strategy. With nearly 20 years of global technology experience, he brings a valuable combination of vision, experience, and direct insight into the developer perspective.

http://www.klocwork.com/solutions/FDA/
http://www.klocwork.com/products/insight/architect-code-visualization/

Klocwork is an enterprise software company providing automated source code analysis software products that automate security vulnerability and quality risk assessment, remediation, measurement for C, C++ and Java software and java static analysis. More than 300 organizations have integrated Klocwork's automated source code analysis tools into their software development process in order to ensure their code is free of mission-critical flaws while freeing their developers to focus on what they do best – innovate.

























About Klocwork:
Klocwork is an enterprise software company providing automated source code analysis software products that automate security vulnerability and quality risk assessment, remediation, measurement for C, C++ and Java software and java static analysis. More than 300 organizations have integrated Klocwork's automated source code analysis tools into their software development process in order to ensure their code is free of mission-critical flaws while freeing their developers to focus on what they do best – innovate.

Company Contact Information
Klocwork
Todd Landry
15 New England Executive Park
01803
Phone : 1.866.556.2967




Computer > Software

code   automated   source code analysis   analysis   Source   code analysis   static code analysis   Source code   Static   FDA software   software validation  

March 15, 2010

If you have questions regarding information in this press release contact the company listed above. I-Newswire.com is a press release service and not the author of this press release.The information that is on or available through this site is for informational purposes only and speaks only as of the particular date or dates of that information. As some companies and PR Agencies submit their press releases once per week,month or quarter,make sure to check the official company website for accurate release dates as our site displays the I-Newswire.com press release distribution date only.We do not guarantee the accuracy or completeness of information on or available through this site, and we are not responsible for inaccuracies or omissions in that information or for actions taken in reliance on that information.


Related Releases

PG Calculator: New Scientific Calculator For Android And IPhone
Get Real About Numbers With The PG Calculator App - The Only Calculator You Will Ever Need

Aware Bear Computer Repair Pittsford, NY Data Recovery Rochester, NY DriveSavers 10% OFF Coupon Code DS20735
Since 1985, DriveSavers, Inc. has been the leader in the data recovery industry, helping thousands of customers that experienced some sort of data loss. This brand new service offered by Aware Bear Computer Repair in Pittsford NY can help individuals

Auditweaver to Launch Supplier Network for Secure Material Tracking and Collaboration
One supply chain, one account! Make connections, share data within network with a simple search and request approval! Material Specifications, Quality Data, and LIMS data may be securely shared with target suppliers and contract manufacturers.

Export & Import Documentation With Incentive Scheme Add On Module To ERP
iTAX-EXIM software provide pre & post shipment document, LC Tracking for Import & Export, LC Submission of documents to bank, Submission Document to bank after import & export along with tracking of inventory.

Carrot App Provides Device Locking Solution to Verizon Retail Stores
Verizon will use EAP 3.0 from CarrotApp to manage the mobile devices in retail stores.


Other I-Newswire portals: Cars For Sale | Real Estate Listings | Find Jobs
© Copyright 2010 I-Newswire.com - free press release service. All rights reserved