Misconfigurations have become the dominant causes of software failures in recent years, drawing tremendous attention for their increasing prevalence and severity. Configuration constraints can preemptively avoid misconfiguration by defining the conditions that configuration options should satisfy. Documentation is the main source of configuration constraints, but it might be incomplete or inconsistent with the source code. In this regard, prior researches have focused on obtaining configuration constraints from software source code through static analysis. However, the difficulty in pointer analysis and context comprehension prevents them from collecting accurate and comprehensive constraints. In this paper, we observed that software logs often contain configuration constraints. We conducted an empirical study and summarized patterns of configuration-related log messages. Guided by the study, we designed and implemented ConfInLog, a static tool to infer configuration constraints from log messages. ConfInLog first selects configuration-related log messages from source code by using the summarized patterns, then infers constraints from log messages based on the summarized natural language patterns. To evaluate the effectiveness of ConfInLog, we applied our tool on seven popular open-source software systems. ConfInLog successfully inferred 22 to 163 constraints, in which 59.5% to 61.6% could not be inferred by the state-of-the-art work. Finally, we submitted 67 documentation patches regarding the constraints inferred by ConfInLog. The constraints in 29 patches have been confirmed by the developers, among which 10 patches have been accepted.
翻译:配置限制可以通过定义配置选项应该满足的条件来预先避免配置错误。文档是配置限制的主要来源,但可能是不完整的,或与源代码不一致。在这方面,先前的研究侧重于通过静态分析从软件源代码获取配置限制。然而,由于点数分析和背景理解方面的困难,它们无法收集准确和全面的限制。在本文中,我们发现软件日志往往含有配置限制。我们进行了实验性研究并总结了配置相关日志信息的模式。在研究的指导下,我们设计和实施了ConfInLog,这是一个用于从日志信息中推断配置限制的静态工具。 ConfInLog首先利用汇总模式从源代码中选择了配置相关日志信息,然后根据汇总的自然语言模式推断日志信息存在限制。为了评估 ConfInLog的有效性,我们在7个广受欢迎的公开源软件系统中应用了我们的工具。 ConfInLog成功推断了22至163项的限制,其中,59.5%至61.6%是我们最终推算的固定限制。