An Overview of Software Code Quality and Connection to Business - - PowerPoint PPT Presentation

an overview of software code quality and connection to
SMART_READER_LITE
LIVE PREVIEW

An Overview of Software Code Quality and Connection to Business - - PowerPoint PPT Presentation

An Overview of Software Code Quality and Connection to Business Process Quality Yann-Gal Guhneuc 1 st IEEE International Workshop on Communicating Business Process and Software Models (Quality, Understandability, and Maintainability)


slide-1
SLIDE 1

Yann-Gaël Guéhéneuc

This work is licensed under a Creative Commons Attribution-NonCommercial- ShareAlike 3.0 Unported License

An Overview of Software Code Quality and Connection to Business Process Quality

1st IEEE International Workshop on Communicating Business Process and Software Models

(Quality, Understandability, and Maintainability)

slide-2
SLIDE 2

2/75

slide-3
SLIDE 3

3/75

slide-4
SLIDE 4

4/75

Outline

 Example  Introduction  Trail  Definitions  Following the Trail  Conclusion

slide-5
SLIDE 5

5/75

Introduction

 Software total cost of ownership (TCO)

includes all the costs to acquire and keep a program running, from specifications to licenses to training

 Maintenance contributes between 50% and

90% of TCO [Erlikh, Lientz]

slide-6
SLIDE 6

6/75

Introduction

 Four factors impact maintainers [ISO9126]

– Software analysability

  • Their ability to identify and understand defects

– Software Changeability

  • The effort needed to change the software

– Software Stability

  • The sensitivity of the software to change

– Software Testability

  • The effort needed to test the software
slide-7
SLIDE 7

7/75

Introduction

 Two factors impact software analysability

– Software quality characteristics

  • ISO/IEC standards 9126:2001 and 25000:2005

decompose software quality into process quality, product quality, and quality in use

– Software products are the output of software processes. Product quality is determined by the degree to which the developed software meets the defined requirements

– Developers’ characteristics

  • Status, experience, education, gender
slide-8
SLIDE 8

8/75

Introduction

 Three dimensions characterise software

quality characteristics

– Functional vs. non-functional

  • At runtime vs. overall

– Internal vs. external

  • Maintainability vs. understandability

– Metric-based vs. practice-based

  • Objective vs. subjective
slide-9
SLIDE 9

9/75

Introduction

 Three dimensions characterise software

quality characteristics

– Functional vs. non-functional

  • At runtime vs. overall

– Internal vs. external

  • Maintainability vs. understandability

– Metric-based vs. practice-based

  • Objective vs. subjective
slide-10
SLIDE 10

10/75

Outline

 Example  Introduction  Trail  Definitions  Following the Trail  Conclusion

slide-11
SLIDE 11

11/75

Trail

 In this talk, we will discuss how to measure

the overall quality characteristics of maintainability and understandability

  • bjectively and subjectively
slide-12
SLIDE 12

12/75

Trail

Maintainability Understandability Quality Models Models Good Practices Definition Metrics Detection Occurrences Social Studies Characteristics Eye-tracking Studies Behaviour Factors Measures

slide-13
SLIDE 13

13/75

Outline

 Example  Introduction  Trail  Definitions  Following the Trail  Conclusion

slide-14
SLIDE 14

14/75

Definitions

 Maintainability

– Ease with which a software system can be modified [IEEE Standard Glossary of Software Engineering Terminology]

 Understandability

– Ease with which a software system can be understood [Boehm]

slide-15
SLIDE 15

15/75

Definitions

 Software code artefacts

– Source code, such as Java – UML-like models – …

 Labelled, weighted multi-graphs

slide-16
SLIDE 16

16/75

Definitions

 Business process artefacts

– Languages, such as BEPL – BPMN – …

 Labelled, weighted multi-graphs

slide-17
SLIDE 17

17/75

Outline

 Example  Introduction  Trail  Definitions  Following the Trail  Conclusion

slide-18
SLIDE 18

18/75

Trail

Maintainability Understandability Quality Models Models Good Practices Definition Metrics Detection Occurrences Social Studies Characteristics Eye-tracking Studies Behaviour Factors Measures

slide-19
SLIDE 19

19/75

Quality Models

Problem: how to measure software code artefacts? Solution: define and use quality metrics and models

slide-20
SLIDE 20

20/75

Quality Models

 Quality models

– A model with the objective to describe, assess and–or predict quality [Deissenboeck]

 Metrics  Models

slide-21
SLIDE 21

21/75

Quality Models

 Metrics have been well researched since the

early days of software engineering

– Chidamber and Kemerer – Hitz and Montazeri – Lorenz and Kidd – McCabe – …

(Don’t miss Briand et al.’s surveys on the metrics of cohesion and coupling)

slide-22
SLIDE 22

22/75

Quality Models

 Metrics alone are

meaningless

– Size vs. IQ – … – Hotness vs. IQ [Srivastava]

http://hardsci.wordpress.com/2013/09/17/the-hotness-iq-tradeoff-in-academia/

slide-23
SLIDE 23

23/75

Quality Models

 Few quality models exist

– Boehm’s – ISO9126 – McCall’s – QMOOD – …

slide-24
SLIDE 24

24/75

Quality Models

 Bansiya and Davis’ QMOOD

– Hierarchical model for OO designs – Structural and behavioural design properties of classes, objects, and their relationships

  • Reusability, flexibility, and complexity

– Object-oriented design metrics, such as

  • Encapsulation, modularity, coupling, and cohesion

– Validated using empirical and expert opinion on several large commercial systems

slide-25
SLIDE 25

25/75

Quality Models

 Difficulty to relate metric values with quality

characteristics, such as maintainability and understandability

 Difficulty to identify relevant metrics and

show that the metrics measure what they are expected to measure

slide-26
SLIDE 26

26/75

Quality Models

 Metrics

– 3QM-Framework [Overhage et al.] – ProM [Vanderfeesten et al.]

 Models

There probably exist more?

slide-27
SLIDE 27

27/75

Trail

Maintainability Understandability Quality Models Models Good Practices Definition Metrics Detection Occurrences Social Studies Characteristics Eye-tracking Studies Behaviour Factors Measures

slide-28
SLIDE 28

28/75

Good Practices

Problem: how to identify good/bad practices? Solution: collect and detect models of the practices

slide-29
SLIDE 29

29/75

Good Practices

 Software engineering development and

maintenance are based on a few principles

– SOLID – Do not reinvent the wheel – Beware of assumptions – …

slide-30
SLIDE 30

30/75

Good Practices

 Martin and Feather’s SOLID

– Single responsibility – Open/closed – Liskov substitution – Interface segregation – Dependency inversion

(Don’t miss Michael Feather’s keynote on Thursday on the software useful life)

slide-31
SLIDE 31

31/75

Good Practices

Each pattern describes a problem which

  • ccurs over and over again in our environ-

ment, and then describes the core of the solution to that problem, in such way that you can use this solution a million times

  • ver, without ever doing it the same way

twice. —Christopher Alexander, 1977

slide-32
SLIDE 32

32/75

Good Practices

Important assumptions

– That patterns can be codified in such a way that they can be shared between different designers. – That reuse will lead to “better” designs. There is an obvious question here of what constitutes “better”, but a key measure is maintainability.

—Zhang and Budgen, 2012 (With minor adaptations)

slide-33
SLIDE 33

33/75

Good Practices

slide-34
SLIDE 34

34/75

Good Practices

 Design Patterns

– A general reusable solution to a commonly

  • ccurring problem within a given context in

software design

 Design Antipatterns

– A design pattern that may be commonly used but is ineffective/counterproductive in practice

slide-35
SLIDE 35

35/75

Good Practices

 Pattern solution = Motif which

connotes an elegant architecture

slide-36
SLIDE 36

36/75

Good Practices

How to identify in the architecture

  • f a program

micro-architectures similar to design motifs to explain the problem solved?

Figure CompositeFigure AttributeFigure PolyLineFigure DecoratorFigure

To compose objects in a tree-like structure to describe whole–part hierarchies

Frame DrawingEditor Tool Handle Panel DrawingView Drawing Figure AbstractFigure CompositeFigure AttributeFigure PolyLineFigure DecoratorFigure Component
  • peration()
Leaf
  • peration()
Composite add(Component) remove(Component) getComponent(int)
  • peration()
ramification For each components component.operation() 1..n Client
slide-37
SLIDE 37

37/75

Good Practices

 What motifs and what model for these

motifs?

 What model for the program architecture?  How to perform the identification?

slide-38
SLIDE 38

38/75

Good Practices

 What motifs and what model for these

motifs?

 What model for the program architecture?  How to perform the identification?

Design Meta-model Design motifs and a motif meta-model

slide-39
SLIDE 39

39/75

Good Practices

 Multi-layer framework for design motif

identification

 Information retrieval

– Search space – Query – Results

slide-40
SLIDE 40

40/75

Good Practices

 Multi-layer framework

for design motif identification

Code Model Model + Associations, aggregations Model + Associations, aggregations, and composition

slide-41
SLIDE 41

41/75

Good Practices

 Constraint satisfaction problem solved with

explanation-based constraint programming (e-CP) to obtain

– No a priori descriptions of variations – Justification of the identified micro-architectures – Strong interaction with the developers

slide-42
SLIDE 42

42/75

Good Practices – Example

 Design motif ( )

Component

  • peration()

Leaf

  • peration()

Composite

add(Component) remove(Component) getComponent(int)

  • peration()

ramification

For each components component.operation()

1..n Client

slide-43
SLIDE 43

43/75

Good Practices – Example

 Example of JHotDraw

– Erich Gamma and Thomas Eggenschwiler – 2D drawing – Design patterns

slide-44
SLIDE 44

44/75

Good Practices – Example

Frame DrawingEditor Tool Handle Panel DrawingView Drawing Figure AbstractFigure CompositeFigure AttributeFigure PolyLineFigure DecoratorFigure

slide-45
SLIDE 45

45/75

Good Practices – Example

 Micro-architecture ( )  Maintainability  Understandability

Figure CompositeFigure AttributeFigure PolyLineFigure DecoratorFigure

slide-46
SLIDE 46

46/75

Component

  • peration()

Leaf

  • peration()

Composite

add(Component) remove(Component) getComponent(int)

  • peration()

ramification

For each components component.operation()

1..n Client

Frame DrawingEditor Tool Handle Panel DrawingView Drawing Figure AbstractFigure CompositeFigure AttributeFigure PolyLineFigure DecoratorFigure

e-CP

V = {component, leaf, composite} C = {leaf < component, composite < component, composite component} D = {DrawingEditor, DrawingView…}

slide-47
SLIDE 47

47/75

Frame DrawingEditor Tool Handle Panel DrawingView Drawing Figure AbstractFigure CompositeFigure AttributeFigure PolyLineFigure DecoratorFigure

e-CP

V = {component, leaf, composite} C = {leaf < component, composite < component, composite component} D = {DrawingEditor, DrawingView…}

< < < <

Component

  • peration()

Leaf

  • peration()

Composite

add(Component) remove(Component) getComponent(int)

  • peration()

ramification

For each components component.operation()

1..n Client

slide-48
SLIDE 48

48/75

Good Practices

 Search space can

be very large and the efficiency in time of the search very low

 Use metrics and

topology to reduce the search space

slide-49
SLIDE 49

49/75

Good Practices

 “Design” patterns

– Workflow patterns [van der Aalst]

 “Design” antipatterns

– In BPEL [Palma et al.]

More? Detection? Impact?

slide-50
SLIDE 50

50/75

Trail

Maintainability Understandability Quality Models Models Good Practices Definition Metrics Detection Occurrences Social Studies Characteristics Eye-tracking Studies Behaviour Factors Measures

slide-51
SLIDE 51

51/75

Social Studies

Problem: how to characterise developers? Solution: study developers’ social behaviours

slide-52
SLIDE 52

52/75

Social Studies

 Developers’ characteristics

– Gender

  • Males vs. females

– Professional status

  • Practitioner vs. Students

– Expertise

  • Experts vs. novices

(Don’t miss the sessions Developers, What are you Thinking? and Context)

slide-53
SLIDE 53

53/75

Social Studies

 Such studies are typically experiments

– Independent variable (few) – Dependent variables (many) – Statistical analyses – Threats to validity

slide-54
SLIDE 54

54/75

Social Studies

 For example, impact on identifiers on

program understandability

– Identifier styles [Sharif, Binkley] – Identifier quality [Lawrie] – Developers’ gender and identifiers [Sharafi] – …

slide-55
SLIDE 55

55/75

Social Studies

 Independent variables

– Gender: male vs. female – Identifier: camel case vs. underscore

 Dependent variables

– Accuracy – Time – Effort

slide-56
SLIDE 56

56/75

Social Studies

 Subjects  Conclusions

Subjects’ Demography (24 Subjects)

Academic background Gender

Ph.D. M.Sc. B.Sc. Male Female

11 10 3 15 9

Accuracy Time Effort

slide-57
SLIDE 57

57/75

Social Studies

 Threats to validity

– Construct validity

  • Measurements represent the construct being studied

– Internal validity

  • A causal conclusion based on the study is warranted

– External validity

  • Extent to which the results of the study can be

generalised to other contexts or developers

– Conclusion validity

  • Whether the presumed cause and effect covary
slide-58
SLIDE 58

58/75

Social Studies

 Few studies

– Notations [Recker, Reijers]

  • Understandability
  • Personal factors
  • Model factors

– Structuredness [Dumas et al.]

  • Understanding

– Others?

slide-59
SLIDE 59

59/75

Trail

Maintainability Understandability Quality Models Models Good Practices Definition Metrics Detection Occurrences Social Studies Characteristics Eye-tracking Studies Behaviour Factors Measures

slide-60
SLIDE 60

60/75

Eye-tracking Studies

Problem: how to study developers’ behaviour? Solution: study developers’ thought processes

slide-61
SLIDE 61

61/75

Eye-tracking Studies

 Developers’ thought processes

– Cognitive theories

  • Brooks’
  • Von Mayrhauser’s
  • Pennington’s
  • Soloway’s

– Mental models

  • Gentner and Stevens’ mental models

– Memory theories

  • Kelly’s categories
  • Minsky’s frames
  • Piaget’s schema
  • Schank’s scripts
slide-62
SLIDE 62

62/75

Eye-tracking Studies

 Studying developers’

thought processes

– Yarbus’ eye-movements and vision – Just and Carpenter’s eye-mind hypothesis – Palmer’s vision science – …

slide-63
SLIDE 63

63/75

Eye-tracking Studies

 Picking into developers’ thought processes

slide-64
SLIDE 64

64/75

Eye-tracking Studies

 Picking into developers’ thought processes

slide-65
SLIDE 65

65/75

Eye-tracking Studies

 Such studies are typically experiments

– Independent variable (few) – Dependent variables (many) – Statistical analyses – Threats to validity

slide-66
SLIDE 66

66/75

Eye-tracking Studies

 For example, impact of design pattern

notations

– Strongly visual [Schauer and Keler] – Strongly textual [Dong et al.] – Mixed [Vlissides] – …

slide-67
SLIDE 67

67/75

Eye-tracking Studies

 Independent variables

– Design pattern notations – Tasks: Participation, Composition, Role

 Dependent variables

– Average fixation duration – Ratio of fixations – Ration of fixation times

slide-68
SLIDE 68

68/75

Eye-tracking Studies

 Subjects

– 24 Ph.D. and M.Sc. students

 Conclusions

– Stereotype-enhanced UML diagram [Dong et al.] more efficient for Composition and Role – UML collaboration notation and the pattern- enhanced class diagrams more efficient for Participation

slide-69
SLIDE 69

69/75

Eye-tracking Studies

 Threats to validity

– Construct validity – Internal validity – External validity – Conclusion validity

slide-70
SLIDE 70

70/75

Eye-tracking Studies

 One study

– Relevant regions [Petrusel and Mendling]

  • Fixations
  • Fixation time

– Others?

slide-71
SLIDE 71

71/75

Outline

 Example  Introduction  Trail  Definitions  Following the Trail  Conclusion

slide-72
SLIDE 72

72/75

Conclusion

 How to measure the overall quality

characteristics of maintainability and understandability objectively and subjectively?

 Focus on source code artefacts modelled as

graphs, business process can be modelled as graphs too

slide-73
SLIDE 73

73/75

Conclusion

 Software code quality is based on the

modelling of code as graphs and on

– Quality metrics – Quality models – Good practices

and depends

– Experiences – Human factors

slide-74
SLIDE 74

74/75

Conclusion

 Business process quality could also be

based on the modelling of business process code as graphs and follow similar research directions as source code?

slide-75
SLIDE 75

75/75

Maintainability Understandability Quality Models Models Good Practices Definition Metrics Detection Occurrences Social Studies Characteristics Eye-tracking Studies Behaviour Factors Measures