University of Southern California Center for Systems and Software Engineering Model-Based Software Engineering Supannika Koolmanojwong Spring 2013 University of Southern California Center for Systems and Software Engineering Outline • Model-Based Software Engineering • Agile MDA • Agile Modeling 2 University of Southern California Center for Systems and Software Engineering Related Concepts • MBASE – Model-Based (System) Architecting and Software Engineering (by CSSE USC) – Product, Process, Property, and Success models • • • • • • MBE – Model-Based Engineering MDE – Model-Driven Engineering MDD – Model-Driven Development MDA – Model Driven Architecture Model-Based Software Development Model-Based Testing 3 University of Southern California Center for Systems and Software Engineering What is Model-based ______ ? • Designing before coding • Benefits of Model-based software engineering ? • A model is an abstraction – it gives a high-level description of objects – Technology independent model • Models are often graphical • Reduce development time; simplify the process of design – Using design pattern • Improve application quality while reducing testing time • Reduce maintenance cost and Total Cost of Ownership of enterprise applications 4 University of Southern California Center for Systems and Software Engineering Model-driven architecture • Separate design from architecture • The design – Addresses the functional (use case) requirements • The architecture – Provides infrastructure through which LOS requirements are realized 5 University of Southern California Center for Systems and Software Engineering MDA models • Computational Independent Models – Business models • Technology (Platform) Independent Models • Technology (Platform) Specific Models 6 University of Southern California Center for Systems and Software Engineering OMG MDA University of Southern California Center for Systems and Software Engineering OMG Technology (SysML) University of Southern California Center for Systems and Software Engineering OMG Technology (SysML) University of Southern California Center for Systems and Software Engineering Requirement Diagram 10 University of Southern California Center for Systems and Software Engineering Block Definition Diagram 11 University of Southern California Center for Systems and Software Engineering Advantages • Independence of a specific programming language • Predict bottlenecks and constraints • Predict system performance • More detailed abstraction levels • Achieve high complexity • Encourages good OO University of Southern California Center for Systems and Software Engineering Advantages (continued) • Can communicate effectively with stakeholders by providing a model. • Create a roadmap for developers to follow. • Track the history of every decision. (essential for Embedded Systems!) • Represents things in thin air (like network or internet components) University of Southern California Center for Systems and Software Engineering Disadvantages • More time modeling and less time coding (if you enjoy coding). • Usability of generated code. University of Southern California Center for Systems and Software Engineering Outline • Model-Based Software Engineering • Agile MDA • Agile Modeling 15 University of Southern California Center for Systems and Software Engineering Agile MDA • Agile MDA is based on the notion that code and executable models are operationally the same. – testing first – immediate execution – short cycles 16 http://www.omg.org/mda/mda_files/AgileMDA.pdf University of Southern California Center for Systems and Software Engineering Agile MDA • Types of Models – Sketch • To brainstorm some idea – Blueprint • Can be used as a construction plan • Mostly for manufacturing system – Executable model 17 University of Southern California Center for Systems and Software Engineering Agile MDA • No analysis or design model – but different model to capture independent aspects of the system • Build executable UML model – Class, state diagrams • Some diagrams are not executable, but provide foundations to others – Use Case diagram 18 University of Southern California Center for Systems and Software Engineering Agile MDA Class Diagram State Diagram Object Diagram • Technology Independent Model • Encourage clients to participate in the architecture development 19 University of Southern California Center for Systems and Software Engineering Agile MDA • Why use action models, why not code directly ? • Action semantics allows you to specify behavior without relying on knowledge of the implementation 20 University of Southern California Center for Systems and Software Engineering Agile MDA • Merge the models – Map them together – Example: • The class Teller and the class Customer in the Bank model each correspond to an instance of a Role in the Security model • Each Account instance in the Bank corresponds to an instance of ProtectedResource in Security • a subset of Train instances in a control application corresponds to instances of Icon in a User Interface domain 21 University of Southern California Center for Systems and Software Engineering Agile MDA 22 University of Southern California Center for Systems and Software Engineering Agile MDA • Model Compiler – Mapping functions from various models – Executable UML becomes meta model for individual models that compiler weaves together • Architectural mismatch !! – Transform models to java / C++ • Several techniques such as archetype, QVT • Adding code bodies 23 University of Southern California Center for Systems and Software Engineering Outline • Model-Based Software Engineering • Agile MDA • Agile Modeling 24 University of Southern California Center for Systems and Software Engineering Agile Modeling • Methodology for effective modeling and documentation of softwarebased systems http://www.agilemodeling.com/ 25 University of Southern California Center for Systems and Software Engineering Agile Modeling – Document Late • Create document just before you deliver them; wait until the unit has stabilized; Document the as-built system • Risky to capture speculative information – requirements, design 26 University of Southern California Center for Systems and Software Engineering Document late • Model and plan early, but don’t write detailed documents • JIT detailed specifications – Prefer to write executable specifications • in the form of tests, not static document • Supporting documents – user manuals – Write once the system has stabilized – Treat documentation as requirement (has prioritization level) • System overview documentation – Higher quality code with a regression test-suite for their code • Lower cost curve – Document early increase documentation maintenance costs • Reduce financial risk and accuracy risk • Increase delivery risk and accuracy risk (might forget something) 27 University of Southern California Center for Systems and Software Engineering Document Continuously • Deliverable documentation – Part of the overall solution to deliver to customers • Use Agile documentation style – Wait for info to stabilize – Document during long iteration – For short iteration (2 weeks) – unlikely that the info will stabilize in time, may document in the next iteration. 28 University of Southern California Center for Systems and Software Engineering Architecture Envisioning - Agile Model Driven Development 29 University of Southern California Center for Systems and Software Engineering Model Storming • JIT modeling – stand-up design session; customer Q&A session • Analysis Model • Design Model 30 University of Southern California Center for Systems and Software Engineering Analysis Model • Simple tool • Need Active Stakeholder Participation 31 University of Southern California Center for Systems and Software Engineering Design Model 32 University of Southern California Center for Systems and Software Engineering Look Ahead Modeling • Sometimes JIT is not enough • Stakeholders unavailability • Difficult requirements/ solution – Need experts to work through them before explaining to developers • Need to integrate with poorly documented legacy asset • Usability issues – usability modeling an iteration ahead of the actual development • Speed up development • Potential conflict 33 University of Southern California Center for Systems and Software Engineering References • http://www.omg.org/mda/mda_files/AgileM DA.pdf 34