| 研究生: |
曾培源 Pei-Yuan Zeng |
|---|---|
| 論文名稱: |
Time capsules of code: 使用穿越時空的訊息來解決程式碼 註解的弊病 |
| 指導教授: |
鄭永斌
Yung-Pin Cheng |
| 口試委員: | |
| 學位類別: |
碩士 Master |
| 系所名稱: |
資訊電機學院 - 軟體工程研究所 Graduate Institute of Software Engineering |
| 論文出版年: | 2024 |
| 畢業學年度: | 112 |
| 語文別: | 中文 |
| 論文頁數: | 63 |
| 中文關鍵詞: | 穿越時空的訊息 、程式碼註解 、註解一致性 、註解的時效性 |
| 相關次數: | 點閱:11 下載:0 |
| 分享至: |
| 查詢本校圖書館目錄 查詢臺灣博碩士論文知識加值系統 勘誤回報 |
在軟體開發過程中,程式開發者經常因為開發需求而遺漏或未更 新註解,導致程式碼與註解不一致。此外,隨著程式碼的頻繁變動, 因為註解具有時效性的問題,造成註解的歷史在最新版本的程式碼中 難以的完整被保留,然而這對未來的軟體維護至關重要。
傳統的程式碼註解方式存在諸多缺陷,例如無法留下長訊息、無 法支援多媒體註解,或是難以追蹤程式碼和註解的改動歷史等等的問 題。針對這些問題,本論文提出了一種名為 Message Box 的擴展自 GeekyNote 標籤系統工具,旨在通過自動化整合歷史訊息和結合 Git 訊息的方式,提供程式碼變更歷史追蹤和管理,以解決程式碼與註解 的一致性問題,並且能夠整合多種訊息以及儲存 HTML 標記、圖片、 影音等資料,使得訊息呈現更具可讀性。此外,Message Box 也透過 結合 Git 時間軸資料,補足註解的時效性問題,避免過去的訊息在最 新版本專案中消失。
Message Box 的設計和實現展示了一種新的程式碼與註解歷史變 動管理方式,有效提升了軟體開發的效率和程式碼的可維護性,減少 了註解與程式碼不一致與時效性的風險,提供了詳細的變更歷史記錄, 便於開發者進行追溯和理解。
In the software development process, developers often fail to update comments due to development needs, leading to inconsistencies between code and comments. Additionally, with frequent code changes, the temporal nature of comments causes the history of comments to be difficult to retain completely in the latest version of the code, which is crucial for future software maintenance.
Traditional code commenting methods have many drawbacks, such as the inability to leave long messages, lack of support for multimedia comments, and difficulty in tracking changes to code and comments. To address these issues, this thesis proposes a tool named Message Box, an extension of the GeekyNote tagging system, aimed at automatically integrating historical information and combining Git messages to provide code change history tracking and management. This tool resolves the consistency issues between code and comments, and can integrate various types of information as well as store HTML tags, images, videos, and other data, making the presentation of information more readable. Additionally, by incorporating Git timeline data, Message Box addresses the temporal nature of comments, preventing past information from disappearing in the latest project versions.
The design and implementation of Message Box demonstrate a new way to manage the historical changes of code and comments, significantly improving software development efficiency and code maintainability. It reduces the risk of inconsistencies and obsolescence of comments, provides detailed change history records, and facilitates developers in tracing and understanding changes.
[1] Y. -P. Cheng, W. -N. Hsiung, Y. -S. Wu and L. -H. Chen, "GeekyNote: A Technical Documentation Tool with Coverage, Backtracking, Traces, and Couplings," 2020 IEEE/ACM 42nd International Conference on Software Engineering: Companion Proceedings (ICSE-Companion), Seoul, Korea (South), 2020, pp. 73-76.
[2] E. Aghajani et al., "Software Documentation Issues Unveiled," 2019 IEEE/ACM 41st International Conference on Software Engineering (ICSE), Montreal, QC, Canada, 2019, pp. 1199-1210, doi: 10.1109/ICSE.2019.00122.
[3] S. Haiduc, J. Aponte, L. Moreno and A. Marcus, "On the Use of Automated Text Summarization Techniques for Summarizing Source Code," 2010 17th Working Conference on Reverse Engineering, Beverly, MA, USA, 2010, pp. 35-44, doi: 10.1109/WCRE.2010.13.
[4] L. Moreno, J. Aponte, G. Sridhara, A. Marcus, L. Pollock and K. Vijay-Shanker, "Automatic generation of natural language summaries for Java classes," 2013 21st International Conference on Program Comprehension (ICPC), San Francisco, CA, USA, 2013, pp. 23-32, doi: 10.1109/ICPC.2013.6613830.
[5] S. H. Tan, D. Marinov, L. Tan and G. T. Leavens, "@tComment: Testing Javadoc Comments to Detect Comment-Code Inconsistencies," 2012 IEEE Fifth International Conference on Software Testing, Verification and Validation, Montreal, QC, Canada, 2012, pp. 260-269, doi: 10.1109/ICST.2012.106.
[6] Tan L, Yuan D, Krishna G, et al. 2007. iComment: Bugs or bad comments? ACM SIGOPS Operating Systems Review. ACM, 41(6): 145–158.
[7] “Git Commit” [Online]. Available: https://www.git-scm.com/docs/git-commit. [Accessed 12 6 2024]
[8] D. Steidl, B. Hummel and E. Juergens, "Quality analysis of source code comments," 2013 21st International Conference on Program Comprehension (ICPC), San Francisco, CA, USA, 2013, pp. 83-92, doi: 10.1109/ICPC.2013.6613836.
[9] P. Chatterjee, B. Gause, H. Hedinger and L. Pollock, "Extracting Code Segments and Their Descriptions from Research Articles," 2017 IEEE/ACM 14th International Conference on Mining Software Repositories (MSR), Buenos Aires, Argentina, 2017, pp. 91-101, doi: 10.1109/MSR.2017.10.
[10] B. Yang, Z. Liping and Z. Fengrong, "A Survey on Research of Code Comment" in Proceedings of the 2019 3rd International Conference on Management Engineering Software Engineering and Service Sciences(ICMSS 2019), New York, NY, USA:Association for Computing Machinery, pp. 45-51.
[11] X. Song, H. Sun, X. Wang and J. Yan, "A Survey of Automatic Generation of Source Code Comments: Algorithms and Techniques," in IEEE Access, vol. 7, pp. 111411-111428, 2019, doi: 10.1109/ACCESS.2019.2931579.
[12] C. Zhang, J. Wang, Q. Zhou, T. Xu, K. Tang, H. Gui, et al., "A survey of automatic source code summarization", Symmetry, vol. 14, no. 3, pp. 471, 2022.
[13] X. Xia, L. Bao, D. Lo, Z. Xing, A. E. Hassan and S. Li, "Measuring Program Comprehension: A Large-Scale Field Study with Professionals," in IEEE Transactions on Software Engineering, vol. 44, no. 10, pp. 951-976, 1 Oct. 2018, doi: 10.1109/TSE.2017.2734091.
[14] A. J. Ko, et al., “An exploratory study of how developers seek, relate, and collect relevant information during software maintenance tasks,” IEEE Trans. Softw. Eng., vol. 32, no. 12, pp. 971–987, Dec. 2006.
[15] R. Minelli, A. Mocci, and M. Lanza, “I know what you did last summer—an investigation of how developers spend their time,” in Proc. 23rd IEEE Int. Conf. Program Comprehension, 2015, pp. 25–35.
[16] “Code Commenting: Common Mistakes and Their Solutions and Tools!” [Online]. Available: https://www.linkedin.com/pulse/code-commenting-common-mistakes-solutions-tools-knowlio/. [Accessed 12 6 2024]
[17] “Best practices for writing code comments” [Online]. Available: https://stackoverflow.blog/2021/12/23/best-practices-for-writing-code-comments/. [Accessed 12 6 2024]
[18] “MongoDB” [Online]. Available: https://www.mongodb.com/. [Accessed 12 6 2024]
[19] “Gitamine” [Online]. Available: https://github.com/pvigier/gitamine [Accessed 12 6 2024]
[20] “Levenshtein distance” [Online] Available: https://en.wikipedia.org/wiki/Levenshtein_distance [Accessed 12 6 2024]
[21] “VSCode” [Online] Available: https://code.visualstudio.com/docs [Accessed 29 6 2024]