1 / 17

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. Scenario event from the user’s perspective Scenario diagram UML sequence diagram at the scenario level Long-term goal

ryu
Télécharger la présentation

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. 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. Abstraction and Dynamic Analysis for the Reconstruction of Scenario Diagrams Bas Cornelissen Leon Moonen Arie van Deursen

  2. 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 (?)

  3. 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

  4. 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

  5. Method • Reconstruction of scenario diagrams using JUnit and AspectJ • Scenario determination • Producing an execution trace • Abstraction • Visualization

  6. Running example • Pacman • 25 Java classes • GUI • Large traces • Polymorphism

  7. 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(); } }

  8. 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

  9. 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

  10. 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()"); ...

  11. Example (1) • Compression

  12. Example (2) • Pruning

  13. Example (3)

  14. Example (4)

  15. 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

  16. 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

  17. Questions Fire at will!

More Related