Next Article in Journal
NC-TODIM-Based MAGDM under a Neutrosophic Cubic Set Environment
Next Article in Special Issue
EmoSpell, a Morphological and Emotional Word Analyzer
Previous Article in Journal
Land Cover Classification from Multispectral Data Using Computational Intelligence Tools: A Comparative Study
Previous Article in Special Issue
On the Implementation of a Cloud-Based Computing Test Bench Environment for Prolog Systems
Article Menu

Export Article

Open AccessArticle
Information 2017, 8(4), 148;

Source Code Documentation Generation Using Program Execution

Department of Computers and Informatics, Faculty of Electrical Engineering and Informatics, Technical University of Košice, Letná 9, 042 00 Košice, Slovakia
This paper is an extended version of our paper published in SLATE 2017: Generating Method Documentation Using Concrete Values from Executions.
Author to whom correspondence should be addressed.
Received: 30 September 2017 / Revised: 13 November 2017 / Accepted: 14 November 2017 / Published: 17 November 2017
(This article belongs to the Special Issue Special Issues on Languages Processing)
Full-Text   |   PDF [291 KB, uploaded 17 November 2017]   |  


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. View Full-Text
Keywords: documentation generation; source code summarization; method documentation; dynamic analysis; examples documentation generation; source code summarization; method documentation; dynamic analysis; examples

Figure 1

This is an open access article distributed under the Creative Commons Attribution License which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited (CC BY 4.0).

Share & Cite This Article

MDPI and ACS Style

Sulír, M.; Porubän, J. Source Code Documentation Generation Using Program Execution. Information 2017, 8, 148.

Show more citation formats Show less citations formats

Note that from the first issue of 2016, MDPI journals use article numbers instead of page numbers. See further details here.

Related Articles

Article Metrics

Article Access Statistics



[Return to top]
Information EISSN 2078-2489 Published by MDPI AG, Basel, Switzerland RSS E-Mail Table of Contents Alert
Back to Top