首页    期刊浏览 2025年07月15日 星期二
登录注册

文章基本信息

  • 标题:Source Code Documentation Generation Using Program Execution
  • 本地全文:下载
  • 作者:Matúš Sulír ; Jaroslav Porubän
  • 期刊名称:Information
  • 电子版ISSN:2078-2489
  • 出版年度:2017
  • 卷号:8
  • 期号:4
  • 页码:148
  • DOI:10.3390/info8040148
  • 语种:English
  • 出版社:MDPI Publishing
  • 摘要:Automated source code documentation approaches often describe methods in abstract terms, using the words contained in the static source code or code excerpts from repositories. In this paper, we describe DynamiDoc: a simple automated documentation generator based on dynamic analysis. Our representation-based approach traces the program being executed and records string representations of concrete argument values, a return value and a target object state before and after each method execution. Then, for each method, it generates documentation sentences with examples, such as “When called on [3, 1.2] with element = 3, the object changed to [1.2]”. Advantages and shortcomings of the approach are listed. We also found out that the generated sentences are substantially shorter than the methods they describe. According to our small-scale study, the majority of objects in the generated documentation have their string representations overridden, which further confirms the potential usefulness of our approach. Finally, we propose an alternative, variable-based approach that describes the values of individual member variables, rather than the state of an object as a whole.
  • 关键词:documentation generation; source code summarization; method documentation; dynamic analysis; examples documentation generation ; source code summarization ; method documentation ; dynamic analysis ; examples
国家哲学社会科学文献中心版权所有