| In recent years, the applications of computer software have been infiltrated into national defense, aerospace, transportation, medical care and other key areas, so improving software quality has become a very urgent task. Software testing is an important means to guarantee software quality. Compared to dynamic testing, static defect detection finds defects early in the software development cycle without executing the software. Therefore, in order to reduce the manpower-and time-consuming of artificial defect inspection and improve the practicability of static defect detection tools, how to improve the accuracy of static defect detection has become the research focus in the field.The core work of this paper is the research of refinement technology of static defect detection based on constraint solving, aiming to explore how to improve the accuracy of static defect detection. Based on the analysis results of DTS (Defect Testing System), this paper proposes a method to eliminate false positives based on constraint solving, further refining the testing results. Once the static defect detection reports a potential defect, path constraints are extracted on the defect path, and the satisfiability of the potential defect could be determined by the collection of extracted path constraints and the dataflow of the potential defect point with the help of a constraint solver. If no solution is found, tue potential defect is a false positive. In addition, the static analysis of program semantics associated with the specific execution status of software (such as circulations and function calls) is relatively conservative. In order to obtain precise dataflow, this paper presents a refinement method combining dynamic execution and regression analysis:precise runtime information is obtained through dynamic execution, and the regression analysis technology is introduced to summary the dynamic execution results for many times, then the symbolic of the variable to be analyzed is substituted, obtaining more precise value interval or generating symbolic function summary according to different needs, which improving the accuracy of interval analysis of static defect detection, further improving the accuracy of constraint solving and making the results more meaningful.Some open-source projects were selected for valuate the proposed methods. The results of the experiments showed that the proposed methods can reduce false positives, improving the accuracy of static defect detection. |