Font Size: a A A

A Generic Automated Detection Tool For C Language Based On MISRA Standard

Posted on:2015-08-06Degree:MasterType:Thesis
Country:ChinaCandidate:D LiaoFull Text:PDF
GTID:2308330473451571Subject:Electronic and communication engineering
Abstract/Summary:PDF Full Text Request
The security and reliability of software are required to be high in the embedded field. Although C language is widely used for embedded software development language, it has a lot of security problems caused by usage mode easily. Designing automatic detection tool that supports “C language programming security rule sets” to strengthen the usage mode of C language has become an effective way to improve the reliability and security of the program. The public literatures show that the C programming standards for high security and reliability software development and generic tools for C code rules detection in embedded field are barely developed in our country so far. MISRA C: 2004 stands out from a number of programming standards and has become an influential programming standard for software development in the embedded field of high security and reliability. Therefore, designing and implementing a generic automatic detection tool based on MISRA C: 2004 standard is of important practical significance.A deep study about methods that detect whether the C code fits the rules in MISRA C: 2004 is made in this thesis. A generic automatic detection tool for C language based on MISRA standard is designed and implemented. The main contents of this paper are as follows:1. A research about existing static information extraction methods is made. As the completeness and normative of extracting static information are required, LEX and YACC in Parser Generator are introduced to construct lexical, syntax analyzer to extract information against. And some research on key technologies of constructing lexical and syntax analyzer through LEX and YACC are made.2. The implementation of existing code rule detection tools are compared and analyzed. For the different rules of MISRA standard, the study of code rule detection approaches are made based on the idea of expansion to lexical analysis and syntax analysis. The method to detect code rule is then established.3. Demand analysis for the generic automatic detection tools based on MISRAC: 2004 is made, and the main framework is designed. Each module function is realized. The module functions include five parts. The first two parts are the building, maintaining and operating of configuration files based on MISRA rules. The third part is using YACC structure to build a syntax analyzer with support MISRA standard and converting the static information of the source code to an intermediate model using lexical analysis constructed by LEX. The fourth part is using detection algorithm to traversal and match the intermediate model to implement detection of MISRA rules. The fifth part is results checking and exporting.4. Verify the validity of the tools’ function as the C code is the testing object. The results show that the generic automated detection tool for C language based on MISRA standard can achieve the proposed functional requirements and the test results are accurate.
Keywords/Search Tags:MISRA C, code rules detection, lexical analysis, syntax analysis, detection algorithm
PDF Full Text Request
Related items