Using Stereotypes in the Automatic Generation of Natural Language Summaries for C++ Methods — Natalia Dragan

Program comprehension is hard, and comments can be outdated. Nothing new there 🙂

So wouldn’t it be nice it we’d have a tool that generated documentation from code? Previous approaches have applied NLP (part-of-speech) analysis on identifiers, but Natalia takes a different approach: static analysis, using her previous work on method stereotypes.

Based on these stereotypes (like getter and setters) we can determine the role of a certain method, and generate a natural language description based on the type of method, using templates.

These stereotypes were defined:

20151001_140847

If we know code is of a certain stereotype, we can generate a comment based on the template:

20151001_141016