Abstraction and dynamic analysis for the reconstruction of scenario diagrams
This presentation is the property of its rightful owner.
Sponsored Links
1 / 17

Abstraction and Dynamic Analysis for the Reconstruction of Scenario Diagrams PowerPoint PPT Presentation


  • 65 Views
  • Uploaded on
  • Presentation posted in: General

Abstraction and Dynamic Analysis for the Reconstruction of Scenario Diagrams. Bas Cornelissen Leon Moonen Arie van Deursen. Introduction. Scenario event from the user’s perspective Scenario diagram UML sequence diagram at the scenario level Long-term goal

Download Presentation

Abstraction and Dynamic Analysis for the Reconstruction of Scenario Diagrams

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


Abstraction and dynamic analysis for the reconstruction of scenario diagrams

Abstraction and Dynamic Analysis for the Reconstruction of Scenario Diagrams

Bas Cornelissen

Leon Moonen

Arie van Deursen


Introduction

Introduction

  • Scenario

    • event from the user’s perspective

  • Scenario diagram

    • UML sequence diagram at the scenario level

  • Long-term goal

    • e.g., conformance checking, design pattern detection, architecture reconstruction (?)


Challenges

Challenges

  • Static analysis

    • source code

    • independent of input

    • potentially covers all object interactions

  • Dynamic analysis

    • execution traces

    • scenario- and input-driven

    • polymorphism: detection of late binding

    • merely applicable in “complete”, executable systems


Challenges1

Challenges

  • Abstraction

    • typically, initial diagrams:

      • are too large

      • show too many details

      • contain uninteresting interactions

    • this calls for abstraction mechanisms

      • omit irrelevant messages and/or objects

      • allow user to choose the level of detail


Method

Method

  • Reconstruction of scenario diagrams using JUnit and AspectJ

    • Scenario determination

    • Producing an execution trace

    • Abstraction

    • Visualization


Running example

Running example

  • Pacman

    • 25 Java classes

    • GUI

    • Large traces

    • Polymorphism


1 scenario determination

1. Scenario determination

  • JUnit testcase

    • basically a use case

    • contains one or more scenarios

      public class PacmanTest extends TestCase {

      public PacmanTest(String arg0) {

      super(arg0);

      }

      public void testTopLevelAlphaOmega() throws InterruptedException {

      Pacman p = new Pacman();

      p.start();

      System.out.println("SCENARIO START");

      p.up();

      System.out.println("SCENARIO END");

      p.quit();

      p.exit();

      }

      }


2 producing a trace

2. Producing a trace

  • Aspect for tracing methods and constructors

    • exclusion of certain classes and/or methods

    • distinction between run-time objects

    • at call sites, log:

      • method/constructor ID

      • caller + object ID

      • callee + object ID

      • method/constructor signature

      • actual parameters

        METH 533: Pacman [1] :: Engine [2] ::

        public synchronized void Engine.movePlayer(int, int) :: 0, -1


3 abstraction

3. Abstraction

  • Compression

    • summarize recurring messages and patterns

    • requires pattern recognition

    • post-mortem

  • Pruning

    • hide uninteresting interactions (and objects)

    • define minimum and maximum stack depths

    • both at the tracing and the visualization stage


4 visualization

4. Visualization

  • GNU plotutils package

    • pic2plot

    • library containing pic macros for seq. diagrams

    • Perl script to create pic programs from traces

      object(Pacman1,"Pacman1");

      object(Engine2,"Engine2");

      object(Game3,"Game3");

      ...

      step();

      active(Pacman1);

      message(Pacman1,Engine2,"movePlayer(int, int)");

      active(Engine2);

      message(Engine2,Engine2,"inPlayingState()");

      message(Engine2,Game3,"initialized()");

      ...


Example 1

Example (1)

  • Compression


Example 2

Example (2)

  • Pruning


Example 3

Example (3)


Example 4

Example (4)


Conclusions 1

Conclusions (1)

  • JUnit testcases

    • enable scenario diagram reconstruction for both complete systems and incomplete systems/modules

  • AspectJ

    • flexible: allows for (not) tracing specific components and/or messages

    • distinguishes between run-time objects


Conclusions 2

Conclusions (2)

  • Effective abstraction mechanisms

    • human-readable, high-level model is easily obtained

    • though omission of messages at deep stacklevels may be infeasible

  • Better visualization is needed

    • interactive

    • e.g., zooming, expanding


Questions

Questions

Fire at will!


  • Login