skip to main content
10.1145/3524610.3527875acmconferencesArticle/Chapter ViewAbstractPublication PagesicseConference Proceedingsconference-collections
short-paper

Casdoc: unobtrusive explanations in code examples

Published: 20 October 2022 Publication History

Abstract

Code examples are of great value to programmers trying to learn an unfamiliar API. Effective code examples are often surrounded with plain text explanations of the relevant concepts, techniques, and API elements involved in the example. However, authoring concise yet complete explanations is a challenging balancing act. To address this challenge, we propose Casdoc, a novel authoring technique and presentation format for annotated code examples. Casdoc-formatted code examples are HTML documents designed to embed unobtrusive explanations into the code. They thus contain more explanations to address the varying needs of a larger audience, without disrupting individual readers with information they already know. Explanations are split into short annotations and organized into an intuitive tree-like structure, thus supporting a streamlined authoring process. We used Casdoc to produce 105 Java code examples as part of the course material for an undergraduate computer science course. Students preferred the new format over traditional code examples. Their interaction with code examples suggests that the intuitive structure of Casdoc annotations reduces the need for navigation aids such as search fields.
On-line tool and video: https://www.cs.mcgill.ca/~martin/casdoc/

References

[1]
Emad Aghajani, Csaba Nagy, Olga Lucero Vega-Márquez, Mario Lineres-Vásquez, Laura Moreno, Gabriele Bavota, and Michele Lanza. 2019. Software Documentation Issues Unveiled. In Proceedings of the IEEE/ACM 41st International Conference on Software Engineering. 1199--1210.
[2]
Joel Brandt, Philip J. Guo, Joel Lewenstein, Mira Dontcheva, and Scott R. Klemmer. 2009. Two Studies of Opportunistic Programming: Interleaving Web Foraging, Learning, and Writing Code. In Proceedings of the SIGCHI Conference on Human Factors in Computing Systems. 1589--1598.
[3]
Raymond P. L. Buse and Westley Weimer. 2012. Synthesizing API Usage Examples. In Proceedings of the 34th IEEE/ACM International Conference on Software Engineering. 357--367.
[4]
Sridhar Chimalakonda and Akhila Sri Manasa Venigalla. 2020. Software Documentation and Augmented Reality: Love or Arranged Marriage?. In Proceedings of the 28th Joint Meeting on European Software Engineering Conference and Symposium on the Foundations of Software Engineering. 1529--1532.
[5]
Bill Curtis, Sylvia B. Sheppard, Elizabeth Kruesi-Bailey, John Bailey, and Deborah A. Boehm-Davis. 1989. Experimental Evaluation of Software Documentation Formats. Journal of Systems and Software 9, 2 (1989), 167--207.
[6]
Mingwei Liu, Xin Peng, Andrian Marcus, Zhenchang Xing, Wenkai Xie, Shuangshuang Xing, and Yang Liu. 2019. Generating Query-Specific class API Summaries. In Proceedings of the 27th Joint Meeting on European Software Engineering Conference and Symposium on the Foundations of Software Engineering. 120--130.
[7]
Laura MacLeod, Margaret-Anne Storey, and Andreas Bergen. 2015. Code, Camera, Action: How Software Developers Document and Share Program Knowledge Using YouTube. In Proceedings of the IEEE 23rd International Conference on Program Comprehension. 104--114.
[8]
Seyed Mehdi Nasehi, Jonathan Sillito, Frank Maurer, and Chris Burns. 2012. What Makes a Good Code Example? A Study of Programming Q&A in StackOverflow. In Proceedings of the 28th IEEE International Conference on Software Maintenance. 25--34.
[9]
Tutorials Point. 2009. JDBC - Sample, Example Code. https://www.tutorialspoint.com/jdbc/jdbc-sample-code.htm Last access: 2021-11-01.
[10]
Martin P. Robillard and Robert DeLine. 2011. A field study of API learning obstacles. Empirical Software Engineering 16, 6 (2011), 703--732.
[11]
Philipp Schugerl, Juergen Rilling, and Philippe Charland. 2009. Beyond Generated Software Documentation - A Web 2.0 Perspective. In Proceedings of the IEEE International Conference on Software Maintenance. 547--550.
[12]
Jaime Teevan, Christine Alvarado, Mark S. Ackerman, and David R. Karger. 2004. The Perfect Search Engine Is Not Enough: A Study of Orienteering Behavior in Directed Search. In Proceedings of the SIGCHI Conference on Human Factors in Computing Systems. 415--422.
[13]
Christoph Treude and Martin P. Robillard. 2016. Augmenting API Documentation with Insights from Stack Overflow. In Proceedings of the IEEE/ACM 38th International Conference on Software Engineering. 392--403.
[14]
Christoph Treude, Martin P. Robillard, and Barthélémy Dagenais. 2015. Extracting Development Tasks to Navigate Software Documentation. IEEE Transactions on Software Engineering 41, 6 (2015), 565--581.
[15]
Gias Uddin and Martin P. Robillard. 2015. How API Documentation Fails. IEEE Software 32, 4 (2015), 68--75.

Cited By

View all
  • (2025)Evaluating interactive documentation for programmersEmpirical Software Engineering10.1007/s10664-025-10618-030:3Online publication date: 26-Feb-2025
  • (2023)A Field Study of Developer Documentation FormatExtended Abstracts of the 2023 CHI Conference on Human Factors in Computing Systems10.1145/3544549.3585767(1-7)Online publication date: 19-Apr-2023
  • (2023)CoDescribe: An Intelligent Code Analyst for Enhancing Productivity and Software QualityApplied Computing for Software and Smart Systems10.1007/978-981-99-7783-3_11(161-181)Online publication date: 27-Dec-2023

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Conferences
ICPC '22: Proceedings of the 30th IEEE/ACM International Conference on Program Comprehension
May 2022
698 pages
ISBN:9781450392983
DOI:10.1145/3524610
  • Conference Chairs:
  • Ayushi Rastogi,
  • Rosalia Tufano,
  • General Chair:
  • Gabriele Bavota,
  • Program Chairs:
  • Venera Arnaoudova,
  • Sonia Haiduc
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than the author(s) must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected].

Sponsors

In-Cooperation

  • IEEE CS

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 20 October 2022

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. code examples
  2. documentation format
  3. software documentation

Qualifiers

  • Short-paper

Funding Sources

Conference

ICPC '22
Sponsor:

Upcoming Conference

ICSE 2025

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)12
  • Downloads (Last 6 weeks)1
Reflects downloads up to 02 Mar 2025

Other Metrics

Citations

Cited By

View all
  • (2025)Evaluating interactive documentation for programmersEmpirical Software Engineering10.1007/s10664-025-10618-030:3Online publication date: 26-Feb-2025
  • (2023)A Field Study of Developer Documentation FormatExtended Abstracts of the 2023 CHI Conference on Human Factors in Computing Systems10.1145/3544549.3585767(1-7)Online publication date: 19-Apr-2023
  • (2023)CoDescribe: An Intelligent Code Analyst for Enhancing Productivity and Software QualityApplied Computing for Software and Smart Systems10.1007/978-981-99-7783-3_11(161-181)Online publication date: 27-Dec-2023

View Options

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Figures

Tables

Media

Share

Share

Share this Publication link

Share on social media