Automated Generation of Functional Specifications

FunSpec is an html document containing a nicely formatted functional specification of a project. (See OOA lecture notes for some suggestions on how functional specifications should be formatted.)

It uses Java Script and JQuery to extract project details from a Star UML 2 (.mdj) file.

You may assume StarUML 2 is used to create a project containing a single use case model. Also assume the documentation property of each element describes important information about the element.

Notes:

Star UML 2 files contain a single JSON object. See StarUML for details.

It would be nice if your script could include the use case diagram. The easy way to do this is to assume the user has exported the diagram as a .jpeg file with a standard name. A better solution would be to figure out how to generate the jpeg from the diagram element in the JSON object. Star UML does it, so we should be able to figure it out.

Your FunSpec.html should work with any StarUML file meeting the above requirements. Only the name of the file should need to be changed in FunSpec.html.

Links:

FunSpec.html (Just a partial demo)

atm.mdj (My test model)

tools.js (Some functions I created)

 

MDJ

Here's the diagram in atm.mdj:

atm.mdj contains a single JSON object representing the ATM project:

{
   "_type": "Project",
   "_id": "AAAAAAFF+h6SjaM2Hec=",
   "name": "ATM",
   "ownedElements": [...]
}

Owned elements is an array containing JSON objects representing project elements.

In atm.mdj this array contains a single object representing the use case model:

{
   "_type": "UMLModel",
   "_id": "AAAAAAFPx+8z7B+lASs=",
   "_parent": {"$ref": "AAAAAAFF+h6SjaM2Hec="},
   "name": "requirements",
   "ownedElements": [...]
}

Notice that the parent element is an object containing a reference to the project's id.

All MDJ objects have the same basic format:



Some elements may have additional fields such as visibility, multiplicity, isAbstract, etc.

The elements owned by the model include a large element representing the use case diagram. Near the bottom of the file are elements representing use cases and other model elements. For example: CheckBalance.