CN117971546A - A method and device for decelerating analysis and accelerating evolution of software local faults - Google Patents
A method and device for decelerating analysis and accelerating evolution of software local faults Download PDFInfo
- Publication number
- CN117971546A CN117971546A CN202410372693.0A CN202410372693A CN117971546A CN 117971546 A CN117971546 A CN 117971546A CN 202410372693 A CN202410372693 A CN 202410372693A CN 117971546 A CN117971546 A CN 117971546A
- Authority
- CN
- China
- Prior art keywords
- software
- fault
- program
- faults
- evolution
- 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.)
- Granted
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/07—Responding to the occurrence of a fault, e.g. fault tolerance
- G06F11/0703—Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
- G06F11/079—Root cause analysis, i.e. error or fault diagnosis
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/07—Responding to the occurrence of a fault, e.g. fault tolerance
- G06F11/0703—Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
- G06F11/0793—Remedial or corrective actions
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Quality & Reliability (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Health & Medical Sciences (AREA)
- Biomedical Technology (AREA)
- Debugging And Monitoring (AREA)
Abstract
Description
技术领域Technical Field
本发明涉及软件测试技术领域,尤其涉及一种软件局部故障减速分析和加速演化的方法及装置。The present invention relates to the technical field of software testing, and in particular to a method and device for decelerating analysis and accelerating evolution of a local fault of a software.
背景技术Background technique
随着现代信息系统日益复杂和庞大,软件缺陷的数量以及修复难度随之增加,可能导致系统性能下降、功能故障以及数据安全问题,针对复杂信息系统的软件故障快速定位及全面测评成为了软件高质量交付的核心环节之一。传统的人工测试故障定位排查和分析方法已经不能满足复杂信息系统的测试需求,故障排查和分析耗费大量时间和资源,软件故障发现率低且解决方案有效性低,因此需要针对复杂信息系统的软件故障进行精准定位分析以及快速演化处理是目前需要解决的一个重要问题。As modern information systems become increasingly complex and large, the number of software defects and the difficulty of repairing them increase, which may lead to system performance degradation, functional failures and data security issues. Rapid positioning and comprehensive evaluation of software faults in complex information systems has become one of the core links in high-quality software delivery. Traditional manual testing fault location, troubleshooting and analysis methods can no longer meet the testing needs of complex information systems. Troubleshooting and analysis consume a lot of time and resources, the software fault detection rate is low and the solution effectiveness is low. Therefore, it is necessary to accurately locate and analyze software faults in complex information systems and quickly evolve them, which is an important problem that needs to be solved at present.
软件局部故障减速分析,需要对软件内部运行逻辑及内存数据装载使用情况进行分析;软件故障的加速演化,需要对软件故障的逻辑及条件进行分析,并且能够基于特定方式完成软件故障的裂变,生成更多故障,进行故障模拟测试,加速故障演化。因此,软件程序切片和插桩、运行内存快照成为软件局部故障减速分析的主要技术;另外,软件故障演化、软件故障模拟成为软件故障加速演化的主要技术。舒美智提出一种有效的系统软件故障定位方法,先计算出程序语句对每个测试用例的贡献度,得出每个语句怀疑度,并进行怀疑度的排名,定位软件故障;池书琪提出一种基于静态分析的故障诊断技术,分析软件故障时日志,结合软件源码以及一定的算法来总结软件故障的产生规律,或者复现软件故障产生时的运行轨迹以及相关上下文环境,从而帮助开发者进行软件故障诊断。李莎莎,崔铁军提出一种系统故障演化过程中事件综合效用系数计算方法,系统故障演化的要素包括事件、事件故障概率、影响因素、演化过程中的事件演化关系和事件逻辑关系,进而提出了事件效用系数综合评估系统故障的影响因素。The deceleration analysis of software local faults requires the analysis of the internal operation logic of the software and the use of memory data loading; the accelerated evolution of software faults requires the analysis of the logic and conditions of software faults, and the ability to complete the fission of software faults based on a specific method, generate more faults, perform fault simulation tests, and accelerate fault evolution. Therefore, software program slicing and plugging, running memory snapshots have become the main technologies for deceleration analysis of software local faults; in addition, software fault evolution and software fault simulation have become the main technologies for accelerating the evolution of software faults. Shu Meizhi proposed an effective method for locating system software faults, first calculating the contribution of program statements to each test case, deriving the suspicion of each statement, and ranking the suspicion to locate software faults; Chi Shuqi proposed a fault diagnosis technology based on static analysis, analyzing the log when the software fails, combining the software source code and a certain algorithm to summarize the rules of software fault generation, or reproducing the running trajectory and related context environment when the software fault occurs, so as to help developers diagnose software faults. Li Shasha and Cui Tiejun proposed a method to calculate the comprehensive utility coefficient of events in the process of system fault evolution. The elements of system fault evolution include events, event failure probability, influencing factors, event evolution relationship and event logical relationship in the evolution process. Then, they proposed an event utility coefficient to comprehensively evaluate the influencing factors of system failure.
然而,上述方法主要考虑的是在软件故障发生时如何定位故障,分析故障原因,如何通过智能的手段进行故障定位和修复,尚未考虑软件故障定位的精准性分析,以及软件故障的演化的多场景分析,不能满足复杂信息系统的测试的充分性、安全性和可靠性需求。However, the above methods mainly consider how to locate the fault, analyze the cause of the fault, and locate and repair the fault through intelligent means when the software fault occurs. They have not yet considered the accuracy analysis of software fault location and the multi-scenario analysis of the evolution of software faults. They cannot meet the adequacy, security and reliability requirements of the testing of complex information systems.
发明内容Summary of the invention
鉴于上述问题,本发明提供了一种软件局部故障减速分析和加速演化的方法及装置。In view of the above problems, the present invention provides a method and device for decelerating analysis and accelerating evolution of local software faults.
本发明一方面提供了一种软件局部故障减速分析和加速演化的方法,包括:步骤S1,分析软件组成,识别软件的多个功能模块,确定每个所述功能模块的重要等级系数;步骤S2,根据所述重要等级系数设置所述软件的程序切片和对应所述程序切片的插桩点,利用所述插桩点监控所述软件的运行过程信息;步骤S3,对监控到的所述运行过程信息进行分析,定位所述软件的局部故障信息,将所述局部故障信息录入软件故障库;步骤S4,基于所述软件故障库和预设的故障演化模型,裂变生成多个软件故障;步骤S5,根据所述多个软件故障的故障类型构建故障模拟环境,在所述故障模拟环境下进行软件故障的模拟验证,将得到验证的软件故障作为源故障再次录入所述软件故障库,并返回所述步骤S4。On the one hand, the present invention provides a method for decelerating analysis and accelerating evolution of local software faults, comprising: step S1, analyzing the composition of the software, identifying multiple functional modules of the software, and determining the importance level coefficient of each functional module; step S2, setting the program slice of the software and the insertion points corresponding to the program slice according to the importance level coefficient, and using the insertion points to monitor the running process information of the software; step S3, analyzing the monitored running process information, locating the local fault information of the software, and entering the local fault information into a software fault library; step S4, fissioning and generating multiple software faults based on the software fault library and a preset fault evolution model; step S5, constructing a fault simulation environment according to the fault types of the multiple software faults, performing simulation verification of the software faults under the fault simulation environment, entering the verified software faults as source faults into the software fault library again, and returning to step S4.
本发明另一方面提供了一种软件局部故障减速分析和加速演化的装置,包括:重要等级确定模块,用于分析软件组成,识别软件的多个功能模块,确定每个所述功能模块的重要等级系数;插桩点确定模块,用于根据所述重要等级系数设置所述软件的程序切片和对应所述程序切片的插桩点,利用所述插桩点监控所述软件的运行过程信息;故障定位模块,用于对监控到的所述运行过程信息进行分析,定位所述软件的局部故障信息,将所述局部故障信息录入软件故障库;故障裂变模块,用于基于所述软件故障库和预设的故障演化模型,裂变生成多个软件故障;故障验证模块,用于根据所述多个软件故障的故障类型构建故障模拟环境,在所述故障模拟环境下进行软件故障的模拟验证,将得到验证的软件故障作为源故障再次录入所述软件故障库,并返回所述故障裂变模块。On the other hand, the present invention provides a device for slowing down analysis and accelerating evolution of local software faults, including: an importance level determination module, used to analyze software composition, identify multiple functional modules of the software, and determine the importance level coefficient of each functional module; an insertion point determination module, used to set the program slice of the software and the insertion points corresponding to the program slice according to the importance level coefficient, and use the insertion points to monitor the running process information of the software; a fault location module, used to analyze the monitored running process information, locate the local fault information of the software, and enter the local fault information into a software fault library; a fault fission module, used to fission generate multiple software faults based on the software fault library and a preset fault evolution model; a fault verification module, used to build a fault simulation environment according to the fault types of the multiple software faults, simulate and verify the software faults under the fault simulation environment, and re-enter the verified software faults as source faults into the software fault library, and return to the fault fission module.
与现有技术相比,本发明提供的软件局部故障减速分析和加速演化的方法及装置,至少具有以下有益效果:Compared with the prior art, the method and device for decelerating analysis and accelerating evolution of software local faults provided by the present invention have at least the following beneficial effects:
(1)能够更加精细的定位和分析软件故障,因而能够针对性的进行故障修复,缩短软件故障排查时间和系统故障的持续时间,提高软件的稳定性和可用性。(1) It can locate and analyze software failures more precisely, thus enabling targeted fault repair, shortening software fault troubleshooting time and the duration of system failures, and improving software stability and availability.
(2)能够基于已有软件故障进行演化分析,变异生成多个软件故障,快速进行故障模拟测试,获取更多的软件故障有效解决方案和应对措施,减少软件试错时间及成本。(2) It can perform evolutionary analysis based on existing software faults, generate multiple software faults through mutation, quickly conduct fault simulation tests, obtain more effective solutions and countermeasures for software faults, and reduce the time and cost of software trial and error.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
通过以下参照附图对本发明实施例的描述,本发明的上述以及其他目的、特征和优点将更为清楚,在附图中:The above and other objects, features and advantages of the present invention will become more apparent through the following description of the embodiments of the present invention with reference to the accompanying drawings, in which:
图1示意性示出了根据本发明实施例的软件局部故障减速分析和加速演化的方法的流程图;FIG1 schematically shows a flow chart of a method for decelerating analysis and accelerating evolution of a software local fault according to an embodiment of the present invention;
图2示意性示出了根据本发明实施例的软件局部故障减速分析和加速演化的方法的原理图;FIG2 schematically shows a principle diagram of a method for decelerating analysis and accelerating evolution of a software local fault according to an embodiment of the present invention;
图3示意性示出了根据本发明实施例的重要等级系数确定过程的流程图;FIG3 schematically shows a flow chart of a process for determining an importance level coefficient according to an embodiment of the present invention;
图4示意性示出了根据本发明实施例的程序切片和插桩点确定过程的原理图;FIG4 schematically shows a principle diagram of a program slicing and an instrumentation point determination process according to an embodiment of the present invention;
图5示意性示出了根据本发明实施例的程序切片设置过程的原理图;FIG5 schematically shows a principle diagram of a program slice setting process according to an embodiment of the present invention;
图6示意性示出了根据本发明实施例的程序切片设置过程的流程图;FIG6 schematically shows a flow chart of a program slice setting process according to an embodiment of the present invention;
图7示意性示出了根据本发明实施例的插桩点设置过程的原理图;FIG7 schematically shows a principle diagram of an instrumentation point setting process according to an embodiment of the present invention;
图8示意性示出了根据本发明实施例的软件故障演化过程的原理图;FIG8 schematically shows a principle diagram of a software fault evolution process according to an embodiment of the present invention;
图9示意性示出了根据本发明实施例的软件故障演化过程的流程图;FIG9 schematically shows a flow chart of a software fault evolution process according to an embodiment of the present invention;
图10示意性示出了根据本发明实施例的软件故障加速演化的原理图;FIG10 schematically shows a principle diagram of accelerating the evolution of software faults according to an embodiment of the present invention;
图11示意性示出了根据本发明实施例的软件局部故障减速分析和加速演化的装置的结构框图。FIG. 11 schematically shows a structural block diagram of an apparatus for decelerating analysis and accelerating evolution of software local faults according to an embodiment of the present invention.
具体实施方式Detailed ways
为使本发明的目的、技术方案和优点更加清楚明白,以下结合具体实施例,并参照附图,对本发明进一步详细说明。显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。In order to make the purpose, technical scheme and advantages of the present invention more clearly understood, the present invention is further described in detail below in combination with specific embodiments and with reference to the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
在此使用的术语仅仅是为了描述具体实施例,而并非意在限制本发明。在此使用的术语“包括”、“包含”等表明了所述特征、步骤、操作和/或部件的存在,但是并不排除存在或添加一个或多个其他特征、步骤、操作或部件。The terms used herein are only for describing specific embodiments and are not intended to limit the present invention. The terms "comprise", "include", etc. used herein indicate the existence of the features, steps, operations and/or components, but do not exclude the existence or addition of one or more other features, steps, operations or components.
在此使用的所有术语(包括技术和科学术语)具有本领域技术人员通常所理解的含义,除非另外定义。应注意,这里使用的术语应解释为具有与本说明书的上下文相一致的含义,而不应以理想化或过于刻板的方式来解释。All terms (including technical and scientific terms) used herein have the meanings commonly understood by those skilled in the art unless otherwise defined. It should be noted that the terms used herein should be interpreted as having a meaning consistent with the context of this specification and should not be interpreted in an idealized or overly rigid manner.
针对传统软件故障分析和验证时间长,软件问题难以快速定位,且定位不准确;相似问题难以加速演化,快速进行软件故障呈现和解决方案的快速验证,本发明提供了一种软件局部故障减速分析和加速演化的方法。In view of the fact that traditional software fault analysis and verification takes a long time, software problems are difficult to locate quickly and the location is inaccurate; similar problems are difficult to accelerate the evolution, and software fault presentation and solution verification are quickly performed, the present invention provides a method for slowing down analysis and accelerating the evolution of local software faults.
本发明提出的方法,一方面解决软件故障定位困难和不精确,难以快速高效的给出解决方案并及时修复软件故障的问题。另一方面,分析软件故障的核心要素,基于软件故障加速演化模型,裂变生成更多的软件故障进行模拟验证,从而完成软件测试充分性需求。The method proposed in the present invention solves the problem that software fault location is difficult and imprecise, and it is difficult to quickly and efficiently provide solutions and repair software faults in a timely manner. On the other hand, the core elements of software faults are analyzed, and based on the software fault accelerated evolution model, more software faults are fission-generated for simulation verification, thereby meeting the software test adequacy requirements.
图1示意性示出了根据本发明实施例的软件局部故障减速分析和加速演化的方法的流程图。图2示意性示出了根据本发明实施例的软件局部故障减速分析和加速演化的方法的原理图。Fig. 1 schematically shows a flow chart of a method for decelerating analysis and accelerating evolution of a software local fault according to an embodiment of the present invention. Fig. 2 schematically shows a principle diagram of a method for decelerating analysis and accelerating evolution of a software local fault according to an embodiment of the present invention.
如图1和图2所示,该实施例的软件局部故障减速分析和加速演化的方法,可以包括步骤S1~步骤S5。As shown in FIG. 1 and FIG. 2 , the method for decelerating analysis and accelerating evolution of a local software fault in this embodiment may include steps S1 to S5 .
步骤S1,分析软件组成,识别软件的多个功能模块,确定每个功能模块的重要等级系数。Step S1, analyzing the software composition, identifying multiple functional modules of the software, and determining the importance level coefficient of each functional module.
步骤S2,根据重要等级系数设置软件的程序切片和对应程序切片的插桩点,利用插桩点监控软件的运行过程信息。Step S2, setting the program slices of the software and the insertion points of the corresponding program slices according to the importance level coefficient, and using the insertion points to monitor the running process information of the software.
步骤S3,对监控到的运行过程信息进行分析,定位软件的局部故障信息,将局部故障信息录入软件故障库。Step S3, analyzing the monitored operation process information, locating the local fault information of the software, and entering the local fault information into the software fault library.
步骤S4,基于软件故障库和预设的故障演化模型,裂变生成多个软件故障。Step S4, based on the software fault library and the preset fault evolution model, fission generates multiple software faults.
步骤S5,根据多个软件故障的故障类型构建故障模拟环境,在故障模拟环境下进行软件故障的模拟验证,将得到验证的软件故障作为源故障再次录入软件故障库,并返回步骤S4。Step S5, constructing a fault simulation environment according to the fault types of multiple software faults, performing simulation verification of the software faults in the fault simulation environment, re-entering the verified software faults as source faults into the software fault library, and returning to step S4.
本发明提出的方法,基于软件程序切片技术及插桩、断点调试的思想,针对软件需要监控的代码段或业务逻辑段设置插桩点,插桩点根据软件功能的重要程度进行等比插入,监控软件运行信息,根据监控信息完成软件的局部故障的定位和分析;同时,具体分析软件故障产生要素和条件,基于软件故障演化模型,裂变生成大量软件故障,结合构建的软件故障场景模拟测试,加速故障演化过程,快速验证解决方案。The method proposed in the present invention is based on software program slicing technology and the ideas of plugging and breakpoint debugging. Insertion points are set for code segments or business logic segments that need to be monitored by the software. The insertion points are inserted proportionally according to the importance of the software functions, and the software operation information is monitored. The local faults of the software are located and analyzed according to the monitoring information. At the same time, the factors and conditions that cause software faults are specifically analyzed, and a large number of software faults are fission-generated based on the software fault evolution model. Combined with the constructed software fault scenario simulation test, the fault evolution process is accelerated and the solution is quickly verified.
通过上述的实施例,本发明能够更加精细的定位和分析软件故障,因而可以更具针对性的进行故障修复,提高软件的安全性和可靠性;同时,能够加快软件故障演化的速度,快速模拟验证,获取更多的软件故障解决方案和应对措施,减少软件试错时间及成本。Through the above-mentioned embodiments, the present invention can locate and analyze software faults more accurately, so that fault repair can be performed in a more targeted manner, thereby improving the security and reliability of the software; at the same time, it can accelerate the evolution of software faults, quickly simulate and verify, obtain more software fault solutions and countermeasures, and reduce software trial and error time and cost.
下面对本发明的技术方案进行详细说明。The technical solution of the present invention is described in detail below.
图3示意性示出了根据本发明实施例的重要等级系数确定过程的流程图。FIG3 schematically shows a flow chart of a process for determining an importance level coefficient according to an embodiment of the present invention.
如图3所示,本实施例中,上述步骤S1具体可以包括步骤S11~步骤S12:As shown in FIG. 3 , in this embodiment, the above step S1 may specifically include steps S11 to S12:
步骤S11,针对软件需要监控的代码段或业务逻辑段,识别软件的多个功能模块;Step S11, identifying multiple functional modules of the software for the code segment or business logic segment that needs to be monitored by the software;
步骤S12,按照重要程度对多个功能模块进行分类和优先级划分,确定每个功能模块的重要等级系数。Step S12: classify and prioritize multiple functional modules according to their importance, and determine the importance level coefficient of each functional module.
可以理解的是,某个功能模块的优先级越高,则该模块的重要等级系数越高。It is understandable that the higher the priority of a functional module, the higher the importance level coefficient of the module.
图4示意性示出了根据本发明实施例的程序切片和插桩点确定过程的原理图。FIG. 4 schematically shows a principle diagram of a program slicing and an instrumentation point determination process according to an embodiment of the present invention.
如图4所示,本实施例中,在步骤S2,根据重要等级系数设置软件的程序切片和对应程序切片的插桩点,包括:当任一功能模块的重要等级系数越高,则设置越多的程序切片,并在相邻两个程序切片之间设置一个插桩点。As shown in FIG. 4 , in this embodiment, in step S2 , the program slices of the software and the insertion points of the corresponding program slices are set according to the importance level coefficient, including: when the importance level coefficient of any functional module is higher, more program slices are set, and an insertion point is set between two adjacent program slices.
由此,本发明提出的方法采用软件程序切片技术及插桩技术,根据软件模块的重要等级系数,进行等比例的切片和桩点插入。例如,越核心的模块,则进行越多的程序切片的划分和桩点插入。Therefore, the method proposed by the present invention adopts software program slicing technology and stub insertion technology to perform equal-proportion slicing and stub insertion according to the importance level coefficient of the software module. For example, the more core the module, the more program slicing and stub insertion are performed.
具体而言,图5示意性示出了根据本发明实施例的程序切片设置过程的原理图。图6示意性示出了根据本发明实施例的程序切片设置过程的流程图。Specifically, Fig. 5 schematically shows a principle diagram of a program slice setting process according to an embodiment of the present invention. Fig. 6 schematically shows a flow chart of a program slice setting process according to an embodiment of the present invention.
如图5和图6所示,本实施例中,在步骤S2,根据重要等级系数设置软件的程序切片,具体可以包括步骤S21~步骤S23。As shown in FIG. 5 and FIG. 6 , in this embodiment, in step S2 , the program slice of the software is set according to the importance level coefficient, which may specifically include steps S21 to S23 .
步骤S21,分析软件程序,提取软件的程序依赖关系,其中,程序依赖关系包括控制流和数据流信息。Step S21, analyzing the software program and extracting the program dependency of the software, wherein the program dependency includes control flow and data flow information.
步骤S22,规定程序切片的规则。Step S22, specifying the rules for program slicing.
例如,采用基于软件故障关键词、句子或短语等进行切片的规则。For example, use rules for slicing based on software fault keywords, sentences, or phrases.
步骤S23,依据程序切片的规则选择相应的程序切片算法,利用程序切片算法对提取到的程序依赖关系进行分析,生成程序切片。Step S23, selecting a corresponding program slicing algorithm according to the program slicing rule, using the program slicing algorithm to analyze the extracted program dependencies, and generating program slices.
例如,程序切片算法采用图可达性算法。For example, the program slicing algorithm adopts the graph reachability algorithm.
进一步地,在上述步骤S21,程序依赖关系采用程序依赖图的形式。首先完成程序依赖关系提取,从程序中提取各类信息,包括控制流和数据流信息,形成程序依赖图。Furthermore, in the above step S21, the program dependency relationship is in the form of a program dependency graph. First, the program dependency relationship extraction is completed, and various types of information, including control flow and data flow information, are extracted from the program to form a program dependency graph.
程序依赖图(PDG,Program Dependence Graph)由控制流图(CFG,Control FlowGraph)、控制依赖图(CDG,Control Dependence Graph)和数据依赖图(DDG,DataDependence Graph)组成,其中:控制流图描述了程序中控制流的转移情况,类似于正常情况下的流图;控制依赖图描述了程序中的控制依赖的转移情况,是对控制流图的补充;数据依赖图描述了程序中数据依赖的转移情况,是程序中所有数据依赖关系的集合。The Program Dependence Graph (PDG) is composed of the Control Flow Graph (CFG), the Control Dependence Graph (CDG) and the Data Dependence Graph (DDG), where: the Control Flow Graph describes the transfer of control flow in the program, which is similar to the flow graph under normal circumstances; the Control Dependence Graph describes the transfer of control dependencies in the program, which is a supplement to the Control Flow Graph; the Data Dependence Graph describes the transfer of data dependencies in the program, and is the collection of all data dependencies in the program.
控制依赖图包含域节点、语句节点和谓词节点:域节点可以通过控制依赖集合语句,语句节点表示程序中的普通语句,谓词节点表示程序中的策略或分支条件。数据依赖图包含语句间的数据依赖,可通过在控制依赖图的节点之间插入数据依赖边来构建。The control dependency graph contains domain nodes, statement nodes, and predicate nodes: domain nodes can be used to set statements through control dependencies, statement nodes represent ordinary statements in the program, and predicate nodes represent strategies or branch conditions in the program. The data dependency graph contains data dependencies between statements and can be constructed by inserting data dependency edges between nodes in the control dependency graph.
在完成程序切片的设置后,需要进行插桩点的设置。图7示意性示出了根据本发明实施例的插桩点设置过程的原理图。After the program slices are set, the instrumentation points need to be set. Fig. 7 schematically shows a principle diagram of the instrumentation point setting process according to an embodiment of the present invention.
如图7所示,本实施例中,插桩点的位置根据以下方式来确定:As shown in FIG. 7 , in this embodiment, the position of the insertion point is determined according to the following method:
根据重要等级系数确定插桩点的数量;Determine the number of insertion points according to the importance level coefficient;
获取任一程序切片的源程序,对源程序进行预处理后,对源程序进行词法、语法分析,确定各插桩点的位置,并植入插桩代码。The source program of any program slice is obtained, and after preprocessing the source program, the lexical and grammatical analysis is performed on the source program to determine the location of each insertion point and implant the insertion code.
具体而言,源代码插桩是在程序执行之前完成的,本发明首先根据模块优先级及重要系数确定插桩的数量,在软件源程序进行完整的词法、语法分析后,确定插桩的位置,植入插桩代码,进行代码的编译和执行,完成插桩点的位置。Specifically, source code stubbing is completed before program execution. The present invention first determines the number of stubbings according to the module priority and importance coefficient, determines the location of the stubbings after a complete lexical and grammatical analysis of the software source program, implants the stubbing code, compiles and executes the code, and completes the location of the stubbing points.
接着,对插桩点监控到的运行过程信息进行分析,定位软件的局部故障信息,将局部故障信息录入软件故障库。Next, the operation process information monitored by the insertion point is analyzed to locate the local fault information of the software, and the local fault information is entered into the software fault library.
图8示意性示出了根据本发明实施例的软件故障演化过程的原理图。图9示意性示出了根据本发明实施例的软件故障演化过程的流程图。Fig. 8 schematically shows a principle diagram of a software fault evolution process according to an embodiment of the present invention. Fig. 9 schematically shows a flow chart of a software fault evolution process according to an embodiment of the present invention.
如图8和图9所示,本实施例中,上述步骤S4具体可以包括步骤S41~步骤S42:As shown in FIG. 8 and FIG. 9 , in this embodiment, the above step S4 may specifically include steps S41 to S42:
步骤S41,分析软件故障库中各局部故障信息的产生要素,产生要素包括故障的产生原因、发生条件、调用关系、输入参数或输出参数;Step S41, analyzing the generating factors of each local fault information in the software fault library, the generating factors including the cause of the fault, the occurrence condition, the calling relationship, the input parameter or the output parameter;
步骤S42,结合产生要素,利用故障演化模型生成多个软件测试用例,裂变生成多个软件故障。Step S42, combining the generation factors, using the fault evolution model to generate multiple software test cases, and fissioning to generate multiple software faults.
也就是说,基于定位到的局部故障信息,也即软件发生的故障位置进行软件故障分析,识别出故障产生的产生原因、发生条件,以及软件故障所处的上下文,分析出故障的调用链情况以及调用链间的变量和参数传递,同时,结合软件测试用例生成方法,利用边界值法、等价类划分法、路径分析法等进行软件故障的形变,裂变(演化)生成更多的软件故障。That is to say, software fault analysis is performed based on the located local fault information, that is, the location where the software fault occurs, to identify the cause of the fault, the conditions for occurrence, and the context in which the software fault occurs, and to analyze the call chain of the fault and the variable and parameter transfer between the call chains. At the same time, combined with the software test case generation method, the boundary value method, equivalence class partitioning method, path analysis method, etc. are used to deform the software fault and fission (evolve) to generate more software faults.
图10示意性示出了根据本发明实施例的软件故障加速演化的原理图。FIG. 10 schematically shows a principle diagram of accelerating the evolution of software faults according to an embodiment of the present invention.
如图10所示,本发明提出的方法,基于软件定位到的局部故障信息,各局部故障信息的产生原因、发生条件,裂变生成更多相关的软件故障类型,快速构建故障模拟环境,进行模拟测试,并记录有效的软件故障,将其作为软件故障的输入源再次进行演化,持续演化分析,最终实现软件程序段的故障的全面识别分析。As shown in Figure 10, the method proposed in the present invention, based on the local fault information located by the software, the causes and conditions of each local fault information, fission generates more related software fault types, quickly builds a fault simulation environment, performs simulation tests, and records valid software faults, which are used as the input source of software faults to evolve again, continuously evolve and analyze, and finally achieve comprehensive identification and analysis of faults in software program segments.
通过本发明的实施例,基于软件故障库和故障演化模型,裂变生成大量的软件故障,并构建故障模拟环境,进行故障解决方案验证。针对有效的软件故障再次入库,进行软件故障演化和测试验证。由此,本发明实现软件局部故障的快速精准分析定位以及故障的演化和方案验证。Through the embodiments of the present invention, based on the software fault library and fault evolution model, a large number of software faults are generated by fission, and a fault simulation environment is constructed to verify the fault solution. Valid software faults are re-stored, and software fault evolution and test verification are performed. Therefore, the present invention realizes the rapid and accurate analysis and positioning of local software faults, as well as the evolution of faults and solution verification.
基于上述实施例公开的方法,为了方便描述,假定有如下简化的应用实例。根据前述提到的步骤,依次实施:Based on the method disclosed in the above embodiment, for the convenience of description, it is assumed that there is the following simplified application example. According to the above-mentioned steps, implement in sequence:
步骤1) 分析软件的组成结构和模块划分,根据软件功能的重要程度进行如下表1的等级设定和重要系数确定。Step 1) Analyze the software's structure and module division, and determine the level and importance coefficient as shown in Table 1 below based on the importance of the software functions.
步骤2) 分析软件程序,从程序中提取各类信息,包括控制流和数据流信息,形成程序依赖图。基于图可达性算法的切片方法,对提取的依赖关系进行分析处理,从而生成程序切片。Step 2) Analyze the software program and extract various information from the program, including control flow and data flow information, to form a program dependency graph. Based on the slicing method of the graph reachability algorithm, the extracted dependency relationships are analyzed and processed to generate program slices.
步骤3) 根据模块优先级及重要系数确定插桩的数量,在软件源程序进行完整的词法、语法分析后,确定插桩的位置,等比植入插桩代码,进行代码编译生成可执行程序,并分析程序运行过程中的桩点输出信息,进行软件故障定位,并将识别的软件故障入库。Step 3) Determine the number of stubs based on the module priority and importance coefficient. After a complete lexical and grammatical analysis of the software source program, determine the location of the stubs, implant the stub code proportionally, compile the code to generate an executable program, analyze the stub output information during program execution, locate the software fault, and store the identified software fault in the database.
步骤4) 根据定位的软件故障,进行软件故障分析,识别出故障产生的原因、条件,以及软件故障所处的上下文,分析出故障的调用链情况以及调用链见的变量和参数传递,同时,结合软件测试用例生成方法,利用边界值法、等价类划分法、路径分析法等进行软件故障的形变,演化生成更多的软件故障。Step 4) Perform software fault analysis based on the located software fault, identify the cause and conditions of the fault, and the context in which the software fault occurs, analyze the call chain of the fault and the variables and parameter transfer in the call chain, and at the same time, combine the software test case generation method, use the boundary value method, equivalence class partitioning method, path analysis method, etc. to deform the software fault and evolve and generate more software faults.
步骤5) 根据演化的故障进行故障的解决方案的确定和验证。Step 5) Determine and verify the solution to the fault based on the evolved fault.
通过上述的实施例,本发明提出的方法,至少具有以下有益效果:Through the above embodiments, the method proposed by the present invention has at least the following beneficial effects:
(1)能够更加精细的定位和分析软件故障,因而能够针对性的进行故障修复,缩短软件故障排查时间和系统故障的持续时间,提高软件的稳定性和可用性。(1) It can locate and analyze software failures more precisely, thus enabling targeted fault repair, shortening software fault troubleshooting time and the duration of system failures, and improving software stability and availability.
(2)能够基于已有软件故障进行演化分析,变异生成多个软件故障,快速进行故障模拟测试,获取更多的软件故障有效解决方案和应对措施,减少软件试错时间及成本。(2) It can perform evolutionary analysis based on existing software faults, generate multiple software faults through mutation, quickly conduct fault simulation tests, obtain more effective solutions and countermeasures for software faults, and reduce the time and cost of software trial and error.
本发明还提供了一种软件局部故障减速分析和加速演化的装置,以下将结合图11对该装置进行详细描述。The present invention also provides a device for decelerating analysis and accelerating evolution of local software faults, which will be described in detail below in conjunction with FIG. 11 .
图11示意性示出了根据本发明实施例的软件局部故障减速分析和加速演化的装置的结构框图。FIG. 11 schematically shows a structural block diagram of an apparatus for decelerating analysis and accelerating evolution of software local faults according to an embodiment of the present invention.
如图11所示,根据该实施例的软件局部故障减速分析和加速演化的装置1100包括重要等级确定模块1110、插桩点确定模块1120、故障定位模块1130、故障裂变模块1140和故障验证模块1150。As shown in FIG. 11 , the apparatus 1100 for decelerating analysis and accelerating evolution of software local faults according to this embodiment includes an importance level determination module 1110 , an insertion point determination module 1120 , a fault location module 1130 , a fault fission module 1140 and a fault verification module 1150 .
重要等级确定模块1110,用于分析软件组成,识别软件的多个功能模块,确定每个功能模块的重要等级系数。The importance level determination module 1110 is used to analyze the software composition, identify multiple functional modules of the software, and determine the importance level coefficient of each functional module.
插桩点确定模块1120,用于根据重要等级系数设置软件的程序切片和对应程序切片的插桩点,利用插桩点监控软件的运行过程信息。The insertion point determination module 1120 is used to set the program slices of the software and the insertion points of the corresponding program slices according to the importance level coefficient, and use the insertion points to monitor the running process information of the software.
故障定位模块1130,用于对监控到的运行过程信息进行分析,定位软件的局部故障信息,将局部故障信息录入软件故障库。The fault location module 1130 is used to analyze the monitored operation process information, locate the local fault information of the software, and enter the local fault information into the software fault library.
故障裂变模块1140,用于基于软件故障库和预设的故障演化模型,裂变生成多个软件故障。The fault fission module 1140 is used to generate multiple software faults by fission based on the software fault library and a preset fault evolution model.
故障验证模块1150,用于根据多个软件故障的故障类型构建故障模拟环境,在故障模拟环境下进行软件故障的模拟验证,将得到验证的软件故障作为源故障再次录入软件故障库,并返回故障裂变模块。The fault verification module 1150 is used to build a fault simulation environment according to the fault types of multiple software faults, perform simulation verification of software faults in the fault simulation environment, re-enter the verified software faults into the software fault library as source faults, and return them to the fault fission module.
需要说明的是,装置部分的实施例方式与方法部分的实施例方式对应类似,并且所达到的技术效果也对应类似,具体细节请参照上述方法实施例方式部分,在此不再赘述。It should be noted that the implementation method of the device part is similar to the implementation method of the method part, and the technical effects achieved are also similar. For specific details, please refer to the above-mentioned method implementation method part, which will not be repeated here.
根据本发明的实施例,重要等级确定模块1110、插桩点确定模块1120、故障定位模块1130、故障裂变模块1140和故障验证模块1150中的任意多个可以合并在一个模块中实现,或者其中的任意一个模块可以被拆分成多个模块。或者,这些模块中的一个或多个模块的至少部分功能可以与其他模块的至少部分功能相结合,并在一个模块中实现。根据本发明的实施例,重要等级确定模块1110、插桩点确定模块1120、故障定位模块1130、故障裂变模块1140和故障验证模块1150中的至少一个可以至少被部分地实现为硬件电路,例如现场可编程门阵列(FPGA)、可编程逻辑阵列(PLA)、片上系统、基板上的系统、封装上的系统、专用集成电路(ASIC),或可以通过对电路进行集成或封装的任何其他的合理方式等硬件或固件来实现,或以软件、硬件以及固件三种实现方式中任意一种或以其中任意几种的适当组合来实现。或者,重要等级确定模块1110、插桩点确定模块1120、故障定位模块1130、故障裂变模块1140和故障验证模块1150中的至少一个可以至少被部分地实现为计算机程序模块,当该计算机程序模块被运行时,可以执行相应的功能。According to an embodiment of the present invention, any multiple of the importance level determination module 1110, the insertion point determination module 1120, the fault location module 1130, the fault fission module 1140 and the fault verification module 1150 can be combined in one module for implementation, or any one of the modules can be split into multiple modules. Alternatively, at least part of the functions of one or more of these modules can be combined with at least part of the functions of other modules and implemented in one module. According to an embodiment of the present invention, at least one of the importance level determination module 1110, the insertion point determination module 1120, the fault location module 1130, the fault fission module 1140 and the fault verification module 1150 can be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on a chip, a system on a substrate, a system on a package, an application specific integrated circuit (ASIC), or can be implemented by hardware or firmware such as any other reasonable way of integrating or packaging the circuit, or implemented in any one of the three implementation methods of software, hardware and firmware or in a proper combination of any of them. Alternatively, at least one of the importance level determination module 1110, the insertion point determination module 1120, the fault location module 1130, the fault fission module 1140 and the fault verification module 1150 may be at least partially implemented as a computer program module, which may perform corresponding functions when executed.
附图中示出了一些方框图和/或流程图。应理解,方框图和/或流程图中的一些方框或其组合可以由计算机程序指令来实现。这些计算机程序指令可以提供给通用计算机、专用计算机或其他可编程数据处理装置的处理器,从而这些指令在由该处理器执行时可以创建用于实现这些方框图和/或流程图中所说明的功能/操作的装置。Some block diagrams and/or flow charts are shown in the accompanying drawings. It should be understood that some blocks or combinations thereof in the block diagrams and/or flow charts may be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that these instructions, when executed by the processor, may create a device for implementing the functions/operations described in these block diagrams and/or flow charts.
此外,术语“第一”、“第二”仅用于描述目的,而不能理解为指示或暗示相对重要性或者隐含指明所指示的技术特征的数量。因此,限定有“第一”、“第二”的特征可以明示或者隐含地包括一个或者更多个该特征。在本发明的描述中,“多个”的含义是至少两个,例如两个、三个等,除非另有明确具体的限定。此外,位于元件之前的单词“一”或“一个”不排除存在多个这样的元件。In addition, the terms "first" and "second" are used only for descriptive purposes and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the feature. In the description of the present invention, the meaning of "plurality" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined. In addition, the word "one" or "an" preceding an element does not exclude the presence of multiple such elements.
以上所述的具体实施例,对本发明的目的、技术方案和有益效果进行了进一步详细说明,所应理解的是,以上所述仅为本发明的具体实施例而已,并不用于限制本发明,凡在本发明的精神和原则之内,所做的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。The specific embodiments described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims (9)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202410372693.0A CN117971546B (en) | 2024-03-29 | 2024-03-29 | A method and device for decelerating analysis and accelerating evolution of software local faults |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202410372693.0A CN117971546B (en) | 2024-03-29 | 2024-03-29 | A method and device for decelerating analysis and accelerating evolution of software local faults |
Publications (2)
Publication Number | Publication Date |
---|---|
CN117971546A true CN117971546A (en) | 2024-05-03 |
CN117971546B CN117971546B (en) | 2024-11-26 |
Family
ID=90864874
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202410372693.0A Active CN117971546B (en) | 2024-03-29 | 2024-03-29 | A method and device for decelerating analysis and accelerating evolution of software local faults |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN117971546B (en) |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20160019133A1 (en) * | 2014-07-15 | 2016-01-21 | 4D Soft Kft. | Method for tracing a computer software |
US20170161182A1 (en) * | 2015-12-02 | 2017-06-08 | Fujitsu Limited | Machine learning based software program repair |
CN111786823A (en) * | 2020-06-19 | 2020-10-16 | 中国工商银行股份有限公司 | Fault simulation method and device based on distributed service |
CN114546759A (en) * | 2022-01-14 | 2022-05-27 | 北京基调网络股份有限公司 | Database access error monitoring and analyzing method and device and electronic equipment |
CN115562674A (en) * | 2022-09-29 | 2023-01-03 | 中国人民解放军国防科技大学 | A load-aware software configuration parameter adjustment method |
CN117632721A (en) * | 2023-11-28 | 2024-03-01 | 广州虎牙信息科技有限公司 | Test case generation method, device and electronic equipment |
-
2024
- 2024-03-29 CN CN202410372693.0A patent/CN117971546B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20160019133A1 (en) * | 2014-07-15 | 2016-01-21 | 4D Soft Kft. | Method for tracing a computer software |
US20170161182A1 (en) * | 2015-12-02 | 2017-06-08 | Fujitsu Limited | Machine learning based software program repair |
CN111786823A (en) * | 2020-06-19 | 2020-10-16 | 中国工商银行股份有限公司 | Fault simulation method and device based on distributed service |
CN114546759A (en) * | 2022-01-14 | 2022-05-27 | 北京基调网络股份有限公司 | Database access error monitoring and analyzing method and device and electronic equipment |
CN115562674A (en) * | 2022-09-29 | 2023-01-03 | 中国人民解放军国防科技大学 | A load-aware software configuration parameter adjustment method |
CN117632721A (en) * | 2023-11-28 | 2024-03-01 | 广州虎牙信息科技有限公司 | Test case generation method, device and electronic equipment |
Non-Patent Citations (1)
Title |
---|
李渊: "基于轨迹监控的故障定位工具设计与实现", 《中国优秀硕士学位论文全文数据库(电子期刊)》, 29 February 2024 (2024-02-29), pages 1 - 26 * |
Also Published As
Publication number | Publication date |
---|---|
CN117971546B (en) | 2024-11-26 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Natella et al. | On fault representativeness of software fault injection | |
CN110287052B (en) | Root cause task determination method and device for abnormal task | |
Qi et al. | The strength of random search on automated program repair | |
Fu et al. | Execution anomaly detection in distributed systems through unstructured log analysis | |
US8145949B2 (en) | Automated regression failure management system | |
Arcuri et al. | Black-box system testing of real-time embedded systems using random and search-based testing | |
CN110543420B (en) | A software testing method, system, terminal and storage medium | |
CN105260312B (en) | A kind of adjustment method of multinuclear real time system application data contention mistake | |
CN116431476A (en) | A JVM fuzzing method based on code context mutation | |
CN104572474A (en) | Dynamic slicing based lightweight error locating implementation method | |
Calvagna et al. | Automated conformance testing of Java virtual machines | |
Kabadi et al. | The future can’t help fix the past: Assessing program repair in the wild | |
CN107247663B (en) | A method for identifying redundant variants | |
US8478575B1 (en) | Automatic anomaly detection for HW debug | |
CN117971546A (en) | A method and device for decelerating analysis and accelerating evolution of software local faults | |
CN117669484A (en) | Chip simulation log checking method, device and readable medium | |
CN115422865B (en) | Simulation method and device, computing equipment and computer readable storage medium | |
CN116382697A (en) | Version consistency checking method, project construction method, equipment and medium | |
EP3553681B1 (en) | Method and apparatus for error test coverage determination for a circuit by simulation | |
CN114694869A (en) | Nuclear power station instrument control system transformation risk control method, electronic equipment and storage medium | |
CN113282495A (en) | Java software fault positioning method based on track monitoring | |
CN118502397B (en) | Electronic control module function-based test method and system | |
Bursey et al. | Syzretrospector: A large-scale retrospective study of syzbot | |
Mohd-Shafie et al. | An EFSM-Based Test Data Generation Approach in Model-Based Testing. | |
CN115658551B (en) | Code testing method, storage medium, electronic device and apparatus |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |