Font Size: a A A

Code Query Technology Based On First-Order Predicate Logic

Posted on:2012-05-01Degree:MasterType:Thesis
Country:ChinaCandidate:Z CengFull Text:PDF
GTID:2268330425483597Subject:Computer application technology
Abstract/Summary:PDF Full Text Request
With the rapid progress in software techniques, the size and complexity of software grow up quickly, which requires software to be with higher and higher quality. Code review and testing are common techniques for software quality assurance. Code review technique relies on locating codes that violate coding standards. Instrumentation is widely adopted in testing process. Its key step is to find the instrumentation points that are specified by conditions. Code query technique is the primary enabling technique to meet the requirement of them. It permits users to specify query conditions both in grammatical structure and in semantic relation, and retrieves codes segments or information accordingly.How to design and interpret query languages is the core challenge in designing query techniques. Expressive capability of a query language, i.e. the ability to organize query conditions, determines the ability of the corresponding code query technique. Faced with the technique requirement of code review and testing, when specifying query conditions, there are two deficiencies in existing code query techniques:1. the expressive ability weakness in logical when constructing compound query conditions from primary ones.2. the loss of granularity in some program elements’information.To address these issues, a new code query technology supporting first-order predicate logic is proposed in the paper. The main contributions include:●A new query language based on first-order predicate logic is proposed. It supports to specify information about four kinds of program elements:classes, functions, statements and variables. In terms of logical expressive capability, it allows to compose prime conditions to compound condition via first-order predicate logic. ●An intermediate representation of program element information is designed. It stores information about both semantic and grammatical of code, which is extracted by static analysis on codes.●A query engine supporting above query language is designed and implemented. The engine takes charge of parsing query commands, searching targets and returning query results.●Adopting the query technique, a tool prototype for C/C++language, called C2Query, is developed. It is released as an Eclipse plug-in. By checking several rules in the MISRA-C++coding standard, the effectiveness and ability of the proposed technique and the tool are shown.
Keywords/Search Tags:Code Query, Code Query Language, First-Order Predicate Logic, Program Analysis, Code Review
PDF Full Text Request
Related items