Font Size: a A A

Research On Null Pointer Analysis Method For Java And Kotlin Hybrid Code

Posted on:2022-12-30Degree:MasterType:Thesis
Country:ChinaCandidate:K X ZhangFull Text:PDF
GTID:2518306758492284Subject:Automation Technology
Abstract/Summary:PDF Full Text Request
Null-pointer exception is a common defect in software development,which is an important cause of software abnormal operation or forced exit.Kotlin,an official Language for Android development in recent years,has its own stringent security checks for space issues.However,due to Kotlin's relatively short life and the ongoing development nature of the project,many projects are actually co-developed by Kotlin and Java.When the code in both languages is mixed,Kotlin will relax checks on the information passed by the Java part when interoperating with Java,which will lead to more null-pointer exception problems.At present,the research work of null pointer problem is mainly focused on the Java language development projects,it is difficult to support the effective detection of this problem in the Java and Koltin language mixed development projects.Therefore,this paper proposes a null pointer analysis method for Java and Koltin hybrid code,based on the static analysis of the program,by analyzing the flow path of data in the hybrid code,we find the potential null value that may appear,and then realize the accurate location of the null pointer problem.Specific work contents are as follows:(1)Data flow analysis for hybrid codes.Based on the interval analysis method,the control flow information of the method in the program is obtained,and the function calling relationship is determined by using the class-level method,and then the control flow of the whole program is integrated by the control flow and function calling relationship of each method.On this basis,the function is analyzed in reverse order according to the topological relation of function call,and the function abstract is generated,the key information such as method name,parameter and return value is stored,and the characteristic information is extracted and the fixed value information is generated for the control flow between processes,and the data flow analysis of the whole program is completed.(2)Location of null pointer problem based on data flow information.Based on the detailed analysis of null pointer fault in hybrid code,the null pointer fault in hybrid code is abstracted into a mode,and a fault mode state machine is established.The state machine is iterated on the basis of hybrid code data flow information,and the state changes are analyzed by calculating state transition conditions,and the possible null pointer faults are detected.A null pointer fault report is generated from the detected null pointer fault and submitted to the developer to provide reference information for the development and testing of the project.(3)Verify the effectiveness of the method and the usefulness of the experimental results by conducting experiments on three projects on GitHub and investigating the analysis results.The results show that the null pointer analysis method can detect potential null pointer anomalies based on the data flow analysis of the code,with an average recall rate of 82.67% and an average accuracy of 77.04%,showing a high recall rate and accuracy.The average degree of certainty of participants to null pointer fault results was 83.67%,and the average degree of certainty of visual reports was 82%,indicating that participants had a high degree of certainty.The above results prove that the method presented in this paper can provide an important reference for developers to analyze null pointers in software development and testing.
Keywords/Search Tags:Software development, Hybrid code, Data flow, Null pointer analysis
PDF Full Text Request
Related items