WO2013174200A1 - 代码分析方法及代码分析系统、计算机存储介质 - Google Patents

代码分析方法及代码分析系统、计算机存储介质 Download PDF

Info

Publication number
WO2013174200A1
WO2013174200A1 PCT/CN2013/075095 CN2013075095W WO2013174200A1 WO 2013174200 A1 WO2013174200 A1 WO 2013174200A1 CN 2013075095 W CN2013075095 W CN 2013075095W WO 2013174200 A1 WO2013174200 A1 WO 2013174200A1
Authority
WO
WIPO (PCT)
Prior art keywords
code
analysis
code analysis
change list
execution plan
Prior art date
Application number
PCT/CN2013/075095
Other languages
English (en)
French (fr)
Inventor
符阳辉
Original Assignee
腾讯科技(深圳)有限公司
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 腾讯科技(深圳)有限公司 filed Critical 腾讯科技(深圳)有限公司
Priority to US14/402,821 priority Critical patent/US9378114B2/en
Publication of WO2013174200A1 publication Critical patent/WO2013174200A1/zh

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/3608Software analysis for verifying properties of programs using formal methods, e.g. model checking, abstract interpretation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/75Structural analysis for program understanding
    • 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

Definitions

  • the present invention relates to the field of code analysis technology, and in particular, to a code analysis method, a code analysis system, and a computer storage medium shield. Background technique
  • a code analysis tool is a tool that analyzes the original code or compiled code and obtains an evaluation report without the need to execute code, aiming at finding the programming flaws of the original code, such as normativeness, logic, and security.
  • the code analysis tool typically analyzes the code stored in the software configuration management library and outputs the results according to the established analysis rules.
  • an object of the present invention is to provide a code analysis method
  • another object of the present invention is to provide a code analysis device that can implement code analysis requirements of different types of programming languages and reduce development. The workload of personnel and testers improves the efficiency of code analysis.
  • a code analysis method including steps: Get a list of code changes;
  • a code analysis system including:
  • a change detection unit configured to obtain a code change list
  • a code pre-analysis unit configured to analyze the code change list, obtain a change list corresponding to each programming language type in the code change list, and determine a mapping relationship between the change list and a corresponding programming language type;
  • An execution unit configured to acquire corresponding code analysis tool information and analysis rule information according to the mapping relationship, generate an execution plan, and execute a code analysis process by using a corresponding code analysis tool and an analysis rule according to the execution plan to obtain a code analysis result.
  • One or more computer storage shields comprising computer executable instructions for performing a method of code analysis, the method comprising the steps of:
  • the code change list is obtained, and the code change list is analyzed, and the change list corresponding to each programming language type in the code change list is obtained, and the mapping relationship between the change list and the corresponding programming language type is determined. And based on the mapping relationship, the matching code analysis tool and the analysis rule execution analysis process are obtained, and the analysis result is obtained, which realizes the integration of various code analysis tools and analysis rules, and can well adapt to the code of different types of programming languages. Analyze the requirements, reduce the workload of R & D personnel, testers, and improve the efficiency of code analysis.
  • Embodiment 1 is a schematic flow chart of Embodiment 1 of a code analysis method according to the present invention
  • Embodiment 2 is a schematic flow chart of Embodiment 2 of the code analysis method of the present invention.
  • 3 is a schematic structural diagram of an embodiment of a code analysis system of the present invention
  • 4 is a schematic block diagram of an operating environment in which the present invention may be implemented. detailed description
  • FIG. 1 it is a schematic flowchart of the first embodiment of the code analysis method of the present invention. As shown in FIG. 1 , the code analysis method in the first embodiment includes the following steps:
  • Step S101 obtaining a code change list, proceeds to step S102;
  • Step S102 analyzing the code change list, obtaining a change list corresponding to each programming language type in the code change list, determining a mapping relationship between the change list and the corresponding programming language type, and proceeding to step S103;
  • Step S 103 Obtain corresponding code analysis tool information and analysis rule information according to each mapping relationship, generate an execution plan, and proceed to step S104;
  • Step S104 Perform a code analysis process by calling a corresponding code analysis tool and an analysis rule according to the execution plan to obtain a code analysis result.
  • the code change list is obtained, and the code change list is analyzed, and the change list corresponding to each programming language type in the code change list is obtained, and the mapping relationship between the change list and the corresponding programming language type is determined. And based on the mapping relationship, the matching code analysis tool and the analysis rule execution analysis process are obtained, and the analysis result is obtained, which realizes the integration of various code analysis tools and analysis rules, and can well adapt to the code of different types of programming languages. Analyze the requirements, reduce the workload of R & D personnel, testers, and improve the efficiency of code analysis.
  • the code change list may be obtained by setting different trigger conditions based on different application scenarios or consideration factors, wherein one way is to preset the scan frequency, and according to The preset scan frequency scans each code software configuration management library to obtain the above code change list.
  • the code analysis instruction may be input by inputting code when the code analysis is required (for example, by clicking a button of a start code analysis process) Etc.) After receiving the code analysis command, scan each code software configuration management library to obtain the above code change list.
  • the first mode described above can be used, thereby automatically detecting the status in the code software configuration management library, automatically triggering the execution of the code analysis process, and further reducing the workload of the developer, the tester, and the like. .
  • Each of the above-mentioned code software configuration management libraries may be set according to actual needs, and may be one or more than two, and details are not described herein.
  • the code change list is acquired in the above step S101, if the code is not changed, the subsequent steps are not entered, and if there is a change, the pre-analysis process of the subsequent step S102 is entered.
  • the code change list since the code change list is extracted from different code software configuration management libraries, and the storage format of each code software configuration management library may not be the same, directly entering the subsequent processing may affect the efficiency of subsequent generation of the execution plan. Therefore, in the solution of the present invention, the code change list obtained above may be stored in the first preset format type to facilitate the reference of step S102.
  • the first preset format type here can use various possible formats, as long as it can conform to the description manner expressed by the information structure, because the xml file format type is open, single, self-descriptive, structure and content.
  • the advantages of separation, extensibility, and the like are independent of the platform. Therefore, in general, the first preset format type can be set to the xml format type.
  • step S102 the code change list is analyzed, and when the mapping relationship is determined, the mapping relationship is determined according to different programming language types. For example, it is assumed that there are two programming language types in the code change list (C++, Java), then after the pre-analysis process of step S102, the mapping relationship between the C++ and the C++-encoded code change list and the change list of the java and the java-encoded code are obtained. Mapping relationship. After obtaining the mapping relationship between each programming language type and the corresponding change list, you can directly enter the subsequent process of generating the execution plan.
  • each of the above mapping relationships may be converted into a second preset format type and then stored.
  • the subsequent execution plan can be generated based on the same format regardless of the change list of the original format type.
  • the second preset format type may be in various possible formats, as long as the description manner expressed by the information structure can be met, and the second preset format type may be the same as the first preset format type, or Not the same. Since the xml file format type has the advantages of openness, singleness, self-descriptiveness, separation of structure and content, strong extensibility, and platform-independent, in general, the second preset format type can be set to The xml format type.
  • the corresponding code analysis tool information and the analysis rule information can be obtained, and an execution plan is generated, and the process can be performed in the background.
  • the correspondence between each programming language type, the code analysis tool, and the analysis rule needs to be pre-stored.
  • the execution plan is generated, the corresponding language relationship may be obtained according to the corresponding relationship.
  • the code list needs to use which code analysis tool, which analysis rule to use for code analysis, and the information of the code analysis tool and the analysis rule information to generate the execution plan.
  • the generated execution schemes may be stored in a third preset format type, so as to be executed based on an execution scheme of the same format type when performing analysis according to the execution scheme, so as to reduce the complexity of executing the execution scheme, and further improve effectiveness.
  • the third preset format type may be in various possible formats, as long as the description manner expressed by the information structure can be met, and the third preset format type and the first preset format type and the second pre-predetermined The format types can be the same or different. Since the xml file format type has the advantages of openness, singleness, self-descriptiveness, separation of structure and content, and strong extensibility, and is platform-independent, in general, the third preset format type can be set to The xml format type.
  • each of the generated execution schemes may be stored in a task queue manner, so that the code analysis process can be performed by discovering whether there is an execution scheme in the task queue.
  • the corresponding code analysis tool and the analysis rule are called to execute the code analysis process, and the code analysis result is obtained, and the obtained code analysis result can be output and displayed for the user to view, on the other hand, the obtained code.
  • the analysis result can also be saved in the analysis result library, and can be outputted at the same time or via the analysis result library, and the display mode can adopt various possible forms, for example, display by WEB interface and the like.
  • FIG. 2 is a schematic flowchart of the second embodiment of the code analysis method of the present invention.
  • the difference from the first embodiment is mainly that the embodiment obtains each mapping relationship and also generates The identifier bit corresponding to each mapping relationship acquires corresponding code analysis tool information and analysis rule information according to the identifier bit, and generates an execution plan.
  • the code analysis method in the second embodiment includes the following steps:
  • Step S201 Obtain a code change list, and proceed to step S202;
  • Step S202 analyzing the code change list, obtaining a change list corresponding to each programming language type in the code change list, determining a mapping relationship between the change list and a corresponding programming language type, and generating a corresponding code analysis tool
  • the information bit corresponding to the information and the analysis rule information proceeds to step S203;
  • Step S203 Acquire corresponding code analysis tool information and analysis rule information according to each of the above identifiers, generate an execution plan, and proceed to step S204;
  • Step S204 Perform a code analysis process by calling a corresponding code analysis tool and an analysis rule according to the execution plan to obtain a code analysis result.
  • the foregoing identification bit may be generated according to a programming language type, a file type, an external user setting, etc., and the identification bit indicates, indicates or represents which type of feature file should use which code analysis tool, which analysis rule To carry out the code analysis process, the specific setting manner of the flag bit can be set according to actual needs, and will not be described here.
  • Other technical features in the second embodiment are the same as those in the first embodiment, and are not described herein.
  • the present invention also provides a code analysis system
  • Fig. 3 is a block diagram showing the structure of the code analysis system embodiment of the present invention.
  • the code analysis system in this embodiment includes:
  • a change detecting unit 301 configured to obtain a code change list
  • the code pre-analysis unit 302 is configured to analyze the code change list, obtain a change list corresponding to each programming language type in the code change list, and determine a mapping relationship between the change list and a corresponding programming language type;
  • the unit 303 is configured to obtain corresponding code analysis tool information and analysis rule information according to each mapping relationship, generate an execution plan, and execute a code analysis process by using a corresponding code analysis tool and an analysis rule execution code analysis process according to the execution plan to obtain a code analysis result.
  • the foregoing analysis execution unit 303 may specifically include:
  • the execution plan generating unit 3031 is configured to obtain corresponding code analysis tool information and analysis rule information according to each mapping relationship, and generate an execution plan.
  • the task execution unit 3032 is configured to execute a code analysis process according to each execution plan by calling a corresponding code analysis tool and an analysis rule to obtain a code analysis result.
  • the code change list is acquired by the change detecting unit 301, and the code change list 302 analyzes the code change list to obtain a change list corresponding to each programming language type in the code change list, and determines the change list.
  • a mapping relationship with a corresponding programming language type and the analysis execution unit 303 generates an execution plan based on the mapping relationship and calls an adapted code analysis tool and an analysis rule to perform an analysis process, and obtains an analysis result, which implements multiple code analysis.
  • the integration of tools and analysis rules can adapt to the code analysis requirements of different types of programming languages, reducing the workload of developers and testers, and improving the efficiency of code analysis.
  • the code change list may be obtained by setting different trigger conditions based on different application scenarios or consideration factors, wherein one way is to preset the scan frequency, and according to The preset scan frequency scans each code software configuration management library to obtain the above code change list.
  • the code analysis instruction may be input by inputting code when the code analysis is required (for example, by clicking a button of a start code analysis process) Etc.) After receiving the code analysis command, scan each code software configuration management library to obtain the above code change list.
  • the first mode described above can be used, thereby automatically detecting the status in the code software configuration management library, automatically triggering the execution of the code analysis process, and further reducing the workload of the developer, the tester, and the like. .
  • Each of the above code software configuration management libraries can be set according to actual needs, and can be one or two. The above plurality will not be described here.
  • the code change list acquired by the change detecting unit 301 is extracted from different code software configuration management libraries, and the storage format of each code software configuration management library may not be the same, directly entering the subsequent processing may affect subsequent generation execution. The efficiency of the program. Therefore, in the solution of the present invention, the code change list obtained by the change detecting unit 301 can be stored in the first preset format type to facilitate the application of the code pre-analysis unit 302.
  • the first preset format type here can use various possible formats, as long as it can conform to the description manner expressed by the information structure, because the xml file format type is open, single, self-descriptive, structure and content.
  • the advantages of separation, extensibility, and the like are independent of the platform. Therefore, in general, the first preset format type can be set to the xml format type.
  • the code pre-analysis unit 302 determines the mapping relationship when determining the mapping relationship, and the mapping relationship is determined by different programming language types. For example, it is assumed that there are two programming language types in the code change list ( C++, java), then after the pre-analysis process, you will get the mapping relationship between C++ and the change list changed in C++ code, and the change list of java and java coded code. Mapping relations.
  • the storage format of each code software configuration management library may not be the same, resulting in a mapping relationship between each programming language type and the change list.
  • the format types are also different. Especially in the case of a large number of programming language types, direct entry into subsequent processing may affect the efficiency of subsequent generation of execution schemes. Therefore, in the solution of the present invention, the code pre-analysis unit 302 can also store the above mapping relationships into the second preset format type. Thus, when the execution plan is subsequently generated, the subsequent execution plan can be generated based on the same format regardless of the change list of the original format type.
  • the second preset format type may use various possible formats, as long as the description manner expressed by the information structure can be met, and the second preset format type may be the same as the first preset format type, and may also be Not the same. Since the xml file format type has the advantages of openness, singleness, self-descriptiveness, separation of structure and content, strong extensibility, and platform-independent, in general, the second preset format type can be set to The xml format type.
  • the analysis execution unit 303 can obtain corresponding code analysis tool information and analysis rule information based on the mapping relationship, and generate an execution plan, which can be performed in the background.
  • the implementation of the solution of the present invention needs to pre-store the correspondence between each programming language type, the code analysis tool, and the analysis rule. Therefore, as shown in FIG. 3, in the solution of the present invention, :
  • the information database 304 is configured to store the code analysis tool, the analysis rule, and the code analysis tool, and the correspondence between the analysis rule and each programming language type.
  • the change list for the programming language type may be obtained according to the correspondence relationship. Which code analysis tool is used, which analysis rule is used for code analysis, and the information of the code analysis tool and the analysis rule information are generated according to the need to generate an execution plan.
  • the generated execution schemes may be stored in a third preset format type, so as to be executed based on an execution scheme of the same format type when performing analysis according to the execution scheme, so as to reduce the complexity of executing the execution scheme, and further improve effectiveness.
  • the third preset format type may be in various possible formats, as long as the description manner expressed by the information structure can be met, and the third preset format type and the first preset format type and the second pre-predetermined The format types can be the same or different. Since the xml file format type has the advantages of openness, singleness, self-descriptiveness, separation of structure and content, and strong extensibility, and is platform-independent, in general, the third preset format type can be set to The xml format type.
  • the execution execution unit 303 or the execution plan generation unit 3031 may be stored in a task queue.
  • the analysis execution unit 303 may further include:
  • the task queue memory 3033 is configured to store each of the execution plans in a task queue manner.
  • task execution unit 3032 can perform the code analysis process by discovering whether there is an execution plan in task queue memory 3033.
  • the corresponding code analysis tool and the analysis rule are called to execute the code analysis process, and the code analysis result is obtained.
  • the code analysis tool and analysis rules can be directly from the above information database
  • the code analysis result obtained by the analysis execution unit 303 or the task execution unit 3032 can be output and displayed for the user to view, on the other hand, the obtained code analysis result can also be saved in the analysis result library, and can be simultaneously or via the
  • the analysis result library is outputted and displayed in various possible forms, such as displaying on the WEB interface.
  • the code pre-analysis unit 302 generates a flag corresponding to the corresponding code analysis tool information and analysis rule information while determining each mapping relationship; Therefore, the analysis execution unit 303 obtains the corresponding code analysis tool information and the analysis rule according to the identifier bit, and details are not described herein.
  • the information stored in the information database 304 should include a code analysis tool, an analysis rule, and a code analysis tool, and a correspondence between the analysis rule and each identifier.
  • the information database 304 in each embodiment of the solution of the present invention may be divided into several according to different functions to implement storage of different information, for example, may include a tool information base, an analysis rule base, a knowledge base, and are stored by the tool information base.
  • Each code analysis tool, the analysis rule base stores the analysis rules
  • the knowledge base can store code analysis tools, analysis rules and Correspondence between each programming language type and/or identification bit.
  • a library of analysis results may be included to store the result of each code analysis obtained above, so that the user can view or output the code analysis result through the analysis result library.
  • the above information database 304 may use the mysql database to store related data.
  • analysis rule base it is used to store each analysis rule, mainly for the management of analysis rules supported by various code analysis tools.
  • a specific example of the content included in the analysis rule base is shown in the following table:
  • the decomposition result library As an example, it is mainly used to store code analysis results.
  • a specific example of the contents of the analysis result library is shown in the following table: Field description
  • F result id KEY primary key, non-empty, analysis result, mainly refers to the id of the analyzed code problem
  • the severity level of the F level problem may be different according to actual needs, for example, only the source code may be needed according to requirements.
  • the analysis is performed.
  • the above code change list is a source code change list.
  • FIG. 4 is a schematic block diagram of an operating environment in which the above-described embodiments can be implemented.
  • the computer system 400 is configured to perform code analysis on one or more software entities.
  • computer system 400 includes a processor 401 and a system memory 402.
  • Computer system 400 is intended to broadly represent any processor-based system upon which software can be executed for the benefit of the user.
  • computer system 400 can include a desktop computer system, a laptop computer, or a tablet computer.
  • computer system 400 can include a video game system, a personal digital assistant (PDA), a smart phone, or a portable media player.
  • PDA personal digital assistant
  • Processor 401 includes one or more processors or processor cores configured to execute software modules and to access data stored in system memory 402.
  • the software modules stored in the system memory 402 change at least the detection unit 301, the code pre-analysis unit 302, and the analysis execution unit 303.
  • System memory 402 is intended to broadly represent any type of memory that can be used to store software modules and data to be executed and accessed by processor 401, respectively.
  • system memory 402 includes volatile memory, such as random access memory (RAM).
  • the storage medium shield may be a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).

Landscapes

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

Abstract

一种代码分析方法及系统、计算机存储介盾,该方法包括:获取代码变更列表;对所述代码变更列表进行分析,获取所述代码变更列表中分别与各编程语言类型相对应的变更列表,确定该变更列表与相应的编程语言类型的映射关系;根据所述映射关系获取对应的代码分析工具信息及分析规则信息,生成执行方案;根据所述执行方案调用对应的代码分析工具及分析规则执行代码分析过程,获得代码分析结果。本发明方案实现了多种代码分析工具及分析规则的集成,能够很好的适应不同类型编程语言的代码分析需求,减轻了研发人员、测试人员的工作量,提高了代码分析的效率。

Description

代码分析方法及代码分析系统、 计算机存储介质 本申请以申请号为 201210164205.4, 申请日为 2012年 5月 24 日的中国专利申请作为其 优先权基础。 技术领域
本发明涉及代码分析技术领域, 特别是涉及一种代码分析方法、 一种代码分析系统、 计 算机存储介盾。 背景技术
代码分析工具是指以发现原始代码的规范性、 逻辑性、 安全性等方面编程缺陷为目标, 不需要执行代码而对其原始代码或编译后代码进行分析并得到评估报告的工具。 在进行应用 时, 代码分析工具通常按照既定的分析规则对存储于软件配置管理库中的代码进行分析并输 出结果。
现有的代码分析工具通常都是针对某一特定类型的编程语言的, 只具有单一类别的分析 功能, 因此, 现在的代码分析工具的类型非常多, 针对各个不同的领域进行了细分, 例如类 型检查、风格检查、编程规范、属性检查、安全检查等等, 而且,代码分析工具在执行时, 通 常都是由开发人员或者测试人员手工执行, 也增加了开发人员、 测试人员的工作量。
另外, 在一个大型的软件研发组织、 产品或者项目中, 由于编程水平参差不齐, 各研发 人员所使用的编码工具也不近相同, 可能会有用多种不同的编码方式得到的多种代码类型, 由于各代码分析工具只能针对某一特定类型的编程语言, 因此, 釆用单一的代码分析工具将 无法针对这种由多种编程语言实现的大规模的软件系统进行全面的代码分析 , 只能多次釆用 各编码类型对应的不同的代码分析工具分别进行代码分析, 费时费力, 由于是人工手动执行, 更费时间与精力, 增加了开发人员、 测试人员的工作量, 影响到代码分析的效率。 发明内容
针对上述现有技术中存在的问题, 本发明的目的在于提供一种代码分析方法, 本发明的 另一目的在于提供一种代码分析装置, 其可以实现不同类型编程语言的代码分析需求, 减轻 开发人员、 测试人员的工作量, 提高代码分析效率。 一种代码分析方法, 包括步骤: 获取代码变更列表;
对所述代码变更列表进行分析 , 获取所述代码变更列表中分别与各编程语言类型相对应 的变更列表, 确定该变更列表与相应的编程语言类型的映射关系;
根据所述映射关系获取对应的代码分析工具信息及分析规则信息, 生成执行方案; 根据所述执行方案调用对应的代码分析工具及分析规则执行代码分析过程, 获得代码分 析结果。
一种代码分析系统, 包括:
变更检测单元, 用于获取代码变更列表;
代码预分析单元, 用于对所述代码变更列表进行分析, 获取所述代码变更列表中分别与 各编程语言类型相对应的变更列表, 确定该变更列表与相应的编程语言类型的映射关系; 分析执行单元, 用于根据所述映射关系获取对应的代码分析工具信息及分析规则信息, 生成执行方案,并根据所述执行方案调用对应的代码分析工具及分析规则执行代码分析过程, 获得代码分析结果。 一个或多个包含计算机可执行指令的计算机存储介盾, 所述计算机可执行指令用于执行 一种代码分析的方法, 所述方法包括步骤:
获取代码变更列表;
对所述代码变更列表进行分析 , 获取所述代码变更列表中分别与各编程语言类型相对应 的变更列表, 确定该变更列表与相应的编程语言类型的映射关系;
根据所述映射关系获取对应的代码分析工具信息及分析规则信息, 生成执行方案; 根据所述执行方案调用对应的代码分析工具及分析规则执行代码分析过程, 获得代码分 析结果。
根据上述本发明方案, 其通过获取代码变更列表, 并对代码变更列表进行分析, 获得代 码变更列表中与各编程语言类型相对应的变更列表, 确定该变更列表与相应的编程语言类型 的映射关系, 并基于该映射关系调用相适配的代码分析工具及分析规则执行分析过程, 得到 分析结果, 其实现了多种代码分析工具及分析规则的集成, 能够很好的适应不同类型编程语 言的代码分析需求, 减轻了研发人员、 测试人员的工作量, 提高了代码分析的效率。 附图说明
图 1是本发明的代码分析方法实施例一的流程示意图;
图 2是本发明的代码分析方法实施例二的流程示意图;
图 3是本发明的代码分析系统实施例的结构示意图; 图 4是在其中可以实现本发明的操作环境的示意框图。 具体实施方式
以下结合其中的较佳实施例对本发明方案进行详细阐述, 在下述说明中, 是先对本发明 的代码分析方法的实施例进行说明, 再针对本发明的代码分析系统的实施例进行说明。
实施例一
参见图 1所示, 是本发明的代码分析方法实施例一的流程示意图, 如图 1所示, 该实施 例一中的代码分析方法包括步骤:
步骤 S 101 : 获取代码变更列表, 进入步骤 S 102;
步骤 S 102: 对上述代码变更列表进行分析, 获取代码变更列表中分别与各编程语言类型 相对应的变更列表, 确定该变更列表与相应的编程语言类型的映射关系, 进入步骤 S 103; 步骤 S 103 : 根据各映射关系获取对应的代码分析工具信息及分析规则信息, 生成执行方 案, 进入步骤 S 104;
步骤 S 104: 根据上述执行方案调用对应的代码分析工具及分析规则执行代码分析过程, 获得代码分析结果。
根据上述本发明方案, 其通过获取代码变更列表, 并对代码变更列表进行分析, 获得代 码变更列表中与各编程语言类型相对应的变更列表, 确定该变更列表与相应的编程语言类型 的映射关系, 并基于该映射关系调用相适配的代码分析工具及分析规则执行分析过程, 得到 分析结果, 其实现了多种代码分析工具及分析规则的集成, 能够很好的适应不同类型编程语 言的代码分析需求, 减轻了研发人员、 测试人员的工作量, 提高了代码分析的效率。
其中, 上述步骤 S 101中获取代码变更列表时, 基于不同的应用场景或者考虑因素, 可以 通过设置不同的触发条件来获得该代码变更列表, 其中一种方式, 是通过预设扫描频率, 并 根据该预设扫描频率扫描各代码软件配置管理库, 获得上述代码变更列表, 另外一种方式, 可以是在需要进行代码分析时, 通过输入代码分析指令(例如通过点击某个开始代码分析过 程的按钮等), 在接收到代码分析指令后, 再扫描各代码软件配置管理库, 获得上述代码变更 列表。
在其中一个较佳实施例中, 可以釆用上述第一种方式, 从而可以自动检测代码软件配置 管理库中的状态, 自动触发执行代码分析过程, 可以进一步减少研发人员、 测试人员等的工 作量。
上述各代码软件配置管理库, 可以根据实际需要进行设置, 可以是一个, 也可以是两个 以上的多个, 在此不予赘述。 在上述步骤 S101获取代码变更列表时,若代码没有变更,则不进入后续步骤,若有变更, 则进入后续步骤 S102的预分析过程。其中, 由于代码变更列表是从各不同的代码软件配置管 理库中提取获得, 而各代码软件配置管理库的存储格式可能并不相同, 直接进入后续处理可 能会影响到后续生成执行方案的效率。 因此, 在本发明方案中, 上述获得的代码变更列表, 可以以第一预设格式类型予以储存, 以便于步骤 S 102的引用。
这里的第一预设格式类型, 可以用各种可能的格式, 只要能够符合信息结构所表达的描 述方式即可, 由于 xml文件格式类型具有开放性、 筒单性、 自我描述性、 结构与内容分离、 扩展性强等优点, 而且与平台无关, 因此, 在一般情况下, 该第一预设格式类型可以设置为 xml格式类型。
上述步骤 S 102中对代码变更列表进行分析, 确定映射关系时, 该映射关系^ &于不同的 编程语言类型的不同来确定, 例如, 假设上述代码变更列表中有两种编程语言类型 (C++、 java ), 那么经过该步骤 S102的预分析过程之后, 将会得到 C++与用 C++编码的代码中发生 了变更的变更列表的映射关系、 以及 java与用 java编码的代码中发生了变更的变更列表的映 射关系。 得到各编程语言类型与对应的变更列表的映射关系后, 可以直接进入后续的生成执 行方案的过程。
然而, 由于这些变更列表有可能是从各不同的代码软件配置管理库中提取获得, 而各代 码软件配置管理库的存储格式可能并不相同, 从而导致各编程语言类型与变更列表的映射关 系的格式类型也有所差异, 特别是在编程语言类型的数目较多的情况下, 直接进入后续处理 可能会影响到后续生成执行方案的效率。 因此, 在本发明方案中, 还可以将各上述映射关系 转换为第二预设格式类型后予以储存。 从而, 在后续生成执行方案时, 无论原始是什么格式 类型的变更列表, 都可以基于同样的格式生成后续的执行方案。
第二预设格式类型, 可以用各种可能的格式, 只要能够符合信息结构所表达的描述方式 即可,且该第二预设格式类型与上述的第一预设格式类型可以相同,也可以不相同。 由于 xml 文件格式类型具有开放性、 筒单性、 自我描述性、 结构与内容分离、 扩展性强等优点, 而且 与平台无关, 因此, 在一般情况下, 该第二预设格式类型可以设置为 xml格式类型。
在得到各编程语言类型对应的映射关系后, 基于该映射关系, 可以获得对应的代码分析 工具信息及分析规则信息, 生成执行方案, 该过程可在后台进行。 在此情况下, 本发明方案 在实施时, 需要预先存储各编程语言类型、 代码分析工具、 分析规则之间的对应关系, 在生 成执行方案时, 可以依据该对应关系获得针对该编程语言类型的变更列表需要使用哪种代码 分析工具、 釆用哪种分析规则进行代码分析, 并根据需要釆用的代码分析工具的信息、 分析 规则的信息, 生成执行方案。 生成的各执行方案, 可以是以第三预设格式类型予以储存, 以便于在依据执行方案执行 分析时是基于同样格式类型的执行方案来执行, 以减少执行方案执行时的复杂度, 进一步提 高效率。
该第三预设格式类型, 可以用各种可能的格式, 只要能够符合信息结构所表达的描述方 式即可, 且该第三预设格式类型与上述的第一预设格式类型、 第二预设格式类型可以相同, 也可以不相同。 由于 xml文件格式类型具有开放性、 筒单性、 自我描述性、 结构与内容分离、 扩展性强等优点, 而且与平台无关, 因此, 在一般情况下, 该第三预设格式类型可以设置为 xml格式类型。
另外, 上述生成的各执行方案, 可以以任务队列的方式予以储存, 从而可以通过发现任 务队列中是否有执行方案来执行代码分析过程。 执行时, 依据该执行方案, 调用对应的代码 分析工具及分析规则执行代码分析过程, 获得代码分析结果, 所获得的代码分析结果可以予 以输出显示, 以便用户查看, 另一方面, 所获得的代码分析结果也可以保存到分析结果库中, 且可以同时或者经由该分析结果库予以输出显示, 显示方式可以釆用各种可能的形式, 例如 以 WEB界面显示等等。
实施例二
图 2中示出了本发明的代码分析方法实施例二的流程示意图, 在该实施例中, 与上述实 施例一的不同之处主要在于, 本实施例在获取各映射关系的同时, 还生成与各映射关系对应 的标识位, 根据该标识位获取对应的代码分析工具信息及分析规则信息, 生成执行方案。
如图 2所示, 本实施例二中的代码分析方法包括步骤:
步骤 S201 : 获取代码变更列表, 进入步骤 S202;
步骤 S202: 对上述代码变更列表进行分析, 获取代码变更列表中分别与各编程语言类型 相对应的变更列表, 确定该变更列表与相应的编程语言类型的映射关系, 并生成与对应的代 码分析工具信息及分析规则信息对应的标识位, 进入步骤 S203 ;
步骤 S203 : 根据上述各标识位获取对应的代码分析工具信息及分析规则信息, 生成执行 方案, 进入步骤 S204;
步骤 S204: 根据上述执行方案调用对应的代码分析工具及分析规则执行代码分析过程, 获得代码分析结果。
其中, 上述标识位可以依据编程语言类型、 文件类型、 外部用户的设置等方式来生成, 该标识位指示、 表明或者代表了哪一类型特征的文件应该使用哪种代码分析工具、 哪种分析 规则来进行代码分析过程, 该标识位的具体设置方式可以依据实际需要进行设定, 在此不予 赘述。 本实施例二中的其他技术特征与上述实施例一中的相同, 在此不予赘述。
根据上述本发明的代码分析方法, 本发明还提供一种代码分析系统, 图 3 中示出了本发 明的代码分析系统实施例的结构示意图。
如图 3所示, 本实施例中的代码分析系统包括:
变更检测单元 301 , 用于获取代码变更列表;
代码预分析单元 302 , 用于对上述代码变更列表进行分析, 获取上述代码变更列表中分 别与各编程语言类型相对应的变更列表,确定该变更列表与相应的编程语言类型的映射关系; 分析执行单元 303 , 用于根据各映射关系获取对应的代码分析工具信息及分析规则信息, 生成执行方案, 并根据该执行方案调用对应的代码分析工具及分析规则执行代码分析过程, 获得代码分析结果。
其中, 上述分析执行单元 303具体可以包括:
执行方案生成单元 3031 , 用于根据上述各映射关系获取对应的代码分析工具信息及分析 规则信息, 生成执行方案;
任务执行单元 3032 , 用于根据各执行方案调用对应的代码分析工具及分析规则执行代码 分析过程, 获得代码分析结果。
根据上述 本发明方案, 其通过变更检测单元 301获取代码变更列表, 由代码预分析单 元 302对代码变更列表进行分析,获得代码变更列表中与各编程语言类型相对应的变更列表, 确定该变更列表与相应的编程语言类型的映射关系, 并由分析执行单元 303基于该映射关系 生成执行方案并调用相适配的代码分析工具及分析规则执行分析过程 , 得到分析结果, 其实 现了多种代码分析工具及分析规则的集成, 能够很好的适应不同类型编程语言的代码分析需 求, 减轻了研发人员、 测试人员的工作量, 提高了代码分析的效率。
其中, 变更检测单元 301在获取代码变更列表时, 基于不同的应用场景或者考虑因素, 可以通过设置不同的触发条件来获得该代码变更列表, 其中一种方式,是通过预设扫描频率, 并根据该预设扫描频率扫描各代码软件配置管理库, 获得上述代码变更列表, 另外一种方式, 可以是在需要进行代码分析时, 通过输入代码分析指令(例如通过点击某个开始代码分析过 程的按钮等), 在接收到代码分析指令后, 再扫描各代码软件配置管理库, 获得上述代码变更 列表。
在其中一个较佳实施例中, 可以釆用上述第一种方式, 从而可以自动检测代码软件配置 管理库中的状态, 自动触发执行代码分析过程, 可以进一步减少研发人员、 测试人员等的工 作量。
上述各代码软件配置管理库, 可以根据实际需要进行设置, 可以是一个, 也可以是两个 以上的多个, 在此不予赘述。
由于变更检测单元 301获取的代码变更列表是从各不同的代码软件配置管理库中提取获 得, 而各代码软件配置管理库的存储格式可能并不相同, 直接进入后续处理可能会影响到后 续生成执行方案的效率。 因此, 在本发明方案中, 变更检测单元 301获得的代码变更列表, 可以以第一预设格式类型予以储存, 以便于代码预分析单元 302的应用。
这里的第一预设格式类型, 可以用各种可能的格式, 只要能够符合信息结构所表达的描 述方式即可, 由于 xml文件格式类型具有开放性、 筒单性、 自我描述性、 结构与内容分离、 扩展性强等优点, 而且与平台无关, 因此, 在一般情况下, 该第一预设格式类型可以设置为 xml格式类型。
代码预分析单元 302在对代码变更列表进行分析, 确定各映射关系时, 该映射关系^ & 于不同的编程语言类型的不同来确定, 例如, 假设上述代码变更列表中有两种编程语言类型 ( C++、 java ), 那么经过该预分析过程之后, 将会得到 C++与用 C++编码的代码中发生了变 更的变更列表的映射关系、 以及 java与用 java编码的代码中发生了变更的变更列表的映射关 系。
然而, 由于这些变更列表有可能是从各不同的代码软件配置管理库中提取获得, 而各代 码软件配置管理库的存储格式可能并不相同, 从而导致各编程语言类型与变更列表的映射关 系的格式类型也有所差异, 特别是在编程语言类型的数目较多的情况下, 直接进入后续处理 可能会影响到后续生成执行方案的效率。 因此, 在本发明方案中, 代码预分析单元 302还可 以将上述各映射关系转换为第二预设格式类型后予以储存。 从而, 在后续生成执行方案时, 无论原始是什么格式类型的变更列表, 都可以基于同样的格式生成后续的执行方案。
该第二预设格式类型可以用各种可能的格式, 只要能够符合信息结构所表达的描述方式 即可,且该第二预设格式类型与上述的第一预设格式类型可以相同,也可以不相同。 由于 xml 文件格式类型具有开放性、 筒单性、 自我描述性、 结构与内容分离、 扩展性强等优点, 而且 与平台无关, 因此, 在一般情况下, 该第二预设格式类型可以设置为 xml格式类型。
分析执行单元 303可以基于该映射关系,获得对应的代码分析工具信息及分析规则信息, 生成执行方案, 该过程可在后台进行。 在此情况下, 本发明方案在实施时, 需要预先存储各 编程语言类型、 代码分析工具、 分析规则之间的对应关系, 因此, 如图 3所示, 在本发明方 案中, 还可以包括有:
信息数据库 304 , 用于储存所述代码分析工具、 所述分析规则以及所述代码分析工具、 所述分析规则与各编程语言类型的对应关系。
从而, 在生成执行方案时, 可以依据该对应关系获得针对该编程语言类型的变更列表需 要使用哪种代码分析工具、 釆用哪种分析规则进行代码分析, 并根据需要釆用的代码分析工 具的信息、 分析规则的信息, 生成执行方案。
生成的各执行方案, 可以是以第三预设格式类型予以储存, 以便于在依据执行方案执行 分析时是基于同样格式类型的执行方案来执行, 以减少执行方案执行时的复杂度, 进一步提 高效率。
该第三预设格式类型, 可以用各种可能的格式, 只要能够符合信息结构所表达的描述方 式即可, 且该第三预设格式类型与上述的第一预设格式类型、 第二预设格式类型可以相同, 也可以不相同。 由于 xml文件格式类型具有开放性、 筒单性、 自我描述性、 结构与内容分离、 扩展性强等优点, 而且与平台无关, 因此, 在一般情况下, 该第三预设格式类型可以设置为 xml格式类型。
其中, 分析执行单元 303或者说执行方案生成单元 3031生成的各执行方案, 可以以任务 队列的方式予以储存 , 此时, 上述分析执行单元 303还可以包括:
任务队列存储器 3033 , 用于将各所述执行方案以任务队列的方式予以存储。
从而任务执行单元 3032可以通过发现任务队列存储器 3033中是否有执行方案来执行代 码分析过程。 执行时, 依据该执行方案, 调用对应的代码分析工具及分析规则执行代码分析 过程, 获得代码分析结果。 其中, 该代码分析工具及分析规则, 可以直接从上述信息数据库
304中调用。
分析执行单元 303或者说任务执行单元 3032所获得的代码分析结果可以予以输出显示, 以便用户查看, 另一方面, 所获得的代码分析结果也可以保存到分析结果库中, 且可以同时 或者经由该分析结果库予以输出显示, 显示方式可以釆用各种可能的形式, 例如以 WEB界 面显示等等。
与上述本发明的代码分析方法相对应,在另外一个实施方式中,上述代码预分析单元 302 在确定各映射关系的同时,还生成与对应的代码分析工具信息及分析规则信息对应的标识位; 从而上述分析执行单元 303 , 是根据该标识位获取上述对应的代码分析工具信息及分析规则 在此不予赘述。
基于该实施方式, 上述信息数据库 304中所存储的信息, 应当是包括有代码分析工具、 分析规则以及代码分析工具、 分析规则与各标识位的对应关系。
另外, 本发明方案的各实施例中的信息数据库 304, 可以根据不同功能来分成几个来实 现不同信息的存储, 例如可以包括有工具信息库、 分析规则库、 知识库, 由工具信息库储存 各代码分析工具, 分析规则库储存各分析规则, 知识库中可存储代码分析工具、 分析规则与 各编程语言类型和 /或标识位的对应关系。 另外, 还可以包括有分析结果库, 以储存上述得到 的各代码分析结果, 以便于用户查看或者经由该分析结果库将该代码分析结果输出显示。
其中, 上述信息数据库 304, 或者各不同的数据库, 可以釆用 mysql数据库来进行相关数 据的存储。
以工具信息库为例, 其用于储存各代码分析工具, 主要是用于对多种代码分析工具进行 管理, 该信息数据库中所包含的内容的一个具体示例如下表所示:
Figure imgf000010_0001
以分析规则库为例, 其用于储存各分析规则, 主要是用于各种不同代码分析工具所支持 的分析规则的管理, 该分析规则库所包含的内容的一个具体示例如下表所示:
Figure imgf000010_0002
以分解结果库为例, 其主要是用于存储代码分析结果, 该分析结果库所包含的内容的一 个具体示例如下表所示: 字段 描述
F result id KEY, 主键, 非空,分析结果, 主要指分析后的代码问题的 id
F tool id 得出该结果的代码分析工具 id
F rule id 对应的规则 id
F desc 该分析结果的描述
F code evidence 出现问题的代码内容
F level 问题的严重级别。 另外, 本领域技术人员可以知晓的是, 上述本发明的代码分析方法及代码分析系统在具 体应用时, 具体进行分析的代码根据实际需求的不同可以有所不同, 例如可以根据需要仅对 源代码进行分析, 此时, 上述代码变更列表是源代码变更列表。
图 4是可以实现上述各实施例的操作环境的示意框图。该计算机系统 400被配置为对一 个或多个软件实体进行代码分析。如图 4 中所示, 计算机系统 400 包括处理器 401以及系统 存储器 402。
计算机系统 400意图宽泛地表示任何基于处理器的系统, 基于该系统, 可以为用户的利 益而执行软件。 例如, 计算机系统 400 可包括台式计算机系统、 膝上型计算机、 或者平板计 算机。 此外, 计算机系统 400 可包括视频游戏系统、 个人数字助理 (PDA)、 智能电话、 或者 便携式媒体播放器。
处理器 401包括被配置为执行软件模块以及访问存储在系统存储器 402 中的数据的一个 或多个处理器或处理器核心。 存储在系统存储器 402中的软件模块至少变更检测单元 301、 代码预分析单元 302、分析执行单元 303。系统存储器 402意图宽泛地代表任何类型的存储器, 该存储器可用于分别储存软件模块和将被处理器 401执行并访问的数据。 在一个实施例中, 系统存储器 402 包括易失性存储器, 诸如随机存取存储器 (RAM)。
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程, 是可以通过计 算机程序控制相关的硬件来完成的, 所述的程序可存储于一计算机可读取存储介盾中, 该程 序在执行时, 可包括如上述各方法的实施例的流程。 其中, 所述的存储介盾可为磁碟、 光盘、 只读存储记忆体(Read-Only Memory, ROM )或随机存储记忆体( Random Access Memory, RAM )等。
以上所述实施例仅表达了本发明的几种实施方式, 其描述较为具体和详细, 但并不能因 此而理解为对本发明专利范围的限制。 应当指出的是, 对于本领域的普通技术人员来说, 在 不脱离本发明构思的前提下, 还可以做出若千变形和改进, 这些都属于本发明的保护范围。 因此, 本发明专利的保护范围应以所附权利要求为准。

Claims

权利 要求 书
1、 一种代码分析方法, 其特征在于, 包括步骤:
获取代码变更列表;
对所述代码变更列表进行分析 , 获取所述代码变更列表中分别与各编程语言类型相对应 的变更列表, 确定该变更列表与相应的编程语言类型的映射关系;
根据所述映射关系获取对应的代码分析工具信息及分析规则信息, 生成执行方案; 根据所述执行方案调用对应的代码分析工具及分析规则执行代码分析过程, 获得代码分 析结果。
2、 根据权利要求 1所述的代码分析方法, 其特征在于, 在确定各所述映射关系的同时, 生成与对应的代码分析工具信息及分析规则信息对应的标识位, 根据所述标识位获取所述对 应的代码分析工具信息及分析规则信息, 生成所述执行方案。
3、 根据权利要求 1或 2所述的代码分析方法, 其特征在于, 还包括下述各项中的任意一 项或者任意组合:
将所述代码变更列表以第一预设格式类型予以储存;
将各所述映射关系转换为第二预设格式类型后予以储存;
将各所述执行方案转换为第三预设格式类型后予以储存;
将所述代码分析结果予以输出显示。
4、 根据权利要求 3所述的代码分析方法, 其特征在于, 所述第一预设格式类型包括 xml 格式, 所述第二预设格式类型包括 xml格式, 所述第三预设格式类型包括 xml格式。
5、 根据权利要求 1或 2所述的代码分析方法, 其特征在于: 获得所述代码变更列表的过 程包括:
根据预设扫描频率扫描各代码软件配置管理库, 获得所述代码变更列表;
或者
在接收到代码分析指令时, 扫描各代码软件配置管理库, 获得所述代码变更列表。
6、 一种代码分析系统, 运行于包含处理器和系统储存器的计算机系统中, 其特征在于, 所述系统存储器包括:
变更检测单元, 用于获取代码变更列表;
代码预分析单元, 用于对所述代码变更列表进行分析, 获取所述代码变更列表中分别与 各编程语言类型相对应的变更列表, 确定该变更列表与相应的编程语言类型的映射关系; 分析执行单元, 用于根据所述映射关系获取对应的代码分析工具信息及分析规则信息, 生成执行方案,并根据所述执行方案调用对应的代码分析工具及分析规则执行代码分析过程, 获得代码分析结果。
7、 根据权利要求 6所述的代码分析系统, 其特征在于:
所述代码预分析单元, 还用于在获取各所述映射关系的同时, 生成与对应的代码分析工 具信息及分析规则信息对应的标识位;
所述分析执行单元, 用于根据所述标识位获取所述对应的代码分析工具信息及分析规则 信息, 生成所述执行方案。
8、 根据权利要求 6或 7所述的代码分析系统, 其特征在于, 所述分析执行单元包括: 执行方案生成单元, 用于根据各所述映射关系获取对应的代码分析工具信息及分析规则 信息, 生成执行方案;
任务执行单元, 用于根据各所述执行方案调用对应的代码分析工具及分析规则执行代码 分析过程, 获得代码分析结果。
9、 根据权利要求 8所述的代码分析系统, 其特征在于, 所述分析执行单元还包括: 任务 队列存储器, 用于将各所述执行方案以任务队列的方式予以存储。
10、 根据权利要求 6或 7所述的代码分析系统, 其特征在于, 还包括下述各项中的任意 一项或者任意组合:
所述变更检测单元, 还用于将所述代码变更列表以第一预设格式类型予以储存; 所述代码预分析单元, 还用于将各所述映射关系转换为第二预设格式类型后予以储存; 所述分析执行单元, 还用于将各所述执行方案转换为第三预设格式类型后予以储存。
11、根据权利要求 10所述的代码分析系统,其特征在于,所述第一预设格式类型包括 xml 格式, 所述第二预设格式类型包括 xml格式, 所述第三预设格式类型包括 xml格式。
12、 根据权利要求 6或 7所述的代码分析系统, 其特征在于:
所述变更检测单元根据预设扫描频率扫描各代码软件配置管理库, 获得所述代码变更列 表;
或者
所述变更检测单元在接收到代码分析指令时, 扫描各代码软件配置管理库, 获得所述代 码变更列表。
13、 根据权利要求 6或 7所述的代码分析系统, 其特征在于, 还包括信息数据库, 用于 储存所述代码分析工具、 所述分析规则以及所述代码分析工具、 所述分析规则与各编程语言 类型或者各标识位的对应关系。
14、 一个或多个包含计算机可执行指令的计算机存储介盾 , 所述计算机可执行指令用于 执行一种代码分析的方法, 其特征在于, 所述方法包括步骤:
获取代码变更列表;
对所述代码变更列表进行分析 , 获取所述代码变更列表中分别与各编程语言类型相对应 的变更列表, 确定该变更列表与相应的编程语言类型的映射关系;
根据所述映射关系获取对应的代码分析工具信息及分析规则信息, 生成执行方案; 根据所述执行方案调用对应的代码分析工具及分析规则执行代码分析过程, 获得代码分 析结果。
15、 根据权利要求 14所述的计算机存储介盾, 其特征在于, 在确定各所述映射关系的同 时, 生成与对应的代码分析工具信息及分析规则信息对应的标识位, 根据所述标识位获取所 述对应的代码分析工具信息及分析规则信息, 生成所述执行方案。
16、 根据权利要求 14所述的计算机存储介盾, 其特征在于, 所述方法还包括下述各项中 的任意一项或者任意组合:
将所述代码变更列表以第一预设格式类型予以储存;
将各所述映射关系转换为第二预设格式类型后予以储存;
将各所述执行方案转换为第三预设格式类型后予以储存;
将所述代码分析结果予以输出显示。
17、 根据权利要求 16所述的计算机存储介盾, 其特征在于, 所述第一预设格式类型包括 xml格式, 所述第二预设格式类型包括 xml格式, 所述第三预设格式类型包括 xml格式。
18、 根据权利要求 14或 15所述的计算机存储介盾, 其特征在于: 获得所述代码变更列 表的过程包括:
根据预设扫描频率扫描各代码软件配置管理库, 获得所述代码变更列表;
或者
在接收到代码分析指令时, 扫描各代码软件配置管理库, 获得所述代码变更列表。
PCT/CN2013/075095 2012-05-24 2013-05-02 代码分析方法及代码分析系统、计算机存储介质 WO2013174200A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US14/402,821 US9378114B2 (en) 2012-05-24 2013-05-02 Code analysis method, code analysis system and computer storage medium

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201210164205.4A CN103425572B (zh) 2012-05-24 2012-05-24 代码分析方法及代码分析系统
CN201210164205.4 2012-05-24

Publications (1)

Publication Number Publication Date
WO2013174200A1 true WO2013174200A1 (zh) 2013-11-28

Family

ID=49623092

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2013/075095 WO2013174200A1 (zh) 2012-05-24 2013-05-02 代码分析方法及代码分析系统、计算机存储介质

Country Status (3)

Country Link
US (1) US9378114B2 (zh)
CN (1) CN103425572B (zh)
WO (1) WO2013174200A1 (zh)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108804629A (zh) * 2018-05-31 2018-11-13 北京五八信息技术有限公司 一种筛选项的处理方法、装置、存储介质及设备
CN112256575A (zh) * 2020-10-22 2021-01-22 深圳我家云网络科技有限公司 一种代码质量管理方法、系统及相关设备
CN112399466A (zh) * 2020-11-12 2021-02-23 国网江苏省电力有限公司信息通信分公司 一种基于领域规则库的通信规则缺陷的分析方法

Families Citing this family (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104133768A (zh) * 2014-07-28 2014-11-05 中国银行股份有限公司 一种程序代码复查方法和装置
CN104407901B (zh) * 2014-12-08 2018-04-06 北京国双科技有限公司 代码的添加方法和装置
CN107783892A (zh) * 2016-08-25 2018-03-09 平安科技(深圳)有限公司 一种代码分析方法及终端
CN107045477B (zh) * 2016-12-30 2021-08-17 上海富聪科技有限公司 一种可进行多维度检测的质量评估平台
CN109992502A (zh) * 2017-12-30 2019-07-09 中国移动通信集团四川有限公司 应用软件性能自动检测分析方法、装置、设备及介质
CN108803561B (zh) * 2018-05-22 2020-03-17 广州明珞汽车装备有限公司 针对白车身线体控制程序的程序自动检查方法及系统
US10534912B1 (en) * 2018-10-31 2020-01-14 Capital One Services, Llc Methods and systems for multi-tool orchestration
CN109871317A (zh) * 2019-01-11 2019-06-11 平安普惠企业管理有限公司 代码质量分析方法及装置、存储介质及电子设备
CN109446107B (zh) * 2019-01-23 2019-07-09 长沙软工信息科技有限公司 一种源代码检测方法及装置、电子设备
CN110688519B (zh) * 2019-09-30 2022-07-15 腾讯音乐娱乐科技(深圳)有限公司 播放媒体数据的方法、装置、系统、设备及存储介质
CN111078577A (zh) * 2019-12-31 2020-04-28 易票联支付有限公司 一种自动化代码审计方法、系统、装置及存储介质
CN112269774A (zh) * 2020-10-16 2021-01-26 苏州浪潮智能科技有限公司 异构数据库应用代码适配评估装置、方法及存储介质
CN113641573B (zh) * 2021-07-26 2024-05-07 安徽中科国创高可信软件有限公司 基于修订日志的程序分析软件自动化测试方法及系统
CN116756048B (zh) * 2023-08-16 2023-10-31 北京安普诺信息技术有限公司 一种代码分析方法、装置、计算机设备及存储介质

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1983209A (zh) * 2005-12-14 2007-06-20 中兴通讯股份有限公司 一种软件单元测试自动化系统及其方法
US20080052690A1 (en) * 2006-08-08 2008-02-28 Microsoft Corporation Testing software with a build engine
CN101145102A (zh) * 2006-09-11 2008-03-19 国际商业机器公司 测试国际化软件的方法和设备
CN102419729A (zh) * 2010-10-26 2012-04-18 微软公司 并行测试执行

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6748584B1 (en) * 1999-12-29 2004-06-08 Veritas Operating Corporation Method for determining the degree to which changed code has been exercised
US20040122791A1 (en) * 2002-12-19 2004-06-24 Sea Brian S Method and system for automated source code formatting
WO2008110411A1 (en) * 2007-03-14 2008-09-18 International Business Machines Corporation Automatic formatting of computer program source code
US9594544B2 (en) * 2012-06-07 2017-03-14 Microsoft Technology Licensing, Llc Visualized code review

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1983209A (zh) * 2005-12-14 2007-06-20 中兴通讯股份有限公司 一种软件单元测试自动化系统及其方法
US20080052690A1 (en) * 2006-08-08 2008-02-28 Microsoft Corporation Testing software with a build engine
CN101145102A (zh) * 2006-09-11 2008-03-19 国际商业机器公司 测试国际化软件的方法和设备
CN102419729A (zh) * 2010-10-26 2012-04-18 微软公司 并行测试执行

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108804629A (zh) * 2018-05-31 2018-11-13 北京五八信息技术有限公司 一种筛选项的处理方法、装置、存储介质及设备
CN112256575A (zh) * 2020-10-22 2021-01-22 深圳我家云网络科技有限公司 一种代码质量管理方法、系统及相关设备
CN112399466A (zh) * 2020-11-12 2021-02-23 国网江苏省电力有限公司信息通信分公司 一种基于领域规则库的通信规则缺陷的分析方法
CN112399466B (zh) * 2020-11-12 2024-02-09 国网江苏省电力有限公司信息通信分公司 一种基于领域规则库的通信规则缺陷的分析方法

Also Published As

Publication number Publication date
US9378114B2 (en) 2016-06-28
CN103425572A (zh) 2013-12-04
US20150113332A1 (en) 2015-04-23
CN103425572B (zh) 2016-04-13

Similar Documents

Publication Publication Date Title
WO2013174200A1 (zh) 代码分析方法及代码分析系统、计算机存储介质
US11281732B2 (en) Recommending development tool extensions based on media type
US9235410B2 (en) Tracking software package dependencies using a graph model
US8010844B2 (en) File mutation method and system using file section information and mutation rules
US10318595B2 (en) Analytics based on pipes programming model
US8387017B2 (en) Black box testing optimization using information from white box testing
US9779158B2 (en) Method, apparatus, and computer-readable medium for optimized data subsetting
US11681710B2 (en) Entity extraction rules harvesting and performance
US8499197B2 (en) Description language for identifying performance issues in event traces
US9880924B2 (en) Source code unit testing using an indexing tool
US20120290560A1 (en) Mechanism for efficiently querying application binary interface/application programming interface-related information
KR20150128711A (ko) 컴퓨터 시스템 활동의 트레이스 타임라인을 분석하기 위한 방법 및 시스템
US20190265954A1 (en) Apparatus and method for assisting discovery of design pattern in model development environment using flow diagram
US10635483B2 (en) Automatic synopsis generation for command-line interfaces
WO2022095410A1 (zh) 组件开发方法、装置、存储介质及电子设备
JP5121891B2 (ja) 規則検査装置、規則検査方法及び規則検査プログラム
JP2016024477A (ja) ソフトウェア欠陥予測装置、ソフトウェア欠陥予測方法、およびソフトウェア欠陥予測プログラム
US20120311520A1 (en) Mechanism for Certifying Software Components Using a Defect Tracking System
US20130191813A1 (en) Metamodeling Contextual Navigation of Computer Software Applications
WO2018116522A1 (ja) 判定装置、判定方法及び判定プログラム
WO2024031983A1 (zh) 一种代码管理方法及相关设备
JP2019144873A (ja) ブロック線図解析装置
US20230004361A1 (en) Code inspection interface providing method and apparatus for implementing the method
WO2022123763A1 (ja) コールグラフ作成装置、コールグラフ作成方法及びプログラム
US20230305817A1 (en) Dynamic importation of external dependency information to support autocompletion in an interactive development environment

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 13793376

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 14402821

Country of ref document: US

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205N DATED 17/04/2015)

122 Ep: pct application non-entry in european phase

Ref document number: 13793376

Country of ref document: EP

Kind code of ref document: A1