Font Size: a A A

Researches On How To Improve Log Practices By Learning From Software Evolution

Posted on:2020-04-24Degree:MasterType:Thesis
Country:ChinaCandidate:X NiuFull Text:PDF
GTID:2428330611493653Subject:Computer Science and Technology
Abstract/Summary:PDF Full Text Request
As the complexity of software increasing,it becomes more troublesome to diagnose software bugs.For recording runtime information with low overhead,logging statements play important roles in postmortem debugging.Despite the importance,developers are difficult to establish good logging practices.There are mainly two reasons.First,there are no rigorous specifications or systematic processes to instruct logging practices.Second,logging code evolves with bug fixes or feature updates.Without considering the impact of software evolution,previous works on log enhancement can partially release the first problem but are hard to solve the latter.To fill this gap,this paper proposes to guide log revisions by learning from evolution history.Motivated by code clones,we assume that logging code with similar context is pervasive and deserves similar modifications and conduct an empirical study on eight open-source projects to validate our assumption.Upon this,we design and implement LogTracker,an automatic tool that learns log revision rules by mining the correlation between logging context and modifications and recommends candidate log revisions by applying these rules.In summary,this paper makes following contributions:1.For studying characteristics of log revisions,we have conducted an empirical studyon several open source subjects,including Httpd,Git,Postfix,and Collectd.Thestudy turns out that there are averagely 54.1% of log revisions perform similar mod-ifications on logging statements.Among them,67.0% are caused by similar loggingcontext.Meanwhile,we find that 80.3% of context-similar log revisions share simi-lar modifications.That is to say,logging code with similar logging context deservessimilar modifications in most cases.2.Based on above observation,we design and implement LogTracker,an automatictool to learn rules from evolution by mining the correlation between logging contextand modifications.In total,we mine 1432 pieces of log revision rules from the eightsubject systems.For a better description of logging context,this paper designsLCDM which employs related functions to model logging context.The experimentshows that the precision of LCDM is 12.4% higher than traditional algorithm whendetecting context-similar log revisions.3.With learned rules,LogTracker is capable of automatically locating candidate codesnippets which need log revisions and recommending reasonable syntactical editscripts.The experiment turns out that the average precision of LogTracker whenlocating candidates is 98.7% and that 86.5% of the recommended scripts are correct.Besides,when applied to the latest versions,LogTracker detects 295 pieces of logrevisions.Up to now,this paper has reported 43 of them to developers,31 havebeen accepted.
Keywords/Search Tags:Log revision, Software evolution, Empirical study
PDF Full Text Request
Related items