effects of using examples on structural model comprehension: a controlled experiment dina zayan,...

60
Effects of Using Examples on Structural Model Comprehension: A Controlled Experiment Dina Zayan, Michał Antkiewicz, Krzysztof Czarnecki 2014.06.06 ttp://gsd.uwaterloo.ca http ://necsis.ca

Upload: kaylin-welby

Post on 31-Mar-2015

212 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Effects of Using Examples on Structural Model Comprehension: A Controlled Experiment Dina Zayan, Michał Antkiewicz, Krzysztof Czarnecki 2014.06.06 ://necsis.ca

Effects of Using Examples on Structural Model Comprehension:

A Controlled Experiment

Dina Zayan, Michał Antkiewicz, Krzysztof Czarnecki

2014.06.06

http://gsd.uwaterloo.ca http://necsis.ca

Page 2: Effects of Using Examples on Structural Model Comprehension: A Controlled Experiment Dina Zayan, Michał Antkiewicz, Krzysztof Czarnecki 2014.06.06 ://necsis.ca

2

Many problems in SE are related to domain knowledge transfer

Page 3: Effects of Using Examples on Structural Model Comprehension: A Controlled Experiment Dina Zayan, Michał Antkiewicz, Krzysztof Czarnecki 2014.06.06 ://necsis.ca

3

For example…

• Business analysts communicating to other stakeholders who are novices

• Industry standard which contains domain models applied by novices

• Specifications written by experts given to suppliers

Page 4: Effects of Using Examples on Structural Model Comprehension: A Controlled Experiment Dina Zayan, Michał Antkiewicz, Krzysztof Czarnecki 2014.06.06 ://necsis.ca

4

Why do we have these problems?

Domain Knowledge

Complex in nature

Difficult to articulate

Difficult to communicate

Page 5: Effects of Using Examples on Structural Model Comprehension: A Controlled Experiment Dina Zayan, Michał Antkiewicz, Krzysztof Czarnecki 2014.06.06 ://necsis.ca

5

Let’s run a mini experiment

Page 6: Effects of Using Examples on Structural Model Comprehension: A Controlled Experiment Dina Zayan, Michał Antkiewicz, Krzysztof Czarnecki 2014.06.06 ://necsis.ca

6

In a “second degree price discrimination” strategy, price varies according to the quantity demanded. Larger quantities are available at a lower unit price. Additionally, sellers applying

this strategy are not able to differentiate between different types of consumers. Thus, the suppliers will provide incentives for the

consumers to differentiate themselves according to preference. This also applies to

product quality.

This is an Abstraction

Airlines often offer multiple classes of seats on flights, such as first class and economy class.

This is an Example

Page 7: Effects of Using Examples on Structural Model Comprehension: A Controlled Experiment Dina Zayan, Michał Antkiewicz, Krzysztof Czarnecki 2014.06.06 ://necsis.ca

7

Examples + Abstractions

Effective Knowledge Transfer

Results in Cognitive Psychology and Software Engineering

Page 8: Effects of Using Examples on Structural Model Comprehension: A Controlled Experiment Dina Zayan, Michał Antkiewicz, Krzysztof Czarnecki 2014.06.06 ://necsis.ca

8

Modeling

Model = Abstractions + Examples

Example-Driven

Page 9: Effects of Using Examples on Structural Model Comprehension: A Controlled Experiment Dina Zayan, Michał Antkiewicz, Krzysztof Czarnecki 2014.06.06 ://necsis.ca

9

Of Course Examples Help!

+ Capture intuition+ Relate to existing knowledge+ Show the intended usage of an abstraction

Page 10: Effects of Using Examples on Structural Model Comprehension: A Controlled Experiment Dina Zayan, Michał Antkiewicz, Krzysztof Czarnecki 2014.06.06 ://necsis.ca

10

However…

1. When exactly do examples help?2. How much can they help?3. What types of examples help?4. Which stakeholders benefit the most

from examples?5. Where is a PROOF that they help?

Page 11: Effects of Using Examples on Structural Model Comprehension: A Controlled Experiment Dina Zayan, Michał Antkiewicz, Krzysztof Czarnecki 2014.06.06 ://necsis.ca

11

Provide the Missing Empirical Evidence and Guidelines

Objective

Page 12: Effects of Using Examples on Structural Model Comprehension: A Controlled Experiment Dina Zayan, Michał Antkiewicz, Krzysztof Czarnecki 2014.06.06 ://necsis.ca

12

“Analyze the effects of using explicit examples

on structural model comprehension

in the context of knowledge transfer to model receptors

who are novices to the application domain.”

Controlled Experiment

Page 13: Effects of Using Examples on Structural Model Comprehension: A Controlled Experiment Dina Zayan, Michał Antkiewicz, Krzysztof Czarnecki 2014.06.06 ://necsis.ca

13

Two Groups of Participants

EDM Control

Model Abstractions

Model Abstractions

Experimental Procedures & Requirements

List

Experimental Procedures & Requirements

List

Examples!

(13) (12)

Page 14: Effects of Using Examples on Structural Model Comprehension: A Controlled Experiment Dina Zayan, Michał Antkiewicz, Krzysztof Czarnecki 2014.06.06 ://necsis.ca

14

Instrumentation & Actors Map

Experimental Procedures &

Requirements List

Model Abstractions

SME Model Creator

Examples!

Page 15: Effects of Using Examples on Structural Model Comprehension: A Controlled Experiment Dina Zayan, Michał Antkiewicz, Krzysztof Czarnecki 2014.06.06 ://necsis.ca

15

Treatments and Metrics

Sobeys Object Diagram

EDM

Control

Page 16: Effects of Using Examples on Structural Model Comprehension: A Controlled Experiment Dina Zayan, Michał Antkiewicz, Krzysztof Czarnecki 2014.06.06 ://necsis.ca

16

Page 17: Effects of Using Examples on Structural Model Comprehension: A Controlled Experiment Dina Zayan, Michał Antkiewicz, Krzysztof Czarnecki 2014.06.06 ://necsis.ca

1723 classes, 34 associations, and 8 constraints

Page 18: Effects of Using Examples on Structural Model Comprehension: A Controlled Experiment Dina Zayan, Michał Antkiewicz, Krzysztof Czarnecki 2014.06.06 ://necsis.ca

18

(EDM Only)

4 positive and 2 negative examples

Page 19: Effects of Using Examples on Structural Model Comprehension: A Controlled Experiment Dina Zayan, Michał Antkiewicz, Krzysztof Czarnecki 2014.06.06 ://necsis.ca

19

Treatments and Metrics

Sobeys Object Diagram

1) Diagram Completeness

EDM

Control

Page 20: Effects of Using Examples on Structural Model Comprehension: A Controlled Experiment Dina Zayan, Michał Antkiewicz, Krzysztof Czarnecki 2014.06.06 ://necsis.ca

20

Diagram Completeness

• Mean (Control) = 49.2 %• Mean (EDM) = 88.1 %• p-value < 0.0002• Maximum score for

Control is lower than the minimum score for the EDM

+ 37% increase

Page 21: Effects of Using Examples on Structural Model Comprehension: A Controlled Experiment Dina Zayan, Michał Antkiewicz, Krzysztof Czarnecki 2014.06.06 ://necsis.ca

21

Treatments and Metrics

Sobeys Object Diagram

1) Diagram Completeness2) Diagram Mistakes

EDM

Control

Page 22: Effects of Using Examples on Structural Model Comprehension: A Controlled Experiment Dina Zayan, Michał Antkiewicz, Krzysztof Czarnecki 2014.06.06 ://necsis.ca

22

Diagram Mistakes• Mean (Control) = 15.1

mistakes• Mean (EDM) = 3.5

mistakes• p-value < 0.0053• Maximum number of

mistakes for EDM is equal to the minimum number of mistakes for Control

- 80% decrease

Page 23: Effects of Using Examples on Structural Model Comprehension: A Controlled Experiment Dina Zayan, Michał Antkiewicz, Krzysztof Czarnecki 2014.06.06 ://necsis.ca

23

Treatments and Metrics

Sobeys Object Diagram

1) Diagram Completeness2) Diagram Mistakes3) Perceived Difficulty4) Perceived Confidence

EDM

Control

Page 24: Effects of Using Examples on Structural Model Comprehension: A Controlled Experiment Dina Zayan, Michał Antkiewicz, Krzysztof Czarnecki 2014.06.06 ://necsis.ca

24

Participants Rated Themselves

Difficulty

1 (very easy) to 5 (very difficult)

– Control: 3.83– EDM: 2.46

-27% decrease

Confidence

1 (unsure) to 5 (very sure)

– Control: 2.33– EDM: 4.08

+ 35% increase

Page 25: Effects of Using Examples on Structural Model Comprehension: A Controlled Experiment Dina Zayan, Michał Antkiewicz, Krzysztof Czarnecki 2014.06.06 ://necsis.ca

25

Treatments and Metrics

Study Questions

Sobeys Object Diagram

1) Diagram Completeness2) Diagram Mistakes3) Perceived Difficulty4) Perceived Confidence

EDM

Control

Page 26: Effects of Using Examples on Structural Model Comprehension: A Controlled Experiment Dina Zayan, Michał Antkiewicz, Krzysztof Czarnecki 2014.06.06 ://necsis.ca

26

Page 27: Effects of Using Examples on Structural Model Comprehension: A Controlled Experiment Dina Zayan, Michał Antkiewicz, Krzysztof Czarnecki 2014.06.06 ://necsis.ca

27

Page 28: Effects of Using Examples on Structural Model Comprehension: A Controlled Experiment Dina Zayan, Michał Antkiewicz, Krzysztof Czarnecki 2014.06.06 ://necsis.ca

28

Treatments and Metrics

Study Questions

Sobeys Object Diagram

1) Diagram Completeness2) Diagram Mistakes3) Perceived Difficulty4) Perceived Confidence

1) Task 2 Completeness

EDM

Control

Page 29: Effects of Using Examples on Structural Model Comprehension: A Controlled Experiment Dina Zayan, Michał Antkiewicz, Krzysztof Czarnecki 2014.06.06 ://necsis.ca

29

Task 2 Completeness

• Mean (Control) = 13.6• Mean (EDM) = 21.2• p-value < 0.0012

+ 31% increase

Max 24

Page 30: Effects of Using Examples on Structural Model Comprehension: A Controlled Experiment Dina Zayan, Michał Antkiewicz, Krzysztof Czarnecki 2014.06.06 ://necsis.ca

30

Treatments and Metrics

Study Questions

Sobeys Object Diagram

1) Diagram Completeness2) Diagram Mistakes3) Perceived Difficulty4) Perceived Confidence

1) Task 2 Completeness2) Efficiency

EDM

Control

Page 31: Effects of Using Examples on Structural Model Comprehension: A Controlled Experiment Dina Zayan, Michał Antkiewicz, Krzysztof Czarnecki 2014.06.06 ://necsis.ca

31

Task 2 Efficiency

• Mean (Control) = 0.7• Mean (EDM) = 1.2• p-value = 0.00082

+ 71% increase

Page 32: Effects of Using Examples on Structural Model Comprehension: A Controlled Experiment Dina Zayan, Michał Antkiewicz, Krzysztof Czarnecki 2014.06.06 ://necsis.ca

32

Treatments and Metrics

Study Questions

Sobeys Object Diagram

1) Diagram Completeness2) Diagram Mistakes3) Perceived Difficulty4) Perceived Confidence

1) Task 2 Completeness2) Efficiency3) Perceived Difficulty4) Perceived Confidence

EDM

Control

Page 33: Effects of Using Examples on Structural Model Comprehension: A Controlled Experiment Dina Zayan, Michał Antkiewicz, Krzysztof Czarnecki 2014.06.06 ://necsis.ca

33

Participants Rated Themselves

Difficulty

1 (very easy) to 5 (very difficult)

– Control: 3.25– EDM: 2.08

-23.5% decrease

Confidence

1 (unsure) to 5 (very sure)

– Control: 3.00– EDM: 4.15

+ 23% increase

Page 34: Effects of Using Examples on Structural Model Comprehension: A Controlled Experiment Dina Zayan, Michał Antkiewicz, Krzysztof Czarnecki 2014.06.06 ://necsis.ca

34

Treatments and Metrics

Study Questions

Sobeys Object Diagram

Participants Questions

1) Diagram Completeness2) Diagram Mistakes3) Perceived Difficulty4) Perceived Confidence

1) Task 2 Completeness2) Efficiency3) Perceived Difficulty4) Perceived Confidence

1) Number of domain-related questions

EDM

Control

Page 35: Effects of Using Examples on Structural Model Comprehension: A Controlled Experiment Dina Zayan, Michał Antkiewicz, Krzysztof Czarnecki 2014.06.06 ://necsis.ca

35

Number of Domain-Related Questions

• Control: 10 questions/session

• EDM: 1 question/session

- 90% reduction

Page 36: Effects of Using Examples on Structural Model Comprehension: A Controlled Experiment Dina Zayan, Michał Antkiewicz, Krzysztof Czarnecki 2014.06.06 ://necsis.ca

36

Treatments and Metrics

Study Questions

Sobeys Object Diagram

Participants Questions

Feedback

1) Diagram Completeness2) Diagram Mistakes3) Perceived Difficulty4) Perceived Confidence

1) Task 2 Completeness2) Efficiency3) Perceived Difficulty4) Perceived Confidence

1) Number of Domain-related Questions

1) UML Class Diagram2) Examples

EDM

Control

Page 37: Effects of Using Examples on Structural Model Comprehension: A Controlled Experiment Dina Zayan, Michał Antkiewicz, Krzysztof Czarnecki 2014.06.06 ://necsis.ca

37

Understanding Without Examples?

EDM: “The class diagram was huge, I didn’t know where

to start reading to understand, so I looked at the examples one by one while looking at the model abstractions simultaneously.”

Page 38: Effects of Using Examples on Structural Model Comprehension: A Controlled Experiment Dina Zayan, Michał Antkiewicz, Krzysztof Czarnecki 2014.06.06 ://necsis.ca

38

Classes Most Difficult To Comprehend

Class Control EDM Mistakes Control/EDM

Misses Control/EDM

BonusMechanic ✔ ✔ 5/2 4/0Redemption Mechanic

✔ ✔ 9/0 3/0

“Partner” Offer ✔ x 6/0 3/0Bill ✔ ✔ 9/3 0/0

Page 39: Effects of Using Examples on Structural Model Comprehension: A Controlled Experiment Dina Zayan, Michał Antkiewicz, Krzysztof Czarnecki 2014.06.06 ://necsis.ca

39

Page 40: Effects of Using Examples on Structural Model Comprehension: A Controlled Experiment Dina Zayan, Michał Antkiewicz, Krzysztof Czarnecki 2014.06.06 ://necsis.ca

40

How Were the Examples Helpful?

• Example 2: • Regular product vs. product with an offer associated• Application of the BonusMechanic class

• Example 4: • Propagation of points across classes and the

sequence for accumulating points• Account’s “pointsBalance” updated with Bill’s

“totalPoints” attribute

Page 41: Effects of Using Examples on Structural Model Comprehension: A Controlled Experiment Dina Zayan, Michał Antkiewicz, Krzysztof Czarnecki 2014.06.06 ://necsis.ca

41

Page 42: Effects of Using Examples on Structural Model Comprehension: A Controlled Experiment Dina Zayan, Michał Antkiewicz, Krzysztof Czarnecki 2014.06.06 ://necsis.ca

42

How Were the Examples Helpful?

• Example 5:• Redemption process

• Example 6:• Violation of the constraint prohibiting accumulation and

redemption for the same bill instance

Page 43: Effects of Using Examples on Structural Model Comprehension: A Controlled Experiment Dina Zayan, Michał Antkiewicz, Krzysztof Czarnecki 2014.06.06 ://necsis.ca

43

Are Both Positive and Negative Examples Needed?

• “Yes” 12/13 EDM participants

• No comments about the number and content of examples

Page 44: Effects of Using Examples on Structural Model Comprehension: A Controlled Experiment Dina Zayan, Michał Antkiewicz, Krzysztof Czarnecki 2014.06.06 ://necsis.ca

44

Discussion

Page 45: Effects of Using Examples on Structural Model Comprehension: A Controlled Experiment Dina Zayan, Michał Antkiewicz, Krzysztof Czarnecki 2014.06.06 ://necsis.ca

46

Examples are mostly needed by Novices

• FixedPriceOff vs. FixedPercentOff– familiar

• RedemptionMechanic, RedemptionChannel, and BonusMechanic – foreign

Page 46: Effects of Using Examples on Structural Model Comprehension: A Controlled Experiment Dina Zayan, Michał Antkiewicz, Krzysztof Czarnecki 2014.06.06 ://necsis.ca

47

Having a Variety of Examples

Useful when1. Having more than one association linked to a

single class

Page 47: Effects of Using Examples on Structural Model Comprehension: A Controlled Experiment Dina Zayan, Michał Antkiewicz, Krzysztof Czarnecki 2014.06.06 ://necsis.ca

48

Page 48: Effects of Using Examples on Structural Model Comprehension: A Controlled Experiment Dina Zayan, Michał Antkiewicz, Krzysztof Czarnecki 2014.06.06 ://necsis.ca

49

Having a Variety of Examples

Useful when1. Having more than one association linked to a

single class2. Complex constraints

Page 49: Effects of Using Examples on Structural Model Comprehension: A Controlled Experiment Dina Zayan, Michał Antkiewicz, Krzysztof Czarnecki 2014.06.06 ://necsis.ca

50

Page 50: Effects of Using Examples on Structural Model Comprehension: A Controlled Experiment Dina Zayan, Michał Antkiewicz, Krzysztof Czarnecki 2014.06.06 ://necsis.ca

51

Having a Variety of Examples

Useful when1. Having more than one association linked to a

single class2. Complex constraints3. Propagation of attributes through classes

Page 51: Effects of Using Examples on Structural Model Comprehension: A Controlled Experiment Dina Zayan, Michał Antkiewicz, Krzysztof Czarnecki 2014.06.06 ://necsis.ca

52

Page 52: Effects of Using Examples on Structural Model Comprehension: A Controlled Experiment Dina Zayan, Michał Antkiewicz, Krzysztof Czarnecki 2014.06.06 ://necsis.ca

53

Having a Variety of Examples

Useful when1. Having more than one association linked to a

single class2. Complex constraints3. Propagation of attributes through classes4. A domain concept that is spread over several

classes and associations (Points Accumulation)

Page 53: Effects of Using Examples on Structural Model Comprehension: A Controlled Experiment Dina Zayan, Michał Antkiewicz, Krzysztof Czarnecki 2014.06.06 ://necsis.ca

54

EDM participant who preferred valid examples only answered the related question incorrectly

Page 54: Effects of Using Examples on Structural Model Comprehension: A Controlled Experiment Dina Zayan, Michał Antkiewicz, Krzysztof Czarnecki 2014.06.06 ://necsis.ca

55

Partial Examples

• 12 participants– partial examples, no complete object diagram

• One participant– partial examples and complete object diagram

Page 55: Effects of Using Examples on Structural Model Comprehension: A Controlled Experiment Dina Zayan, Michał Antkiewicz, Krzysztof Czarnecki 2014.06.06 ://necsis.ca

56

Conclusions

Page 56: Effects of Using Examples on Structural Model Comprehension: A Controlled Experiment Dina Zayan, Michał Antkiewicz, Krzysztof Czarnecki 2014.06.06 ://necsis.ca

57

Quantitative Analysis

Dependent Variable

Significant? (p-value)

Hyptheses Testing

% Improvement due to the use of

examplesDiagram Completeness

Yes (<0.0002) Accept H1 +39%

Diagram Mistakes

Yes (<0.0053) Accept H2 -80%

Task 2 Completeness

Yes (<0.0012) Accept H3 +31%

Task 2 Efficiency

Yes (=0.00082) Accept H4 +71%

Page 57: Effects of Using Examples on Structural Model Comprehension: A Controlled Experiment Dina Zayan, Michał Antkiewicz, Krzysztof Czarnecki 2014.06.06 ://necsis.ca

58

Qualitative Analysis

Dependent Variable % Improvement due to the use of examples

Perceived difficulty in creating the object diagram.

-27%

Perceived difficulty in answering Task 2 questions.

-23%

Confidence in their created object diagrams.

+35%

Confidence in the answers they provided for Task 2.

+23%

Page 58: Effects of Using Examples on Structural Model Comprehension: A Controlled Experiment Dina Zayan, Michał Antkiewicz, Krzysztof Czarnecki 2014.06.06 ://necsis.ca

59

Limitations & Future Work

• Partial examples as views on a complete example

• Variety of examples vs. positive only

• Cost of creating and maintaining the examples vs. the benefit

• Empirical studies in an industrial context

Page 59: Effects of Using Examples on Structural Model Comprehension: A Controlled Experiment Dina Zayan, Michał Antkiewicz, Krzysztof Czarnecki 2014.06.06 ://necsis.ca

Thank You!

Replication packageis available for download

http://gsd.uwaterloo.ca http://necsis.ca

Examples!

Page 60: Effects of Using Examples on Structural Model Comprehension: A Controlled Experiment Dina Zayan, Michał Antkiewicz, Krzysztof Czarnecki 2014.06.06 ://necsis.ca

61

Example-Driven Modeling Using

• Unified syntax for abstractions and examples + redefinition

• Partial examples + automatic completion and constraint checking

• Specialization + extension

http://clafer.org