html5-img
1 / 24

Masters Project

Masters Project. Reverse Engineering state machine diagrams from C/C++ code Vanderlande Industries B.V. (Veghel) Dennie van Zeeland. Outline. Introduction Vanderlande Industries FSC Project goal Tools CPP2XMI Approach Extensions / Improvements Problems. Introduction (1).

nibaw
Download Presentation

Masters Project

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Masters Project Reverse Engineering state machine diagrams from C/C++ code Vanderlande Industries B.V. (Veghel) Dennie van Zeeland

  2. Outline • Introduction • Vanderlande Industries • FSC • Project goal • Tools • CPP2XMI • Approach • Extensions / Improvements • Problems

  3. Introduction (1) Vanderlande Industries (VI) Veghel, near A50 Automated material handling systems: distribution centres Nike, Friesche Vlag, Amazon.de, Audi FALCON project by ESI, VI, 3TU (SET) baggage handling at airports Eindhoven Airport, Schiphol, Heathrow (T5), Honk Kong I.A. express parcel sortation facilities DHL, DPD, TNT Express Worldwide, UPS, Integra2 (Madrid)

  4. Introduction (2) Flow System Controller (FSC) Controls the product flows in conveyor systems for transport and sortation Controls all motors, photocells and other active components Send and receive control and status information Realtime Control of equipment Separated GUI Standard interfaces with equipment Fully configurable for all VI sorting equipment

  5. Introduction (3) Flow System Controller

  6. Introduction (4) Flow System Controller

  7. Introduction (5) Flow System Controller

  8. Project goal (1) • Reverse Engineering documentation from C/C++ source code • Why: • Limited documentation available for V5/V6 • V7 is being developed from scratch • Extracting dynamic behavior from source code for V7 • Identifying requirements • Identifying possible flaws in current versions • What kind of documentation • UML models • Class diagrams • Sequence diagrams • Activity diagrams • State machine diagrams • Sparse amount of documentation available • Engineering manual • Description of components

  9. Project goal (2) Reverse Engineering documentation from C/C++ source code Investigating current state of the art tools Extracting State Machine diagrams from code (main focus) Preprocessing source code Parsing source code Finding patterns in source code of state machines Creating diagrams Extracting Class diagrams from code (if time left)

  10. Tools • No tools are applicable to FSC • FSC is written in object oriented C • Current tools only work on C++ • No tools are available for state machine extraction • current tool is very specific for FSC (thus not generally applicable for any software system) • No complete state machine can be extracted • Cpp2XMI • LaQuSo (Laboratory for Quality Software) • C++ to UML-diagrams • Class diagram • Sequence diagram • Activity diagram

  11. Abstract Syntax Tree in XML-format CPP2XMI Class Diagram in XML (XMI)-format Class, Sequence, Activity Diagram in XML (XMI)-format

  12. CPP2XMI

  13. Approach Implement a simple state machine extractor for FSC Find 1 specific pattern Integrate state machine extractor into CPP2XMI Create 2nd parser for CPPML Storage in internal data structures State Machine organizer Adding layout (position information) XMI writer / DOT writer Extending with extra patterns Proof of concept on source code of a component of FSC

  14. CPP2XMI X Could be improved

  15. Example

  16. Example

  17. Extensions / Improvements to CPP2XMI Done: Implemented a state machine extractor for FSC 2nd parser for CPPML Internal data structures storage system Database storage State Machine organizer Layout / position information XMI writer DOT writer (integration of Graphviz toolset) Improved command line options Implemented a GUI Updated old CPP2XMI to support Java Generics

  18. Examples extracted from FSC (V6)

  19. Examples extracted from FSC (V6)

  20. Examples extracted from FSC (V6)

  21. Extensions / Improvements to CPP2XMI To do: Find more false negatives and their corresponding patterns, implement those. Add more information to state transitions (conditional state transitions) Map overlapping states and transitions Write documentation Apply tool to V5 / V6

  22. Extensions / Improvements to CPP2XMI Further improvements to CPP2XMI Create class diagram from Objective C basic idea: Find patterns Make a classification system Based on this classification, determine the classes, methods and attributes Make diagrams XMI conversion Improve performance issues (due to choice of parser)

  23. Problems encountered Preprocessing issues Columbus Parser doesn’t understand anonymous structs/enums CPPML should have a tree-structure (1 on 1 with AST) However it’s a DAG, which makes pattern recognition is tricky CPP2XMI doesn’t extract controlstatements (do, while, if, switch break, continue, etc.) correctly (for C) Performance issues with CPPML parser JDOM (Memory peak level: 1,8GB) SAX (will not solve memory peaks) Bug in XMI-part Duplicate id’s, which raises errors when importing XMI into case-tools (Enterprise Architect) Position information not part of XMI Enterprise Architect doesn’t do anything with position information

  24. Questions?

More Related