uml based automated code generation ieee computer society phoenix n.
Skip this Video
Loading SlideShow in 5 Seconds..
UML Based Automated Code Generation IEEE Computer Society Phoenix PowerPoint Presentation
Download Presentation
UML Based Automated Code Generation IEEE Computer Society Phoenix

Loading in 2 Seconds...

play fullscreen
1 / 27

UML Based Automated Code Generation IEEE Computer Society Phoenix - PowerPoint PPT Presentation

  • Uploaded on

UML Based Automated Code Generation IEEE Computer Society Phoenix. Haseeb Ahmed Motorola Inc. November 7, 2007. Agenda. UML and Modeling Auto-Coding Unifying Modeling & Auto-Code Generation Applicability. Demonstration with Telelogic’s Tau G2. Open Forum. UML and Modeling. Why UML?

I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
Download Presentation

PowerPoint Slideshow about 'UML Based Automated Code Generation IEEE Computer Society Phoenix' - oakes

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.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.

- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
uml based automated code generation ieee computer society phoenix

UML Based Automated Code GenerationIEEE Computer Society Phoenix

Haseeb Ahmed

Motorola Inc.

November 7, 2007

  • UML and Modeling
  • Auto-Coding
  • Unifying Modeling & Auto-Code Generation
  • Applicability.
  • Demonstration with Telelogic’s Tau G2.
  • Open Forum
uml and modeling
UML and Modeling
  • Why UML?
    • Late 80s and early 90s saw a quantum leap in software development (and revenues).
    • Industry needed a Standardized view of representation.
    • Answer: The Unified Modeling Language
uml simply put
UML – Simply put…
  • Served as a unifying ‘language’ for software.
    • Standardized
    • Agnostic to platform, OS and programming language
  • The ‘Language’ consisted of pictorial representations for various software artifacts:
    • Classes
    • State Machines
    • Sequence Diagrams
    • An excellent reference:
      • The Unified Modeling Language -
uml in pictures use cases
UML in Pictures: Use Cases


uml in pictures class diagrams
UML in Pictures: Class Diagrams


uml in pictures state chart diagram
UML in Pictures: State Chart Diagram


uml in pictures architecture diagram
UML in Pictures: Architecture Diagram


uml in pictures sequence diagrams
UML in Pictures: Sequence Diagrams


  • More precisely: ‘Model Driven Architecture’.
  • Definition: A representation that focuses on the functionality and behavior of an application (or system) and is agnostic to the underlying platform, OS or programming language used.
  • This is really a tall order given the spectrum of choices for platforms, OSs and languages today!
  • For this presentation, I’ll limit myself to Modeling with UML.
  • In practice, modeling relies on UML for abstracting everything from a small application to a complex system.
    • A typical Model may consists of:
      • Classes, Objects Diagrams
      • State Machine Diagrams
      • Sequence/Activity Diagrams
      • Architecture Diagrams
      • Deployment Diagrams
      • … even Use Cases
  • Typically, a software engineer will use a GUI or CASE tool to represent the application or system.
  • The tool largely facilitates this by enforcing sanity of the application or system design.
    • For example:
      • Verifying valid state transitions
      • Automating message transmission and reception
  • UML is a natural fit.
uml modeling
UML+Modeling = ?
  • Once an application or system is fully modeled in UML, the next self-evident step is to generate the source code.
  • Also known as…
  • Most modern modeling tools provide this capability ‘built-in’.

Auto-Code Generation!

auto coding
  • Strictly speaking: ‘Automated Code Generation’
  • Definition: A way to automagically synthesize code for an application or system from a model, following UML and Modeling constructs.
modeling auto code generation a high level view

UML Modeling Tool

OS Platform

Modeling & Auto-Code Generation: A High Level View



1. Create UML Model

2. Model Sanity Checked




3. Auto-Code Generation

4. Source Code ‘Ready to Build’

5. Compile & Build into Application Binary

6. Application Binary executing on Target OS/Platform

auto coding the silent sidekick
Auto-Coding: The Silent Sidekick
  • Auto-coding not so new in software development.
  • Often used for things which are tedious and repetitive, e.g.;
    • Generating ASN.1 code.
    • Lex/YACC/Bison suite of tools for generating customized code for Unix based platforms.
  • Usage generally ‘invisible’ because the auto-coding syntax used is quite cryptic and not very exciting to the broader engineering community.
auto coding unleashed
Auto-Coding: Unleashed
  • With higher level abstractions (UML, Modeling etc.) available, auto-coding can now generate full applications.
  • From the 50,000 ft Level:
  • However, tool offerings may be more or less compliant than what you would expect.

C/C++ : Assembly Code :: Modeling : Handwritten Code

auto coding unleashed1
Auto-Coding: Unleashed
  • Many UML Model artifacts are just what we expect:
    • UML Class  C++ Class/C Structure
    • UML Operation  C/C++ Function
  • Some are a bit more abstract:
    • UML Signals  C/C++ Function calls.
      • Think Callbacks for Input Signals and Function calls for Outbound signals.
auto coding unleashed2
Auto-Coding: Unleashed
  • And some may be surprising:
    • Item widget[45]

 May Generate a simple Array of 45 elements.

 May Generate a Linked List of 45 ‘Item’ nodes each with 1 widget.

    • Timers

 Set/Expire implementation based on tool and code generator.

 Timer ticks or TimeOfDay()

auto coding challenges
Auto-Coding: Challenges
  • This brings new challenges and concerns:
    • Performance of the generated code.
    • Perfection of generated code to model.
      • Accurate conversion of model to code?
    • Implementation quirks:
      • Auto-code generation is not standardized.
      • Remember the ‘Agnostic to the platform, OS and language’ requirement – what is the cost of portability?
    • Hard to compete (read: beat) hand written code in the short term.
modeling auto code key benefits

Higher Level Modeling emphasizes Design & Architectural Discipline.


  • Many Tools provide built-in simulators.
      • Execute the Model to see how it flows right from your Desktop.
      • Rapid Prototyping possible for feature rich models.


  • Auto-coding follows a set of rules for generating code.
  • Quality is consistent.
    • Avoids some egregious human errors (e.g., null pointers).


  • Cycle Time Reduction
    • Cost of Poor Quality Containment
    • (Hopefully) Better Software Design & Architecture.


Modeling & Auto-Code Key Benefits
  • Well suited for Applications which lend nicely to State Machine Architectures.
  • Protocols – Network, Telephony… Request/Reply, Transactional.
  • Simulation
  • Rapid Prototyping

Picture Source:

  • UML and Object Oriented Design: They are not the same.
  • In Modeling, easy to make big mistakes. (mostly easy to correct too, but not always!)
  • Auto-coding best when it’s impacts are invisible.
  • Performance and Portability must be carefully weighed.
  • Tool: Telelogic’s Tau G2.
  • Example:
      • Construction of a request/response system within a non-trivial model.
  • Miscellaneous:
      • Highlight the simulation capabilities.
      • Injection of messages, auto generation of sequence diagrams.
tau g2 app architecture
Tau G2 App. Architecture

Middleware ‘glue’ for specialized services.

Application plus Tau G2 ‘kernel’

The Application/System




UML Model

Auto Generated Code

Middleware Services

Operating System

Middleware to Interface generated code with custom libraries.

The ‘environment’

  • The Unified Modeling Language -
  • Tau G2 – Telelogic –
  • The Object Management Group -
  • Automatic Code Generation from Design Patterns -
  • UML Forum (Modeling Tool Comparisons) -