CN110188029A - A kind of Java null pointer analysis system reaching analysis method based on definite value - Google Patents

A kind of Java null pointer analysis system reaching analysis method based on definite value Download PDF

Info

Publication number
CN110188029A
CN110188029A CN201910200070.4A CN201910200070A CN110188029A CN 110188029 A CN110188029 A CN 110188029A CN 201910200070 A CN201910200070 A CN 201910200070A CN 110188029 A CN110188029 A CN 110188029A
Authority
CN
China
Prior art keywords
source code
module
analysis
java
null pointer
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201910200070.4A
Other languages
Chinese (zh)
Inventor
陈森海
周晓聪
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Sun Yat Sen University
National Sun Yat Sen University
Original Assignee
National Sun Yat Sen University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by National Sun Yat Sen University filed Critical National Sun Yat Sen University
Priority to CN201910200070.4A priority Critical patent/CN110188029A/en
Publication of CN110188029A publication Critical patent/CN110188029A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3604Software analysis for verifying properties of programs
    • G06F11/3612Software analysis for verifying properties of programs by runtime analysis

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

The present invention relates to software static analysis fields, more particularly to a kind of Java null pointer analysis system for reaching analysis method based on definite value.Including projects module, filter module, source code module, console module, null pointer analysis module, result display module;The present invention will help developer to find that there are the suspection source code rows of null pointer exception in source code in time in the process of development, doubtful abnormal source code row directly can be shown and jump to by tool, it is more convenient and intuitively check source code and analysis to give developer, it modifies so as to corresponding source code, the legibility of source code is further improved and enhanced to source code structure, better source code style is formed, and develops more sophisticated software system.

Description

A kind of Java null pointer analysis system reaching analysis method based on definite value
Technical field
The present invention relates to software static analysis fields, more particularly to a kind of reach analysis method based on definite value Java null pointer analysis system.
Background technique
As two big language Java and C++ of object oriented language, in exploitation, pointer/reference is very universal. Pointer represents the memory storage address an of data type, in exploitation, if having invoked a direction address blank Pointer will cause null pointer exception, and the system that frequently can lead to directly collapses delay machine, therefore null pointer error is worked as in software development In be very common.So Developmental Engineer often carries out null reference judgement in returning the result for many call methods, have A little methods will do it judgement result is never empty, to influence the aesthetic feeling and legibility of source code.
According to the TIBO programming language ranking list of one or two years in past, the ratings of Java language is substantially C Plus Plus As many as twice, while the most of the time is located at first place, and ratings index often reacts heat of the language in programming language Degree and number of users.And online, static analysis tools commonly used by Java language have FindBugs, CheckStyle, PMD, Spotsbugs etc..And in these language, the program bag that some tools are provided solely for is with the plug-in unit of IDE or with command line mode Source code analysis is carried out, and because these tools are not to analyze individually for null pointer, in these tool static analyses As a result in, null pointer is relevant abnormal or prompt only accounts for the small scale in all results while the result is also not fully quasi- Really.
FindBugs carries out static analysis just for Java bytecode, it has not been convenient to it is directly targeted to the source code position to report an error, The rapid positioning and analysis of inconvenient developer, while the tool is not only directed to null pointer analysis, and exports result and close It is not high in the false detection rate of null reference.CheckStyle to source code inspection be only source code specification style on inspection and Error correction, the condition judged on null pointer dereference utilize few, while the journey that CheckStyle can not run directly Sequence packet can only go reading project and analysis project with IDE plug-in unit or command line mode.Remaining tool deficiency substantially and FindBugs is similar with the deficiency of Checkstyle.
Summary of the invention
In order to solve not showing null pointer analytic process when the prior art carries out static analysis and jump to the source to report an error The deficiency of code position, the present invention provides a kind of Java null pointer analysis systems that analysis method is reached based on definite value.
To realize the above goal of the invention, the technical solution adopted is that:
The projects module shows each project structure by java.swing.JTree with tree structure, passes through succession Javax.swing.tree.TreeNode shows and saves packet, class, method and attribute, and java.util.ArrayList class protects Inventory item source code and analysis result data;
The filter module utilizes java, and io.FIle class saves and read hard disk upper filter configuration information, and will Configuration information is converted into customized configuration information entity class;
The source code module passes through java.swing.JTextPane control exposure sound code file information and line number;
The console module is based on java.swing.TextArea control, analytic process can be output to tool Interface;
The null pointer analysis module is based on definite value and reaches analysis method, realizes and divides source code scanning and null pointer Analysis;
The result display module will show point of null pointer by java.swing.JTextPane with html format Analyse result.
Compared with prior art, the beneficial effects of the present invention are:
The present invention will help developer to find that there are the bosoms of null pointer exception in source code in time in the process of development Source code row is doubted, directly can show and jump to doubtful abnormal source code row by tool, it is more convenient and straight to give developer That sees checks source code and analysis, modifies so as to corresponding source code, and source code is further improved and enhanced to source code structure Legibility, form better source code style, and develop more sophisticated software system.
Compared to FindBugs, the present invention directly can analyze source code and jump;Compared to CheckStyle, the present invention The inconvenient program run mode such as the interface UI can be provided for developer, and rely on plug-in unit and order line, and be capable of providing Significantly more efficient null pointer analyzes result.
Detailed description of the invention
Fig. 1 is system framework figure of the invention.
Fig. 2 is that console module shows null pointer analytic process in embodiment 2.
Fig. 3 is the source code structure that project modules exhibit goes out the analyzed project in embodiment 2.
Fig. 4 is that result display module can export analysis result information in embodiment 2.
Fig. 5 is the sound code file in embodiment 2.
Specific embodiment
The attached figures are only used for illustrative purposes and cannot be understood as limitating the patent;
Below in conjunction with drawings and examples, the present invention is further elaborated.
Embodiment 1
As shown in Figure 1, the projects module shows each project knot by java.swing.JTree with tree structure Structure shows and saves packet, class, method and attribute by inheriting javax.swing.tree.TreeNode, Java.util.ArrayList class saves project source code and analysis result data;
The filter module utilizes java, and io.FIle class saves and read hard disk upper filter configuration information, and will Configuration information is converted into customized configuration information entity class;
The source code module passes through java.swing.JTextPane control exposure sound code file information and line number;
The console module is based on java.swing.TextArea control, analytic process can be output to tool Interface;
The null pointer analysis module is based on definite value and reaches analysis method, realizes and divides source code scanning and null pointer Analysis;
The result display module will show point of null pointer by java.swing.JTextPane with html format Analyse result.
Embodiment 2
By being loaded into project source code, null pointer analytic process can be shown in console module, as shown in Figure 2;It waits After analytic process is completed, as a result display module can export analysis result information, as shown in Figure 4;Meanwhile projects module exhibitions The source code structure of the analyzed project is shown, as shown in Figure 3;By clicking Fig. 2 underscore part, related source code text can be opened Part source code line position related to jumping to is set, as shown in Figure 5.
Obviously, the above embodiment of the present invention be only to clearly illustrate example of the present invention, and not be pair The restriction of embodiments of the present invention.For those of ordinary skill in the art, may be used also on the basis of the above description To make other variations or changes in different ways.There is no necessity and possibility to exhaust all the enbodiments.It is all this Made any modifications, equivalent replacements, and improvements etc., should be included in the claims in the present invention within the spirit and principle of invention Protection scope within.

Claims (1)

1. a kind of Java null pointer analysis system for reaching analysis method based on definite value, which is characterized in that including projects module, mistake Strainer modules, source code module, console module, null pointer analysis module, result display module;
The projects module shows each project structure by java.swing.JTree with tree structure, passes through succession Javax.swing.tree.TreeNode shows and saves packet, class, method and attribute, and java.util.ArrayList class protects Inventory item source code and analysis result data;
The filter module utilizes java, and io.FIle class saves and read hard disk upper filter configuration information, and will configuration Information is converted into customized configuration information entity class;
The source code module passes through java.swing.JTextPane control exposure sound code file information and line number;
The console module is based on java.swing.TextArea control, analytic process can be output to tools interfaces;
The null pointer analysis module is based on definite value and reaches analysis method, realizes the analysis to source code scanning and null pointer;
The result display module will show the analysis knot of null pointer by java.swing.JTextPane with html format Fruit.
CN201910200070.4A 2019-03-15 2019-03-15 A kind of Java null pointer analysis system reaching analysis method based on definite value Pending CN110188029A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910200070.4A CN110188029A (en) 2019-03-15 2019-03-15 A kind of Java null pointer analysis system reaching analysis method based on definite value

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910200070.4A CN110188029A (en) 2019-03-15 2019-03-15 A kind of Java null pointer analysis system reaching analysis method based on definite value

Publications (1)

Publication Number Publication Date
CN110188029A true CN110188029A (en) 2019-08-30

Family

ID=67713695

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910200070.4A Pending CN110188029A (en) 2019-03-15 2019-03-15 A kind of Java null pointer analysis system reaching analysis method based on definite value

Country Status (1)

Country Link
CN (1) CN110188029A (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020129337A1 (en) * 2001-03-08 2002-09-12 International Business Machines Corporation Debugger probe for object oriented programming
US20040220774A1 (en) * 1999-12-29 2004-11-04 Anant Agarwal Early warning mechanism for enhancing enterprise availability
CN101017458A (en) * 2007-03-02 2007-08-15 北京邮电大学 Software safety code analyzer based on static analysis of source code and testing method therefor
CN101566968A (en) * 2009-05-20 2009-10-28 阿里巴巴集团控股有限公司 Method for checking null pointer in source code and computer system
CN102981953A (en) * 2012-11-12 2013-03-20 中国矿业大学 Breakdown automatically-positioning method for null pointer abnormity
CN103218296A (en) * 2013-04-22 2013-07-24 北京邮电大学 Method of fully detecting null pointer reference defects
US20140082598A1 (en) * 2012-09-20 2014-03-20 International Business Machines Corporation Code conversion method, program, and system for garbage collection
CN104965788A (en) * 2015-07-03 2015-10-07 电子科技大学 Code static detection method

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040220774A1 (en) * 1999-12-29 2004-11-04 Anant Agarwal Early warning mechanism for enhancing enterprise availability
US20020129337A1 (en) * 2001-03-08 2002-09-12 International Business Machines Corporation Debugger probe for object oriented programming
CN101017458A (en) * 2007-03-02 2007-08-15 北京邮电大学 Software safety code analyzer based on static analysis of source code and testing method therefor
CN101566968A (en) * 2009-05-20 2009-10-28 阿里巴巴集团控股有限公司 Method for checking null pointer in source code and computer system
US20140082598A1 (en) * 2012-09-20 2014-03-20 International Business Machines Corporation Code conversion method, program, and system for garbage collection
CN102981953A (en) * 2012-11-12 2013-03-20 中国矿业大学 Breakdown automatically-positioning method for null pointer abnormity
CN103218296A (en) * 2013-04-22 2013-07-24 北京邮电大学 Method of fully detecting null pointer reference defects
CN104965788A (en) * 2015-07-03 2015-10-07 电子科技大学 Code static detection method

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
吴涛: "Java数组越界检测系统的设计与实现", 《中国优秀硕士学位论文全文数据库 信息科技辑》 *
郭涛,阮辉,严俊: "Java程序中数组越界和空指针错误的静态分析", 《电子学报》 *

Similar Documents

Publication Publication Date Title
Ocariza et al. An empirical study of client-side JavaScript bugs
JP7201078B2 (en) Systems and methods for dynamically identifying data arguments and instrumenting source code
US8943423B2 (en) User interface indicators for changed user interface elements
US8850581B2 (en) Identification of malware detection signature candidate code
Novak et al. Taxonomy of static code analysis tools
CN101964036B (en) Leak detection method and device
CN104239158A (en) Analysis engine for automatic analysis and error log linking
CN106462434A (en) Incremental compilation of whole program code
CN103257919B (en) Inspection method and device for script programs
Kirbas et al. The relationship between evolutionary coupling and defects in large industrial software
CN102567200A (en) Parallelization security hole detecting method based on function call graph
CN109101237A (en) The encryption Compilation Method and device of code
US9304893B1 (en) Integrated software development and test case management system
CN105589805A (en) Method and device for generating code coverage rate report
US20060070043A1 (en) System and method for analyzing computer code
CN107015903B (en) Interface test program generation method and device and electronic equipment
CN114911711A (en) Code defect analysis method and device, electronic equipment and storage medium
KR20080043345A (en) Declaratively defined control actions
CN103365772B (en) Software test automatic evaluation device and method
WO2017141893A1 (en) Software analysis apparatus and software analysis method
CN110286912B (en) Code detection method and device and electronic equipment
US9171168B2 (en) Determine anomalies in web application code based on authorization checks
US10318403B2 (en) Code update based on detection of change in runtime code during debugging
CN110188029A (en) A kind of Java null pointer analysis system reaching analysis method based on definite value
US10762211B2 (en) Source code diagnostic instrument

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20190830

RJ01 Rejection of invention patent application after publication