SEG 2100 Software Design II

SEG 2100 Software Design II

Teaching Effective UML Modeling by Combining it with Programming 6th Kinneret Conference on Software Engineering Education February 19, 2018 Timothy C. Lethbridge, P.Eng. University of Ottawa, Canada [email protected] http://www.umple.org Context Students have learned a little programming in a first course (or two) Now it is time for them to start to build somewhat larger systems so we teach them modeling and perhaps a little process The traditional approach to teaching modeling (generally in UML) is: Draw diagrams Hand-wave about the semantics of the diagrams Perhaps get students to write code that might correspond to the diagrams T. Lethbridge - Feb 2018 Teaching Modeling by Combining with Programming

2 My vision for student learning outcomes in second-year or third-year software courses Concurrently they should learn to be able to Analyse and design using high level abstractions Model-driven development (MDD) Develop in an agile manner Responsiveness to users Small iterations Test-driven development (TDD) Continue to develop programming skills But generate code from models where possible Use simple, but effective tools for the above T. Lethbridge - Feb 2018 Teaching Modeling by Combining with Programming 3 Lessons learned from years of teaching modeling in UML Students (and practitioners) rarely develop the skills to be good UML modelers using traditional approaches They have many patterns of misconception about semantics and pragmatics of modeling

This slows down software development later in industry I learned how to teach modeling through trial and error (1990-2004+) It required slow board work to walk through many examples To truly understand modeling, students needed to see resulting code, but code generators were dreadful I needed a faster and more usable tool T. Lethbridge - Feb 2018 Teaching Modeling by Combining with Programming 4 2017 modeling tool survey Perceived biggest drawbacks of top 7 tools Argo UML

Astah Eclipse Magic Papyrus Star Mod. Draw UML Tools UML Visual Paradigm Complex to use 25.0% 11.5% 22.2% 46.2% 42.9% 11.8%

10.5% Slow to use 12.5% 11.5% 11.1% 15.4% 14.3% 17.6% 5.3% Does not generate 25.0% codeof the quality I would like Does not support 25.0% somemodeling aspects 37.5%

Does not give sufficient feedback about models 25.0% Hard to draw diagrams Does not interact 6.3% well with other tools 18.8% Buggy 25.0% Not kept up to T. Lethbridge - ILTAM - Feb 2018 date 38.5% 11.1% 23.1% 21.4%

23.5% 10.5% 19.2% 0.0% 30.8% 7.1% 17.6% 15.8% 53.8% 22.2% 23.1% 42.9% 35.3%

42.1% 0.0% 55.6% 30.8% 28.6% 17.6% 21.1% 11.5% 22.2% 30.8% 0.0% 11.8% 10.5%

0.0% 11.1% 7.7% 28.6% 5.9% 5.3% 3.8% 0.0% 0.0% 0.0% 17.6% 10.5% Model-Based Programming: Agile meets Modeling

5 What is model-driven development (MDD)? Developing software starting with high-level abstractions that can be visualized in diagram form But diagrams are not essential! The model can be written textually, and the diagrams generated T. Lethbridge - ILTAM - Feb 2018 Model-Based Programming: Agile meets Modeling 6 What are agile methods? Developing very small changes to software, and releasing frequently, while responding to stakeholder needs, maintaining high quality and keeping overhead and technical debt low Its about balancing Speed/Velocity (dates for delivery) Functionality Quality Financial viability

Adjust 1 and 2, avoiding risks from sacrificing 3 and 4 T. Lethbridge - ILTAM - Feb 2018 Model-Based Programming: Agile meets Modeling 7 Primary motivation for developing Umple To create a tool with the best combination of features: Textual model editing and blending with other languages Ability to use in an agile process Write tests, continuous integration, versioning Combine the best of agility and modeling Excellent code generation Complete generation of real systems (including itself) Multi-platform (command-line, Eclipse, Web) Practical and easy to use for developers Including great documentation Open source T. Lethbridge - ILTAM - Feb 2018 Model-Based Programming: Agile meets Modeling 8

Other motivations for creating Umple To be a real software system to which students can contribute as part of their software engineering education It has been developed by about 60 students over 11 years 6 PhD, 4 masters 50 4th year undergraduates from 15 universities in their capstone projects They deepen their understanding of many areas of CS and SE To serve as a research platform for MDD, agile methods, tool usability, and so on T. Lethbridge - Feb 2018 Teaching Modeling by Combining with Programming 9 Umple: Simple, Ample, UML Programming Language 1. Textual modelling tool set Command line compiler Web-based tool (UmpleOnline) for demos and education Eclipse plugin 2. Open source code generator for UML ++ Infinitely nested state machines, with concurrency

Proper referential integrity and multiplicity constraints on associations Traits, mixins, aspects for modularity Text generation templates, patterns, traits 3. Pre-processor to add UML, patterns and other features on top of Java, PhP, C++ andTeaching otherModeling languages by Combining with Programming 10 T. Lethbridge - Feb 2018 Overview and demo of Umple: www.umple.org Online tool (Umpleonline at try.umple.org ) Manual: http://manual.umple.org Open source on Github: http://code.umple.org T. Lethbridge - Feb 2018 Teaching Modeling by Combining with Programming 11 Example of textual Umple We will visualize the following in UmpleOnline, then

edit the diagram and see the text changing class Student { Integer id; status { entered { register -> registered; } registered { pay -> paid; } paid {} } } class CourseSection { description; 1 -- * Student registrants; } T. Lethbridge - Feb 2018 Teaching Modeling by Combining with Programming 12 My Classroom Technique When teaching UML modeling now I have Umple 50% PowerPoint Slides (as designed for my book) 25% Whiteboard work 25% UmpleOnline

T. Lethbridge - Feb 2018 Teaching Modeling by Combining with Programming 13 Educational and industrial use of Umple Used by me for teaching in Second year Introduction to Software Engineering Fourth year Advanced Design Used by other professors in several universities UmpleOnline usage as of February 2018 is about 10,000 transactions per day Umple is written in itself developed by students https://github.com/umple/umple/tree/master/cruise.umple/src http://metamodel.umple.org Umple is also used in some small companies T. Lethbridge - Feb 2018 Teaching Modeling by Combining with Programming 14 Key benefits from classroom use of Umple Faster and easier than using the black/white board for

UML modeling Textual mode twice as fast as board Graphical editor 25% faster than board Ability to load saved designs to edit Easier to rearrange design Can explore design alternatives then save them for later Ability to umplify, i.e. convert Java code to a model Ability to generate good-quality code for discussion Low footprint: Only requires a browser Although Eclipse and command line can be used T. Lethbridge - Feb 2018 Teaching Modeling by Combining with Programming 15 Sample student exercises using Umple Steps we might ask students to follow: 1. Enter a model graphically and/or textually 2. Generate code 3. Explain the semantics of UML by studying generated code Then 4. Enter another model 5. Write a main program and test the generated code

T. Lethbridge - Feb 2018 Teaching Modeling by Combining with Programming 16 Student satisfaction survey In a 68-student 2nd year course Introduction to Software Engineering 10 Likert-scale questions Took five minutes Voluntary: 30 students participated Just before start of class On the next two slides, error bars indicate standard deviation T. Lethbridge - Feb 2018 Teaching Modeling by Combining with Programming 17 Um he ple lpe in d m the

e u cl a ssr n d Um ers o o t an m me ple d un in th con de rst e lab cept an s Iw h d co elpe gr ill g nc d ep be ades et be ts cau tte r

Prsoe o us f. Lf Um e i et h p t in brle idg As f u too of D ture e sh inc ec co ould om 201 urs ple 0, U es Ot te mp h o r l be er en too bug e is jus ls gy w ta

Iw s e ould o f fe fut uld cti have ur u v e, s e ass Um e um pl ing e in bu th gs e fi x ed Results of survey T. Lethbridge - Feb 2018 Teaching Modeling by Combining with Programming 18 Av

for ailab mo ilit de y o ls f an a te d d xt iag ual ram fo Ab s rm & ility ha ve to ed the it oth diag er ra ref m lec or t c tex ha ng t es Ab rep ility

res t o en gen t t h er e m ate od co de el to T. Lethbridge - Feb 2018 Teaching Modeling by Combining with Programming 19 Comparison of grades Comparison of 4 offerings of the same course before introducing Umple, and 2 offerings afterwards Midterm examination grades on UML modeling question rose from 75.8% to 82.3% 8.6% improvement Final exam grades on UML modeling questions rose from 76.4% to 83.6% 9.4% improvement Highly statistically significant p<0.00002 on T Test n=332 prior to Umple; n=137 afterwards Similar results in 4th year course SEG4110 No difference in non-UML questions

T. Lethbridge - Feb 2018 Teaching Modeling by Combining with Programming 20 Using the Umple project to teach the entire software lifecycle Illustration of several aspects of industrial development online Continuous Integration: http://travis.umple.org and http://cc.umple.org Testing: http://qa.umple.org Documentation: http://Javadoc.umple.org and http://manual.umple.org T. Lethbridge - Feb 2018 Teaching Modeling by Combining with Programming 21 Conclusions (1) To help students better understand modeling concepts, I highly recommend: Live modeling in the classroom with an easy-to-use webbased modeling tool such as UmpleOnline Showing the results of good code generation so students

understand the consequences of modeling decisions Teach agile development of small complete systems using MDD+TDD T. Lethbridge - Feb 2018 Teaching Modeling by Combining with Programming 22 Conclusions (2) Umple has been designed with the above goals in mind Simple web interface + command-line + Eclipse Text-based and graphical modeling in UML State-of-the-art, but easy-to-understand generated code for class and state diagrams T. Lethbridge - Feb 2018 Teaching Modeling by Combining with Programming 23 Thank-you Any more questions?

T. Lethbridge - Feb 2018 Teaching Modeling by Combining with Programming 24 Umple philosophy 1-4 P1. Modeling is programming and vice versa P2. An Umple programmer should never need to edit generated code to accomplish any task. P3. The Umple compiler can accept and generate code that uses nothing but UML abstractions. - The above is the inverse of the following P4. A program without Umple features can be compiled by an Umple compiler. e.g. input Java results in the same as output T. Lethbridge - ILTAM - Feb 2018 Model-Based Programming: Agile meets Modeling 25 Umple philosophy 5-8 P5. A programmer can incrementally add Umple features to an existing program

Umplification P6. Umple extends the base language in a minimally invasive and safe way. P7. Umple features can be created and viewed diagrammatically or textually P8. Umple goes beyond UML T. Lethbridge - ILTAM - Feb 2018 Model-Based Programming: Agile meets Modeling 26

Recently Viewed Presentations

  • Advanced Modelling Techniques in VHDL

    Advanced Modelling Techniques in VHDL

    Packages USE clause Aliases Data alias Non-data alias Resolved signals Packages Packages Method for Grouping Related Declarations Which Serve a Common Purpose Set of subprograms to operate on particular data type Set of declarations for particular model Separate interface from...
  • AngularJS - Meetup

    AngularJS - Meetup

    AngularJS is an unobtrusive, opinionated framework. Use it well, or shoot yourself in the foot. Potential for spaghetti code. Plays very well with other frameworks. Ask yourself, are you doing things the Angular Way? Paradigm shift. Thinking in Angular is...
  • PSHE lesson A PSHE education lesson for pupils

    PSHE lesson A PSHE education lesson for pupils

    What kind of qualities do you think Leila showed when she donated? (Kindness, being caring,bravery. She is also just a normal person - not some kind of superhero! Most people over the age of 18 can give their bone marrow.)...
  • FSCJ PROMISE - Florida State College at Jacksonville

    FSCJ PROMISE - Florida State College at Jacksonville

    FSCJ PROMISE "FSCJ Promise promotes equity amongst our students, a core component of the College's values, by eliminating the barrier of financial debt, ensuring that all of our community members have the chance to receive a quality education."
  • WORMS - Weebly

    WORMS - Weebly

    What is a flatworm? Phylum Platyhelminthes. The least complex worms belong to this phylum. These flatworms are _____ (which means they have no body cavities) and they have _____symmetry.
  • Authors, Presenter North Carolina State University Center for ...

    Authors, Presenter North Carolina State University Center for ...

    Installation - ADT (Cont) Installation Process (Cont) Accept the license agreement and click "Finish". Restart Eclipse. Modify Eclipse preferences to point to the Android SDK directory: Select Window > Preferences... to open the Preferences panel. Select Android from the left...
  • PowerPoint Presentation to Accompany Chapter 8 Communicating &

    PowerPoint Presentation to Accompany Chapter 8 Communicating &

    Lets you use your own telephone (instead of the speakers and microphone system) by connecting your phone to a special adapter that the company provides. VoIP turns the Internet into a means to place phone calls, including long distance. Uses...
  • Health Plan Options Open Enrollment 2019 Health Plan

    Health Plan Options Open Enrollment 2019 Health Plan

    COVA Care. Vision Basic - Blue View Vision. Routine exam once per year. $15 co-pay. Vision & Hearing Options. Expanded vision. Routine hearing exams - $40 co-pay. Hearing aids and other services. More detailed information available in spotlight or on...