Conditions:
- stable legacy prod system
- no Software Devs of the system are available anymore
- app is maintained by Engineers, who do not have the same software dev experience like the original Devs and almost none for that specific system
- there are issues requiring debugging of the code, and the remaining Engineers have to handle both the issues and the technical documentation maintenance
- not enough documentation usable for debugging and maintenance purposes of is available
- code repository is the only reliable source of technical documentation for this case
- only limited effort to improve documentation for this system is allowed (something like 80/20 rule)
- format of the solution needs to be as universal as possible so that it can also be applied to other projects with similar conditions, and possible to be used as a baseline and guideline, that only needs smaller adjustments specific to each case
- when solution is applied to a non-legacy system, it should still be sufficient, once it becomes legacy
- the amount of prep work before actually create or update the project documentation should be either minimal or none (so no setting up external documentation systems and the such)
Question:
What specific tools, practices, or methodologies that have been successfully implemented in similar legacy environments can be used to create and update technical documentation to be minimal yet effective, when limited by all of the above conditions?
So far the below is the best method I managed to come up with:
- Just start with the 1st source code file you have to touch and gradually go through each source code file to try to understand what it does
- apply the Scout Rule ("leave everything cleaner than you found it") like described in https://softwareengineering.stackexchange.com/a/137953/440463 AND put a header on top of each source code file like described in https://stackoverflow.com/a/49438334/3853744 (basically add a "table" with various metadata about the source code file written as a text on top of the file, containing among others creation date, description, affected, usage and parameters, summary of changes with time, author and comments)
- Put a README file in the top level directory of the code repo, which will inform how to navigate to find the technical documentation in that repo
- Put another txt file in each "major" directory of the code repo, where any other technical info is placed, if it does not belong to just one source code file header
- Since it is undesired to have long comments surrounding actual source code, use some sort of "KB1234" or "0x12345" numbers for the role of tags or labels in the text files and source code for each major component. It will allow to quickly find things that are related, for example with grep. These have to have a format that is unique enough that it does not generate too much incorrect finds
Background context, can be ignored if doesn't help with the answer.
You should not rely on links from source code to Jira or Confluence. After these have been migrated in our case from on-prem to cloud all links that were in source code have become broken. This made it extremely time consuming to find anything useful by hand because of reasons like for example the following: DependenciesCheck.sql should be called DoItAll.sql instead.
Since it is legacy, bringing the documentation in line with current trends and best practices is unfortunately not an option here as only limited effort will be allowed to be put into it, making the unfortunate reality that the source code repository is the only reliable place with any technical documentation for it, and potentially smallest effort as well.
My experience tells me that solution to this problem will continue to be applicable to most source code cases for a long time.
Update: Reformatted the text to improve clarity