The invention discloses a method for automatically identifying software log behavior based on program analysis, which aims at solving the problem that the existing log enhancement work is difficult to automatically and accurately identify the log behavior of the software. Technical scheme is the first goal of the project Proj source code to function as a unit segmentation, recognition function of branch statements, function call statements, log statements and into the function of the branch statement set, function call statement collection and log collection of statements, were screened for the presence of data dependent elements between the call set and set Branch in the presence of data dependent elements, and then were screened for the presence of control dependence element element set with log log by behavior set. The invention can automatically identify the source code for fault diagnosis of the log behavior, can accurately identify the relationship between the function call statements, branches and log statements, enhance the effectiveness of the log enhancement, the log is more rapid and accurate identification of behavior.
【技术实现步骤摘要】
本专利技术涉及计算机软件中日志行为的识别方法,尤其指大规模软件中面向故障诊断的日志行为识别方法。
技术介绍
当今计算机技术迅速发展、计算能力不断提高,计算机软件系统无论从规模上还是功能上都在增大、增强。随着软件需求的日益复杂,大规模软件系统在军用和民用领域中均被广泛使用。目前,中、小规模软件可以利用形式化等方法有效保障可靠性,但大规模软件的故障诊断主要依靠人力排查,定位问题不及时且效率低,错误重现和调试都十分困难。软件日志是大型软件中故障诊断的重要手段,它可以记录程序运行时的动态信息,帮助维护人员分析重现错误,进而更正系统错误。规范和充分的日志对于软件故障诊断非常重要,也是良好编程规范的必要因素。但目前软件中的日志多数是依赖编程人员的经验和个人习惯,缺乏统一的被普遍接受的标准,在大型开源软件中利用现有的日志信息进行故障重现和检测难度大、效率低。因此,通过增强日志代码质量,进一步改善大规模软件故障检测技术的研究愈加重要。同时,由于代码量巨大,人工改善软件日志几乎不可能完成,因此自动化地实现日志增强的需求越来越迫切,同时也面临重大挑战。日志自动增强的主要方法是通过学习软件已有日志,预测需要添加日志的程序点。其中,如何自动、准确地识别软件已有面向故障诊断的日志是日志增强过程中的一个关键技术。目前国际上已有日志的自动化增强工具,其中有代表性的有朱杰明的文章LearningtoLog:HelpingDevelopersMakeInformedLoggingDecisions(为开发人员提供有效日志决策)中设计的LogAdvisor,以及袁丁的文章BeConserv ...
【技术保护点】
一种基于程序分析的软件日志行为自动识别方法,其特征在于包括以下步骤:第一步、准备输入输出,方法为:1.1记目标工程为Proj,将Proj的源代码以函数为单位分割,得到函数集F={func1,func2,...,funcf},其中func1为Proj中的第1个函数,f为Proj中函数的个数;1.2建立日志行为集LB,用于保存日志行为识别结果,并将LB初始化为空;第二步、建立函数的分支语句、函数调用语句和日志语句的集合,方法为:2.1令变量i=0;2.2令i=i+1,如果i>f,执行第六步;否则执行2.3;2.3建立分支集B(i)、调用集C(i)和日志集L(i),分别表示funci中的分支语句集合、函数调用语句集合和日志语句集合,并将B(i)、C(i)和L(i)全部初始化为空;第三步、填充B(i)、C(i)和L(i),方法是:3.1填充分支集B(i):使用前端分析工具识别funci中的所有分支语句,并加入B(i)中,得到B(i)={brani,1,brani,2,...,brani,b(i)},其中brani,1为funci的第1个分支语句,b(i)为funci中分支语句的个数;3. ...
【技术特征摘要】
1.一种基于程序分析的软件日志行为自动识别方法,其特征在于包括以下步骤:第一步、准备输入输出,方法为:1.1记目...
【专利技术属性】
技术研发人员:廖湘科,李姗姗,贾周阳,刘晓东,董威,林彬,周书林,徐向阳,郦旺,
申请(专利权)人:中国人民解放军国防科学技术大学,
类型:发明
国别省市:湖南;43
还没有人留言评论。发表了对其他浏览者有用的留言会获得科技券。