Top Banner
Model Oriented Programming: An Empirical Study of Comprehension Omar Badreddin Andrew Forward Timothy C. Lethbridge try.umple.org
29

Model Oriented Programming: An Empirical Study of Comprehension Omar Badreddin Andrew Forward Timothy C. Lethbridge try.umple.org.

Jan 03, 2016

Download

Documents

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Model Oriented Programming: An Empirical Study of Comprehension Omar Badreddin Andrew Forward Timothy C. Lethbridge try.umple.org.

Model Oriented Programming: An Empirical Study of

Comprehension

Omar Badreddin

Andrew Forward

Timothy C. Lethbridge

try.umple.org

Page 2: Model Oriented Programming: An Empirical Study of Comprehension Omar Badreddin Andrew Forward Timothy C. Lethbridge try.umple.org.

2

Page 3: Model Oriented Programming: An Empirical Study of Comprehension Omar Badreddin Andrew Forward Timothy C. Lethbridge try.umple.org.

3

Technology TrendL

evel

s o

f A

bst

ract

ion

Assembly

Pascal

Java, C++

Alf, Umple

Page 4: Model Oriented Programming: An Empirical Study of Comprehension Omar Badreddin Andrew Forward Timothy C. Lethbridge try.umple.org.

4

What is Umple?

• Model Oriented Programming• Add modeling abstractions to code

– Class diagram– State machines

• Model-Code Duality

• State-of-the-art code generation

• Open source (Google Code)

• Available online (try.umple.org) as well as on the command line and in Eclipse

Page 5: Model Oriented Programming: An Empirical Study of Comprehension Omar Badreddin Andrew Forward Timothy C. Lethbridge try.umple.org.

5

Examples of Umple code

Page 6: Model Oriented Programming: An Empirical Study of Comprehension Omar Badreddin Andrew Forward Timothy C. Lethbridge try.umple.org.

6

Page 7: Model Oriented Programming: An Empirical Study of Comprehension Omar Badreddin Andrew Forward Timothy C. Lethbridge try.umple.org.

7

Associations

Page 8: Model Oriented Programming: An Empirical Study of Comprehension Omar Badreddin Andrew Forward Timothy C. Lethbridge try.umple.org.

8

State Machines

Page 9: Model Oriented Programming: An Empirical Study of Comprehension Omar Badreddin Andrew Forward Timothy C. Lethbridge try.umple.org.

9

What else can you model in Umple

• Composite state machine.– Nested– Concurrent

• Do Activities in state machines

• Tracing directives

• Aspect-oriented concepts– Code injection (Before, After)

• Certain patterns (e.g. singleton, immutable)

Page 10: Model Oriented Programming: An Empirical Study of Comprehension Omar Badreddin Andrew Forward Timothy C. Lethbridge try.umple.org.

10

Umple online (try.umple.org)

Page 11: Model Oriented Programming: An Empirical Study of Comprehension Omar Badreddin Andrew Forward Timothy C. Lethbridge try.umple.org.

11

Development Approaches

• Model-Only

• Code-Only

• A mix of Code and Model (Complete running systems)

Page 12: Model Oriented Programming: An Empirical Study of Comprehension Omar Badreddin Andrew Forward Timothy C. Lethbridge try.umple.org.

12

Technology trend revisited

main

mov cx,3

loopstart: do

mov dh,10 ;row 10

mov dl,20 ;column 20

call Gotoxy ;locate cursor

PromptForIntegers

ArraySum

DisplaySum ENDP

END main

for (int i = 0; i < 3; i++)

12

JavaJava

AssemblyAssembly

Page 13: Model Oriented Programming: An Empirical Study of Comprehension Omar Badreddin Andrew Forward Timothy C. Lethbridge try.umple.org.

13

Technology trend revisited

public boolean e() {

boolean wasEventProcessed = false;

Status aStatus = status;

switch (aStatus) {

case On:

setStatus(Status.Off);

wasEventProcessed = true;

break;

case Off:

setStatus(Status.Off);

wasEventProcessed = true;

break; }

return wasEventProcessed; }

status { On { e -> Off;} Off{ e -> Off;}}

13

UmpleUmple

JavaJava

Page 14: Model Oriented Programming: An Empirical Study of Comprehension Omar Badreddin Andrew Forward Timothy C. Lethbridge try.umple.org.

14

Experiment Hypotheses & Design

Page 15: Model Oriented Programming: An Empirical Study of Comprehension Omar Badreddin Andrew Forward Timothy C. Lethbridge try.umple.org.

15

Hypothesis

• H1: A system written in Umple is more comprehensible than an equivalent Java implementation of the system

– H10: Umple and Java do not differ in comprehensibility

• H2: A system written in Umple has a different comprehensibility level than an equivalent UML diagram of the system

– H20: Umple and UML diagrams do not differ in comprehensibility

Page 16: Model Oriented Programming: An Empirical Study of Comprehension Omar Badreddin Andrew Forward Timothy C. Lethbridge try.umple.org.

16

Experiment Design

Umple UML

Java

Page 17: Model Oriented Programming: An Empirical Study of Comprehension Omar Badreddin Andrew Forward Timothy C. Lethbridge try.umple.org.

17

Experiment Design

Umple UML

Java

C

MM

C

Page 18: Model Oriented Programming: An Empirical Study of Comprehension Omar Badreddin Andrew Forward Timothy C. Lethbridge try.umple.org.

18

Umple UML

Java

C

MM

C

T V

T

Experiment Design

Page 19: Model Oriented Programming: An Empirical Study of Comprehension Omar Badreddin Andrew Forward Timothy C. Lethbridge try.umple.org.

19

Umple

Java

C

M

C

T

T

Comparing Umple & Java

Common to both:Textual syntaxComplete system

Natural advantage to Java:Familiarity

Page 20: Model Oriented Programming: An Empirical Study of Comprehension Omar Badreddin Andrew Forward Timothy C. Lethbridge try.umple.org.

20

Umple UMLC

MM

T V

Comparing Umple and UML

Common to both:Modeling notation

Natural advantage to UML:FamiliarityModel only (fewer details)

Page 21: Model Oriented Programming: An Empirical Study of Comprehension Omar Badreddin Andrew Forward Timothy C. Lethbridge try.umple.org.

21

Experiment Procedure

Page 22: Model Oriented Programming: An Empirical Study of Comprehension Omar Badreddin Andrew Forward Timothy C. Lethbridge try.umple.org.

22

Experiment Procedure

System Example

Analyze

9 Participants3 system examples represented in 3

notations (Umple, UML, Java)

12 Questions per example

Measure time, count number

of incorrect responses

Mix of students and professionals

Questions reflect comprehension and

some require tracing

Page 23: Model Oriented Programming: An Empirical Study of Comprehension Omar Badreddin Andrew Forward Timothy C. Lethbridge try.umple.org.

23

Experiment Results

Page 24: Model Oriented Programming: An Empirical Study of Comprehension Omar Badreddin Andrew Forward Timothy C. Lethbridge try.umple.org.

24

Average Response Time

Participants

Page 25: Model Oriented Programming: An Empirical Study of Comprehension Omar Badreddin Andrew Forward Timothy C. Lethbridge try.umple.org.

25

Box Plot of Response Time

Notation

Page 26: Model Oriented Programming: An Empirical Study of Comprehension Omar Badreddin Andrew Forward Timothy C. Lethbridge try.umple.org.

26

Statistical tests

• Examining Data for Umple and Java– Mann-Whitney test ((p = 8.9x10-9)– Two Tailed t-test: Umple was faster for users than Java

(p=1.5x10-8)

• Examining Data for Umple and UML– Mann-Whitney test (p = 0.2)– Two Tailed t-test: Umple ~ UML (p=0.9)

• Number of errors

Page 27: Model Oriented Programming: An Empirical Study of Comprehension Omar Badreddin Andrew Forward Timothy C. Lethbridge try.umple.org.

27

Threats of Validity

• Number of Participants and their experience• Will users interpret questions consistently?

• Fairness of comparing Umple, UML, and Java– Umple & Java / Umple and UML

• Examples could be too simple, not realistic/representative, not ‘the same’ as each other

• Time for response is very small.

• External validity (can it scale to real systems?)

Page 28: Model Oriented Programming: An Empirical Study of Comprehension Omar Badreddin Andrew Forward Timothy C. Lethbridge try.umple.org.

28

Conclusion

• Modeling abstractions embedded in code enhances comprehensibility.

• Such abstractions retain comprehensibility benefits as evident in UML.

• Replication of experiment

• Experimenting with larger, more complex system examples and tasks.

Future Work

Page 29: Model Oriented Programming: An Empirical Study of Comprehension Omar Badreddin Andrew Forward Timothy C. Lethbridge try.umple.org.

29