Miscellaneous notes on the steps for code reading utilizing AI.
While it would be good to have some creativity in the prompts, I will summarize just the process.
Steps
1. Review the Overall Code and Key Parts
Use prompts to review the overall code and identify the key parts to read.
At this time, utilize README files, other documents, and tools (like call graphs) to confirm that your understanding of the overall picture is generally correct.
It’s also good to check the data structures and sequences.
2. Create a Procedure Document
Request the creation of a code reading procedure document using prompts.
Make sure to tailor it to the purpose of the code reading.
At a minimum, it’s good to have the order of reading the code and a checklist. If the amount is small enough to read in a short time, a checklist may not be necessary, but if it takes time, having a simple checklist for progress management can help dump your working memory, making it convenient.
3. Read the Code According to the Procedure Document
Read the code according to the procedure document.
While reading the code, it’s good to take notes on the key points, so prepare a file in a suitable format to take meaningful notes. Summarizing what you asked the AI in these notes can greatly reduce the effort of note-taking, allowing you to focus on reading the code.
Additionally, since you may find areas for improvement during code reading, it’s good to note those as well.
Summary
Efficiently perform the following using AI:
- Grasp the overall picture
- Create various documents
- Code reading procedure document (order of reading, checklist)
- Code reading notes
- Improvement notes
If a deeper understanding is required, it’s also good to create documents like the structure of my system's specification.