1 / 34

Behavioral Models for Software Development

Behavioral Models for Software Development. Andrei Kirshin, Dolev Dotan, Alan Hartman January 2008. Abstract. MDD  r ai sing the level of abstraction , i ncrea sing the automation

Download Presentation

Behavioral Models for Software Development

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. Behavioral Models for Software Development Andrei Kirshin, Dolev Dotan, Alan Hartman January 2008

  2. Abstract • MDD  raising the level of abstraction,increasing the automation • Models and model transformations  increased productivity, quality, effective way of adapting to changes in requirements • This talk focuses on models which describe the behavior of the system, and the tools for executing at the model level • Platform independent action language

  3. Outline • Introduction • Motivation • UML Behavioral Modeling • Action Language • UML Model Debugger • Debugging capabilities • Debugging perspective • Diagram animation • Testing • Model testing • Model-based testing (test generation)

  4. Outline – Introduction • Introduction • Motivation • UML Behavioral Modeling • Action Language • UML Model Debugger • Debugging capabilities • Debugging perspective • Diagram animation • Testing • Model testing • Model-based testing (test generation)

  5. Introduction – Vision Time Tools Developers Abstraction • Variety & versatility of users: business analysts, architects, developers, testers • Components, services, • features, behaviors, • actions, patterns • Model level debugging • Model level testing • Support for AL • Static model analysis MDD Code Generation MD • Many highly qualified developers • Structures, operations, statements, • expressions, classes, interfaces, packages • 3GL level debugging, • 3GL testing tools, OOD Compiler RE • Few experts • Registers, • low level commands • Assembler, • Assembly debugger PD • PD – Procedural Development, RE – Reverse Engineering, MD – Model Discovery

  6. ModelingTool IDE CodeDebugger ModelDebugger ModelTransformation Compiler Behavioral Modeling Toolset Traditional Software Development Model DrivenDevelopment

  7. Model Debugger MDD and Model Debugger • Identify defects at a much higher level of abstraction, earlier in the development cycle ExecutableSpecification (e.g. code) Runtime Executable Model Execution Transformation

  8. Modeling with UML • Structure • Class (Class diagram) • Component (Composite structure diagram) • Behavior • State machine (state machine diagram) • Activity (activity diagram) • Interaction (sequence/communication diagram) • Action language (snippets of code in model)

  9. Features include: Behaviors for: transition effects, state entry, do, exit Composite states Nested state machines Concurrency (orthogonal states) Transition guards Conditionals (choice, junction) Integration with the Object Oriented Model: Effect/entry/do/exit behaviors… Guards… …can access class attributes, call class operations, etc. Triggers: Operation calls Attribute changes State Machines

  10. Activity Diagrams – “Sophisticated Flowcharts” Features include: • Control flow • Data flow • Conditionals (choice node, guards) • Concurrency (fork & join) • Nested behavior calls • Data stores Integration with the Object Oriented Model: • (“Opaque”) actions – code snippets… • Guard expressions… • …can access class attributes, call class operations, etc. • Actions for: • Calling operations • Reading and modifying attributes • Sending signals • and more…

  11. UML Behavioral Modeling • Structure: protocol, classes (capsules), ports and connectors • Behaviors (state machines, activities, interactions) • Stand-alone • Specify the implementation of operations • Specify the lifecycle of objects (capsules) • Specify state entry/do/exit behavior and transition effect • Code snippets (target language or platform independent) • Specify the implementation of operations • Specify state entry/do/exit behavior and transition effect • Activity actions • Guards (activity edge, state machine transition)  Flexible  Very complex (almost as complex as code)

  12. Action Language • Snippets of Code in the Model • Target language (Java, C++, C#) or its subset  Error prone, bound to specific target platform and compiler  Already known language • Platform independent  New language to learn  Makes the model retargetable, less error prone

  13. Outline – UML Model Debugger • Introduction • Motivation • UML Behavioral Modeling • Action Language • UML Model Debugger • Debugging capabilities • Debugging perspective • Diagram animation • Testing • Model testing • Model-based testing (test generation)

  14. Interactive Debugging • Traditional debugging • Running a main function • Hitting a breakpoint • Stepping • Observing values • Interactive debugging (model “exerciser”) • Creating instances • Invoking operations and behaviors, send signals • Hitting a breakpoint • Stepping • Observing values

  15. Model Debugging Perspective Debug Variables Breakpoints Event Pools Instances Diagram Animation Console Signals Snippet I/O

  16. Instances View Create New Instance Destroy Instance • Dynamic debugging • Object creation and destruction • Method invocation Instance Attribute Double-click to Invoke Operation

  17. Debug View • Control and display granularity – model elements • State, Transition, Action, Edge, etc. • Supports concurrency in behaviors – stack trace is a tree Execution Stack Step (into, over, out) Stop Pause Resume Send Signal Broadcast Signal

  18. Variables View • Similar to Eclipse debugging framework view Self Object Behavior attributes, local variables and parameters

  19. Breakpoints View • Similar to Eclipse debugging framework view • Breakpoints • Statemachine: State, Transition, Entry, Do, Exit, Effect • Activity: Action “Do” Behavior State Transition

  20. Event Pools View • Shows pending events in event the pools of active objects Pending Events

  21. Signals and I/O Views Send and Broadcast Signal Buttons Double-click to send signal Signals History

  22. Diagram Animation – State Machine Running Transition Execution Pending Current State Breakpoint

  23. Diagram Animation – Activity Execution Pending Offer Path Token Provider

  24. Outline – Testing • Introduction • Motivation • UML Behavioral Modeling • Action Language • UML Model Debugger • Debugging capabilities • Debugging perspective • Diagram animation • Testing • Model testing • Model-based testing (test generation)

  25. Debugging – Model Interpretation UML Model Application • Simulation / Emulation (for debugging and understanding) • Recording of execution traces (assisted test generation) Code Generation Model Debugger Test Execution Environment Test Generator Test / Trace

  26. Debugging – Generated Code UML Model Application • Execution monitoring and control • Execution trace animation • Trace analysis results visualization Code Generation Model Debugger Test Execution Environment Test Generator Test / Trace

  27. Automatic Test Generation UML Model Application • Test is a sequence of stimuli and observations • Model is used as the oracle to predict the expected results • A bunch of tests is generated automatically according to provided criteria Code Generation Model Debugger Test Execution Environment Test Generator Test / Trace

  28. Test Editing UML Model Application • Manual test creation using model-level terms • Editing of tests generated using the Test Generator or Model Debugger traces Code Generation Model Debugger Test Execution Environment Test Generator Test / Trace

  29. Model Testing UML Model Application • Execution of tests on the model • Used for model regression testing and test-first modeling approach Code Generation Model Debugger Test Execution Environment Test Generator Test / Trace

  30. Model Driven Testing of Applications UML Model Application • Execution of tests on the application • Transformation to concrete test execution environment Code Generation Model Debugger Test Execution Environment Test Generator Test / Trace

  31. Testing Summary • Test creation • Manual (test editor) • Assisted (execution trace recording) • Automatic test generation • Model Testing • Execution of tests on the model • Used for model regression testing and test-first modeling approach • Model-Based Testing of Systems • Transformation to concrete test execution environment • Execution of tests on the application

  32. Summary • MDD is a practical option for improving SW production and capitalizing on existing SW assets through: • Abstraction • Automation • Legacy modernization • UML Behavioral Modeling • Action Language • UML Model Debugger • Model testing • Model-based testing of applications

  33. References • IBM Haifa Research Lab – Model Driven Engineering Technologies group http://www.research.ibm.com/haifa/dept/services/mdet.html • Model Debugger http://www.research.ibm.com/haifa/projects/software/ple/mex/index.html • Model Grokking http://www.research.ibm.com/haifa/projects/software/ple/grokking/index.html • UML http://www.uml.org/ • Contacts: Andrei Kirshin, Dolev Dotan, Alan Hartman {kirshin,dotan,hartman}@il.ibm.com

More Related