Using NLP and AI to Enhance Software Documentation and Code Comprehension

Authors

  • Abdulmalik Ibrahim School of Mathematical and Computer Sciences, Heriot-Watt University, Edinburgh, Scotland Email: ibrahimmalik85@gmail.com
  • Muhammad Baryal Department of Computer Science, Kohat University of Science and Technology (KUST) (Hangu Campus), Pakistan Email: baryalkhan2060@gmail.com
  • Asad Ullah Department of Computer Science, Kohat University of Science and Technology (KUST) (Hangu Campus), Pakistan Email: asadbangash2060@gmail.com
  • Muhammad Shoaib Department of Computer Science, University of Haripur, Email: shoaibnazir944@gmail.com
  • Muhammad Ghayas Khan Department of Business Administration, International Islamic University Islamabad (IIUI) Email: ghayas1012@gmail.com

DOI:

https://doi.org/10.63163/jpehss.v3i2.292

Abstract

Software documentation plays a critical role in code comprehension, maintenance, and collaboration, yet it is often incomplete, outdated, or inconsistently written. This study explores the application of Artificial Intelligence (AI) and Natural Language Processing (NLP) techniques to automatically generate accurate and context-aware documentation for software code. Leveraging transformer-based models such as CodeT5, GraphCodeBERT, and GPT-3, we developed and evaluated a system capable of producing meaningful summaries of code functions and classes. A comparative analysis between human-written and AI-generated documentation was conducted using both quantitative metrics (BLEU, ROUGE, F1) and qualitative feedback from professional developers. The results indicate that AI-generated documentation significantly improves code readability and developer efficiency, reducing comprehension time and enhancing accuracy in understanding complex code. Additionally, real-time integration of the tool within development environments proved beneficial for continuous documentation support. While AI still faces challenges in handling domain-specific code and interpreting poorly written segments, the overall impact on documentation quality is substantial. This research underscores the potential of NLP-driven tools to automate and standardize documentation practices, offering a scalable solution to one of software engineering’s longstanding challenges. Future work aims to integrate context-awareness, multilingual support, and interactive querying features to further enhance developer experience.

Downloads

Published

2025-04-25

How to Cite

Abdulmalik Ibrahim, Muhammad Baryal, Asad Ullah, Muhammad Shoaib, & Muhammad Ghayas Khan. (2025). Using NLP and AI to Enhance Software Documentation and Code Comprehension. Physical Education, Health and Social Sciences, 3(2), 45–55. https://doi.org/10.63163/jpehss.v3i2.292