Doxygen Flavor for Structure 101g

Similar documents
net.betterdeveloper.understand/flavor/for/ Structure/101g/

XBMC. Ultimate Guide. HenryFord 3/31/2011. Feel free to share this document with everybody!

DiskSavvy Disk Space Analyzer. DiskSavvy DISK SPACE ANALYZER. User Manual. Version Dec Flexense Ltd.

CaptainCasa Enterprise Client. CaptainCasa Enterprise Client. CaptainCasa & Java Server Faces

VCGL software quality sessions: Documenting with. Anatoliy Antonov May 2012

Week - 01 Lecture - 04 Downloading and installing Python

MITOCW MIT6_01SC_rec2_300k.mp4

MarkLogic Server. Content Processing Framework Guide. MarkLogic 9 May, Copyright 2018 MarkLogic Corporation. All rights reserved.

Eclipse Environment Setup

Lesson 3 Transcript: Part 1 of 2 - Tools & Scripting

CSE 12 Abstract Syntax Trees

Hi everyone. Starting this week I'm going to make a couple tweaks to how section is run. The first thing is that I'm going to go over all the slides

DATA STRUCTURE AND ALGORITHM USING PYTHON

Using Doxygen to Create Xcode Documentation Sets

Sucuri Webinar Q&A HOW TO IDENTIFY AND FIX A HACKED WORDPRESS WEBSITE. Ben Martin - Remediation Team Lead

Switching Circuits and Logic Design Prof. Indranil Sengupta Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur

Java GUI Testing Tools

CS664 Compiler Theory and Design LIU 1 of 16 ANTLR. Christopher League* 17 February Figure 1: ANTLR plugin installer

And FlexCel is much more than just an API to read or write xls files. On a high level view, FlexCel contains:

Binary Trees

Week - 04 Lecture - 01 Merge Sort. (Refer Slide Time: 00:02)

Using X-Particles with Team Render

Chapter 1 Getting Started

DiskBoss DATA MANAGEMENT

Essbase Installation Tutorial Tim Tow, President and Oracle ACE Director. Applied OLAP, Inc

Doxygen A source documentation tool.

LHCb Conditions Database Graphical User Interface

Project Title REPRESENTATION OF ELECTRICAL NETWORK USING GOOGLE MAP API. Submitted by: Submitted to: SEMANTA RAJ NEUPANE, Research Assistant,

Schema Objects Has Its Own Namespace In Oracle

MITOCW watch?v=0jljzrnhwoi

Week - 03 Lecture - 18 Recursion. For the last lecture of this week, we will look at recursive functions. (Refer Slide Time: 00:05)

Hi everyone. I hope everyone had a good Fourth of July. Today we're going to be covering graph search. Now, whenever we bring up graph algorithms, we

StreamServe Persuasion SP5 XMLIN

CSE 401/M501 Compilers

DupScout DUPLICATE FILES FINDER

Visual Streamline FAQ

CREDIT and CC. Version 3.5

Business Club. Decision Trees

The Connector. Version 1.2 Microsoft Project to Atlassian JIRA Connectivity. User Manual

DiskPulse DISK CHANGE MONITOR

Reading How the Web Works

Getting started with R-Tag Viewer and Scheduler (R-Tag Report Manager)

The main differences with other open source reporting solutions such as JasperReports or mondrian are:

WPS Workbench. user guide. "To help guide you through using the WPS user interface (Workbench) to create, edit and run programs"

CSE Theory of Computing Spring 2018 Project 2-Finite Automata

MARKING KEY The University of British Columbia MARKING KEY Computer Science 260 Midterm #2 Examination 12:30 noon, Thursday, March 15, 2012

Data Feeds Traffic Setup Instructions

Programming in C++ Prof. Partha Pratim Das Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur

Arduino IDE Friday, 26 October 2018

Creating Pages with the CivicPlus System

HPE Security Fortify Plugins for Eclipse Software Version: Installation and Usage Guide

CSE Theory of Computing Spring 2018 Project 2-Finite Automata

MAVEN INTERVIEW QUESTIONS

AADL Graphical Editor Design

Quick Web Development using JDeveloper 10g

Etasoft Mini Translator version 1.x

Below is an example workflow of file inventorying at the American Geographical Society Library at UWM Libraries.

Intro to Programming. Unit 7. What is Programming? What is Programming? Intro to Programming

The Extensible Markup Language (XML) and Java technology are natural partners in helping developers exchange data and programs across the Internet.

DiskBoss DATA MANAGEMENT

Biocomputing II Coursework guidance

CS164: Midterm I. Fall 2003

Microsoft Access Database How to Import/Link Data

Data Crow Version 2.0

sqamethods Approach to Building Testing Automation Systems

The tracing tool in SQL-Hero tries to deal with the following weaknesses found in the out-of-the-box SQL Profiler tool:

IBM TRIRIGA Application Platform Version 3 Release 4.2. Object Migration User Guide

Adam Huječek NSWI126

CSE Theory of Computing Fall 2017 Project 3: K-tape Turing Machine

What is Standard APEX? TOOLBOX FLAT DESIGN CARTOON PEOPLE

Introduction to Software Engineering: Tools and Environments. Session 9. Oded Lachish

6.001 Notes: Section 31.1

PATH FINDING AND GRAPH TRAVERSAL

Data Structures (list, dictionary, tuples, sets, strings)

The first program: Little Crab

Managing Application Configuration Data with CIM

Graphics Performance Benchmarking Framework ATI. Presented to: Jerry Howard. By: Drew Roberts, Nicholas Tower, Jason Underhill

Anchovy User Guide. Copyright Maxprograms

CSE Theory of Computing Fall 2017 Project 1-SAT Solving

How to build Simbody 2.2 from source on Windows

Chrome if I want to. What that should do, is have my specifications run against four different instances of Chrome, in parallel.

CSE Theory of Computing Fall 2017 Project 4-Combinator Project

Implementing Some Foundations for a Computer-Grounded AI

H2 Spring B. We can abstract out the interactions and policy points from DoDAF operational views

Design issues in XML formats

Module Road Map. 7. Version Control with Subversion Introduction Terminology

Teiid Designer User Guide 7.5.0

Frequently Asked Questions about POJO Cache

Overview of OOP. Dr. Zhang COSC 1436 Summer, /18/2017

Embedding Python in Your C Programs

Custom Fields With Virtuemart 2. Simple Custom Fields. Creating a Custom Field Type

printf( Please enter another number: ); scanf( %d, &num2);

Confuse. Release 0.1.0

Project Management System

DOING MORE WITH EXCEL: MICROSOFT OFFICE 2010

Language Basics. /* The NUMBER GAME - User tries to guess a number between 1 and 10 */ /* Generate a random number between 1 and 10 */

DiskBoss DATA MANAGEMENT

XNA Tutorials Utah State University Association for Computing Machinery XNA Special Interest Group RB Whitaker 21 December 2007

Why are there so many programming languages? Why do we have programming languages? What is a language for? What makes a language successful?

Principle of Complier Design Prof. Y. N. Srikant Department of Computer Science and Automation Indian Institute of Science, Bangalore

Transcription:

Doxygen Flavor for Structure 101g By Marcio Marchini (marcio.marchini@gmail.com) 2012/01/05 1) What is the Doxygen Flavor for Structure101g? This is a sort of a plugin for Structure 101g (called a flavor). It allows you to get XML files produced by Doxygen (from a software project's source code) and load that representation into Structure 101g. This flavor will convert the Doxygen XMLs into a single XML file that can be loaded into Structure 101g. The conversion is done from a command-line tool, Doxygen2Structure101g. It's as simple as that. But, as they say, the devil is in the datails... 2) Motivation to Create the Doxygen Flavor for Structure101g This flavor was created due to a need to look at large legacy C++ code bases, and figure out their overall architecture and plan strategies to refactor & improve their designs. More specifically, we were interested in DSM support at an affordable price (think budgets for small teams in small companies or companies in BRIC countries as opposed to North America). Both Lattix/LDM and Structure101/C++ are excellent tools, but for a different league, out of reach of the solo developer or of small start-ups in BRIC countries and similar. 3) Languages Supported In theory this flavor should support all the languages that Doxygen supports. In practice, we have been focusing on C/C++, Java, and.net. We run Doxygen on Open Source projects in these languages and make sure we are properly parsing all tags used by Doxygen. If you hit upon any limitation in our converter, please contact us and we will make sure it properly parses whatever it may be that we are missing. As for Python, we ran it quickly on the source code for TRAC and some dependencies are shown, but we aren't sure if Doxygen can capture them all. Feel free to contact us if you are interested in Python analysis and can help Doxygen improve its Python parsing capabilities. The same goes for PHP. Many dependencies are not captured by Doxygen's fuzzy parser, unfortunately.

4) Limitations of The Flavor First and foremost, this flavor is limited to the same precision as you get from Doxygen itself. Generate HML output from Doxygen and make sure that Doxygen itself is correctly picking up your dependencies and elements. Keep in mind that Doxygen is a sort of a fuzzy parser and not a real compiler. It will miss things, it will mix things, and it will drop things. An interesting example we had was a project that was using SQLite and also PostgreSQL. Both libraries have two completely different structs with the same name (Trigger). Doxygen's output generated a single struct that was a mix of the two. Needless to say this caused all sorts of false dependencies. For this reason alone we have added the capability of dropping particular dependencies in your dependency graph. It allows you to override Doxygen's limitations when you hit them (and believe me, you will hit them for any real project). That's why we added -blacklist.you can also drop entities or dependency types, allowing you to keep just file includes, for example. This will generate a fairly accurate initial view of the C++ system, for example. 5) Why Three Flavors, and Not Just One? This flavor started as a single one, com.sglebs.doxygen. But soon we hit upon an interesting limitation: in Structure 101g, a sub-module (compound in Doxygen parlance) can only belong to a single parent, via nesting of XML tags. But in Doxygen's representation a class belongs to both a file (which in turn belongs to a directory) and to a namespace (think a C++ namespace or a Java package) which may span across multiple directories. When generating the output, we had to choose a single parent container for a class either the namespace or the file. But which one? Since we did not want to hardcode the decision in Doxygen2Structure101g, we made it configurable via a command-line parameter: -rootorder. This is a comma-separated list of regexes (CSV of regexes) which defines the order of root containers to traverse when generating the output XML. Here one can give priority to a namespace view or to a filesystem view of the project. For example, passing namespace,dir,.* means that first the converter will give preference to output namespaces and classes they contain, then directories and elements they contain, and only then the rest (.* is a regex that matches anything). Therefore, if a Class belongs to both a file and to a namespace (in Doxygen's model), we will put it inside the namespace only (in the Structure 101g model that we generate). On the other hand, passing dir,namespace,.* will first generate directories and the elements they contain (files etc), and only then namespaces, and then the rest (.*). This means that if a Class belongs to both a file and to a namespace, it will appear as belonging only to the file in Structure 101g. In other words, the regex is a way to drive the mechanism that chooses a single parent/container for elements with multiple parents/containers, based on which one appears first in the CSV of regexes. The first parent to dump/traverse a child, becomes its sole parent in the Structure 101g's model. Although this solution was fairly simple and good, it still generated some bogus circular dependencies. There were references from an element in a file pointing into an element in a namespace, and vice-versa. Also, the metadata.xml file in a Doxygen 101g pretty much defines what sorts of elements can be containers or not. We also needed custom

metadata.xml files for the different views of a system (filesystem-based and namesacebased). This is why the 2 custom flavors were added: com.sglebs.doxygen.filesystem and com.sglebs.doxygen.namespace. In practice, you should use one of the newer two. We still leave the original com.sglebs.doxygen flavor in for investigation purposes in odd cases. 5.1) com.sglebs.doxygen.filesystem Use this flavor when you want to look at a system using a filesystem-based view. Directories represent modules, and the files are containers for classes. Lots of C and C++ projects fall into this category, as well as lots of PHP projects. 5.2) com.sglebs.doxygen.namespace Use this flavor when you look at a system/language that relies heavily on namespaces. Examples are Java (packages are the namespaces) and C#. Although C++ also has namespaces, they are not used as THE mechanism for modularity and componentization. We have found the namespace perspective mostly useless for C++, but you may find it useful for some specific C++ analysis. 6) How To Generate Doxygen XML Files for this Flavor First you should download and then run Doxywizard on your sources. You should make sure you run a version with proper support for UTF-8. We recommend running 1.7 or above. Proper support for UTF-8 can be seen in Expert, on the Project item on the left. When selected, you should see DOXYFILE_ENCODING as UTF-8, as in the screenshot below: We have identified a few extra tricks that will make you produce a better output for Structure 101g. The are: 6.1) Generate output with relative paths Set the working directory to be the directory where the source files are, and set the source file directory to be.. Also, enable the scan recursively flag. The screenshot below shows an example, running it on carnamock.

6.2) All Entities, not just Documented Entities Make sure to enable Doxygen to extract dependency information for all elements in your source code, and not just the elements that have been documented with Doxygensupported comments. The screenshot below shows how.

Extra Dependencies Note that for even more advanced, in-depth dependency capturing, you should also enable Doxygen's EXTRACT_PRIVATE and EXTRACT_STATIC in the Expert tab. This can be seen in red in the next screenshot.

6.3) XML output (HTML is not needed, but useful for sanity checking) You need to generate XML output. The other formats are not needed. In cases where you want to double check if Doxygen is generating bogus dependencies, you should check the HTML output. The screenshot below shows how to generate the XMLs (and also enables the optional HTML output).

Also, make sure you exclude Program Listing. Sometimes the source code will have binary characters (HEX FF) in the markup, making the XML Parser trip and we end up losing important semantic information. To avoid hours of chasing a bogus output, please disable program listing as below (Expert Tab, under XML):

6.4) You want Call Graphs, etc The bodies of functions and methods will call (depend on) other functions, methods and classes. This dependency only appears in the output if you explicitly ask Doxygen to generate these dependencies. Unfortunately Doxywizard only allows you to generate these extra dependency tags if you enable the use of Graphviz's dot tool. The problem is that using Graphviz will slow down the Doxygen XML generation way too much. Fortunately there is a trick you can use: enable dot/graphviz, set the flags, and disable it again. Doxygen will still generate the dependency tags. The screenshot below shows the trick after the fact. Note how all but the called by graph are checked. This is how you want it. 6.5) Ready to Run Now you are ready to click the Run tab and click the Run doxygen button, as seen below.

Note that you can save a Doxyfile from the Doxywizard and use that for subsequent runs. You can also run Doxygen from the command-line using this Doxyfile as parameter, possibly from a Continuous Build System like Hudson etc. 7) Running the Flavor(s) on the XMLs from Doxygen There are 2 ways to run the converter from the Structure 101g's GUI or from the command-line. We recommend that you always run from the GUI, as running from the command-line is fairly advanced. 7.1) Running the com.sglebs.doxygen.filesystem Flavor from the GUI Initially you want to invoke File->New in Structure 101g, and choose Load on demand: as in the screenshot below:

By clicking next, you will be able to set some input values on the next screen. These are: Directory where you generated the XML files. There should be an index.xml in this dir. Dependencies to keep: leave the default value.* until you become an advanced user. This is a regex that filters what kind of dependencies you really want to capture from Doxygen. The types of dependencies are listed in metadata.xml of this flavor. Some values are: includes, extends, hasparam, etc. So, for example, if you just want to capture the dependencies of include files in your C++ project, you want to use the value includes. If you want to capture includes and also subclass relationships, you want to use includes extends. Use any regular expression to filter the possible values that you want to filter in. Entities to keep: leave the default value.* until you become an advanced user. This is a regex that filters what kind of entities you really want to capture from Doxygen. The types of entities are listed in metadata.xml of this flavor. So, for example, if you just want to capture the dependencies of include files in your C++ project, you want to capture just the file entities, and therefore you want to use the value file. Entities like classes, structs etc will be discarded in this case (producing a more compact DSM). Use any regular expression to filter the possible values that you want to filter in. Blacklist file: This should be a text file, containing multiple lines, each line defining a dependency you want to discard (filter out). Each line should have the format: SRCID:DESTID:DEPTYPE. In other words, it is a triple where the first value is the ID

of the element that is source of the dependency. The second value is the ID of the element that is the target of the dependency. The last value in the triple is the dependency type (the same ones we saw previously includes, extends, hasparam, etc). The screenshot below illustrates the values for loading the XML files produced for Carnamock. Click Finish. The conversion will happen and at the end you should be able, for example, to switch to the DSM perspective and see something like this:

As usual, you can drill down with Structure 101g and analyze individual modules / components (directories containing files, in a filesystem perspective). Here's an example inside Carnamock:

The architecture diagram should also work, as can be seen below (for Carnamock):

7.2) Running the com.sglebs.doxygen.namespace Flavor from the GUI Running the namespace flavor is very similar to running the filesystem flavor. First make sure you choose it appropriately:

Then you provide the input values just like with the filesystem flavor seen in 7.1. Here's an example of what we get when running it on the XML files produced by Doxygen on the Java source files for Ant:

7.3) Running any flavor from the console Each flavor directory comes with a copy of the Doxygen2Structure101g.exe file. If you run it without parameters, you will get something like this:

We highly recommend that you use the GUI wizard and use the little Copy command line link at the bottom/right of the Dialog. It will copy to the clipboard the full command-line used by the wizard behind the scenes. For instance, here's an example of what we used to run it on the Java Ant source files: C:\Users\marcio\structure101g\flavors\com.sglebs.doxygen.na mespace_1.0.7/doxygen2structure101g.exe -in "C:\Users\marcio\Doxygen-tests\apache-ant-1.8.1\src" - namespacemode pure -order namespace,class,dir,file,.* -out "C:\Users\marcio\AppData\Local\Temp\s101g_73734104210135545 21.tmp" -serial "C:\Users\marcio\structure101g\flavors\com.sglebs.doxygen.n amespace_1.0.7\dox2101g.lic" -keepdep.* -keepent.* - flavor com.sglebs.doxygen.namespace -silent -blacklist "C:\Users\marcio\Doxygen-tests\empty.txt" Try this approach different ways until you become familiar with the command-line options. Then you can invoke the executable on your own customizing the parameters as you want. Note that the serial value can be either theserial/license itself or a valid text file path containing the actual serial/license value. This is a key (serial) that you must obtain from us so you can run our converter on your PC. It is tied to your specific machine, unless we provided you with a TRIAL. Therefore, if the converter fails to run we ask that you send us your Machine ID. To obtain your Machine ID, run this from the console: Doxygen2Structure101g print This should print your machine. You should get an output similar to this: Machne ID: 48996 Invalid '-in' parameter - no index.xml found in inout dir passed (.)