Can I apply UML diagrams in generating an english pseudocode format of a source code?

New thesis focus on reverse engineering a source code back to its pseudocode. I’m thinking of utilising UML tools to achieve this. The framework basically will be:

source code -> UML diagram -> english pseudocode

i’m certain that the source code -> UML is possible. But how about UML -> english pseudocode?

  1. I’m not sure this is useful.
    You’re going from a formal language to an informal one, via a graphical representation (likely serialized in another formal language — XML).

    Certainly you could reverse engineer source code from C++, and then generate code in Java, so that’s really not a problem converting from one language to another.

    All you need to do is create a formal definition for your Pseudocode and install it as another language.

    I still don’t see why this would useful.

  2. You can use an action language to describe what you want each operation to perform.

    The basic concept is that you use a subset of higher order languages that are the same. For example, C/C++ and Java both use ++ as an increment operator, so you can use it. Personally, I don’t think this is a very good way to go. Why limit yourself?

    My suggestion is that you use a UML modeling tool that supports generating the code directly from the model. The best example I know of is Rhapsody (you can download a 30 day copy from http://modeling.telelogic.com). Within the implementation tab, you type in your code — or in your case, your pseudo-code as comments.

    In my not-so-humble-opinion, UML is a better representation than pseudo code. With UML, you get structural, interaction and behavioral views. With pseudo code, you only get behavioral information. Furthermore, UML is graphical and most engineers/computer scientists are visual people. Psuedo code is text based and not as quickly understood by developers.

Leave a Comment