There are software development environments where each activity (analysis, design, coding, documentation, testing...) is supported and sometimes enforced. Such environments manage the relationships between the modules documents and test files and insure the that they are kept in synchrony. Nonetheless, they often lack the flexibility of simpler organizations.
The term literate programming is associated with an organization where the documentation is part of the program; a subset of the comments in and code in the program are automatically extracted and included in the documentation. Thus, whenever the program is modified, the relevant comments should also be updated. An updated documentation can then be extracted automatically.
Donald Knuth included documentation in the TeX program. Tools would use the documented program to produce a printed book with the typeset annotated program listing and to produce the Pascal source code. Greg Nelson developed a tool to extract the documentation from Modula-3 interfaces. The extracted interface documentation may then be included as sections of a larger document describing a whole library or program.