Source Code Annotations for Automatic State Chart Generation

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Current reverse-engineering tools cannot automatically generate state chart diagrams from source code, which are essential for model-based testing, as they only create static class diagrams and lack the capability to model dynamic behavior.

Innovation Solution

The method involves adding annotations to the source code that reference program operations, which are then read and used by a modeling tool to automatically generate a state chart diagram, such as a UML state chart diagram, representing the dynamic behavior of the computer program.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Manufacturing precision

If manual modeling is used to create state chart diagrams, then the quality and precision of behavior patterns is improved, but the time and cost investment increases significantly

Engineering Contradiction:
Improveprecision of behavior patternVSAvoidtime investment
Core Design Contradiction:
Manufacturing precisionVSLoss of time

Solution Approach 1:

The patent applies preliminary action by annotating source code with behavioral information before model generation. The annotations are added during the coding phase, so that when reverse engineering is performed, the state chart diagram can be automatically generated from pre-prepared annotated code, eliminating the need for manual modeling while maintaining precision.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The patent introduces annotations as an intermediary element between source code and state chart diagrams. These annotations serve as a bridge that carries behavioral information from the code to the model, enabling automatic generation of accurate behavior patterns without manual intervention.

Inventive Principle:
Principle #24Intermediary (Mediator)

2Productivity

If reverse-engineering tools are used to automatically generate models from source code, then the time and cost are reduced, but only static class diagrams can be created and dynamic behavior cannot be modeled

Engineering Contradiction:
Improvemodel generation speedVSAvoidcapability to model dynamic behavior
Core Design Contradiction:
ProductivityVSAdaptability or versatility

Solution Approach 1:

The patent segments the information in source code by introducing annotations that specifically mark behavioral elements. This segmentation allows the reverse-engineering tool to extract only the relevant dynamic behavior information needed for state chart diagrams, while ignoring static structural information, thus enabling automatic generation of dynamic models.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

Annotations serve as an intermediary that enables reverse-engineering tools to capture dynamic behavior. The annotations carry specific metadata about program operations, states, and transitions, allowing automatic generation of state chart diagrams from annotated source code.

Inventive Principle:
Principle #24Intermediary (Mediator)

3Ease of manufacture

If no annotations are added to source code, then the source code remains clean and simple, but automatic generation of behavior patterns is not possible

Engineering Contradiction:
Improvesimplicity of source codeVSAvoidautomatic model generation capability
Core Design Contradiction:
Ease of manufactureVSExtent of automation

Solution Approach 1:

The patent treats annotations as disposable elements that serve their purpose during model generation and can be removed or ignored afterward. The annotations add minimal overhead to the source code while enabling automatic behavior pattern generation, and do not affect the actual program execution.

Inventive Principle:
Principle #27Cheap short-living objects (Disposable)

Solution Approach 2:

Annotations act as a temporary intermediary that facilitates automatic model generation without permanently complicating the source code. They provide the necessary information for reverse engineering while maintaining the original code's simplicity and readability.

Inventive Principle:
Principle #24Intermediary (Mediator)

Data Source

PatentUS8527954B2Method for automatically creating a behavior pattern of a computer program for model-based testing techniques
Publication Date: 2013.09.03 SAP SE
  • US8527954B2 patent drawing
  • US8527954B2 patent drawing
  • US8527954B2 patent drawing

AI summary

A method is provided for creating a behavior pattern of a computer program which comprises at least one source code with a plurality of program operations which are arranged in a logical succession and the source code is provided with annotations. Each annotation is referencing to a respective program operation and the annotations are read out automatically by a modeling tool, which is running on a processing unit and generating the behavior pattern of the computer program by arranging the annotations which have been read out according to the logical succession of the program operations and providing the generated behavior pattern, so that the generated behavior pattern can be represented via a representing unit. Furthermore, an appropriate server and an appropriate network system are provided.