• Tidak ada hasil yang ditemukan

Cognitive Support during Object-Oriented Software Development: The Case of UML Diagrams

N/A
N/A
Protected

Academic year: 2024

Membagikan "Cognitive Support during Object-Oriented Software Development: The Case of UML Diagrams"

Copied!
12
0
0

Teks penuh

(1)

http://researchspace.auckland.ac.nz

ResearchSpace@Auckland

Copyright Statement

The digital copy of this thesis is protected by the Copyright Act 1994 (New Zealand).

This thesis may be consulted by you, provided you comply with the provisions of the Act and the following conditions of use:

Any use you make of these documents or images must be for research or private study purposes only, and you may not make them available to any other person.

Authors control the copyright of their thesis. You will recognise the author's right to be identified as the author of this thesis, and due acknowledgement will be made to the author where appropriate.

You will obtain the author's permission before publishing any material from their thesis.

To request permissions please use the Feedback form on our webpage.

http://researchspace.auckland.ac.nz/feedback

General copyright and disclaimer

In addition to the above conditions, authors give their consent for the digital copy of

their work to be used subject to the conditions specified on the Library Thesis

Consent Form.

(2)

Cognitive Support during Object-Oriented Software Development: The Case of UML

Diagrams

Gay Florence Costain

A thesis submitted in partial fulfillment of the requirements for the Degree of Doctor of Philosophy in the

Department of Information Systems and Operations Management, The University of Auckland, 2007.

(3)
(4)

Abstract

The Object Management Group (OMG) accepted the Unified Modelling Language (UML) as a standard in 1997, yet there is sparse empirical evidence to justify its choice. This research aimed to address that lack by investigating the modification of non-trivial, object-oriented computer programs for which external representations, drawn using the UML notations most commonly used in industry, were provided. The aim of the research was to discover if diagrams using those UML notations provided the program modifier with cognitive support.

Interviews were carried out in New Zealand and North America to discover how workers in the software industry used modelling, and if so, whether UML notations satisfied their needs. The most preferred UML diagrams were identified. A framework of modelling use in software development was derived, from which the use of models to assist program modification was chosen for the current research.

A methodology for detecting cognitive support provided by external representations during problem solving was derived, and applied for the case of UML documentation.

Subjects were required to modify two non-trivial programs, one of which was supplied with UML documentation. There were two aspects to the methodology. First, the subjects’ performances with and without the aid of UML documentation were compared. Modifying a program is an exercise in problem solving which is a cognitive activity. If the use of UML improved subjects’ performances then it could be said that the UML had aided the subjects’ cognitions. Second, concurrent verbal protocols were collected whilst the subjects modified the programs. The protocols for the modification with UML documentation, for ten of the more successful subjects, were transcribed and analysed according to a framework derived from the literature. The framework listed the possible cognitive steps involved in problem solving where cognition could be distributed to and from external representations. The categories of evidence that would confirm cognitive support were also derived.

The experiments confirmed that programmers from similar backgrounds varied widely in ability and

style. Twenty programmers modified both an invoice application and a diary application. There was

some indication that the UML diagrams aided performance. The analyses of all ten of the transcribed

subjects showed evidence of UML documentation providing cognitive support.

(5)

iv

Acknowledgments

I have so many to thank for their valued support for this research – I could not have done it alone.

My heartfelt thanks must go to:

Dr. Ananth Srinivasan – for his very patient leadership over the years of research.

Dr. Jairo Gutierrez – for his constructive comments.

Dr. Tiru Arthanari – for his advice on statistics.

Dr. Beryl Plimmer – for being an excellent VB.NET lecturer, for supplying the idea for the initial diary application, and for her moral support.

Katherine Costain – for arranging and project managing the interviews at Company A, and for her ongoing love and support.

Laurie Fenkner – for arranging and project managing the interviews at Company B, and for her ongoing love and support.

Heather Moodie – for a very thorough and skilled proof reading of the paper.

Helen Braddock – for her expert advice on the idiosyncrasies of MS Word and for handling the printing.

I must also thank the interviewees and subjects who willingly gave up their time to contribute to this research, and without whom there would be no research.

I should also thank my rowing buddies for keeping me sane over this last intense year.

Last – but certainly not least – I must thank my beloved husband Chris for his tolerance and great patience in waiting for all this to end.

Gay Costain

(6)

Table of Contents

Chapter Description Page

1 INTRODUCTION . . .

1

1.0 Introduction to research

. . . .

1

1.1 Background

. . . .

2

1.2 Aim of this research

. . .

4

1.3 Research process

. . .

5

1.4 Thesis organisation

. . .

6

1.5 Contribution of the research

. . .

7

1.6 Conclusion

. . .

8

2 LITERATURE REVIEW . . . . 9

2.0 Introduction

. . .

9

2.1 Human problem solving

. . .

11

2.1.1 General problem solving

. . .

11

2.1.2 Software design as an ill-structured problem

. . .

12

2.2 Human cognition

. . .

13

2.2.1 Generic cognitive theory

. . .

13

2.2.2 Applying cognitive theory to software development

. . .

15

2.2.3 Rule induction in problem solving and software development . . . 16

2.2.3.1 Rule induction in problem solving . . . 16

2.2.3.2 Rule induction and computational co-evolutionary design for OO software development . . . 17

2.3 Cognitive differences between experts and novices in software development 19 2.4 Distributed cognition and external representations . . . 20

2.4.1 Distributed cognition

. . .

20

2.4.2 External representations

. . .

21

2.4.2.1 Introduction

. . .

21

2.4.2.2 Computational offloading

. . .

22

2.4.2.3 Representation

. . .

23

2.4.2.4 Graphical constraining

. . .

23

2.4.2.5 Summary

. . .

24

2.4.3 Secondary notation

. . .

24

2.4.4 Benefits of ‘learned’ notations

. . .

25

2.4.5 External representations as an aid to program comprehension . . . 26

2.4.6 External representations as part of the memory set for solving a problem

. . .

27

2.4.7 The UML notation for external representations in OO software development

. . .

30

2.5 Framework for cognitive steps in problem solution using external representations

. . .

33

2.6 Conclusion

. . .

37
(7)

Chapter Description Page

3 EXPLORATORY INTERVIEWS

. . . 39

3.0 Introduction . . . 39

3.1 The interviewees . . . 40

3.2 The interviews . . . 40

3.3 What was discovered from the interviews . . . 42

3.3.1 Company A . . . 42

3.3.1.1 Company software development philosophy . . . 42

3.3.1.2 Visual Studio Department. Interviewee 1 (I1): Development Manager . . . 43

3.3.1.3 Visual Studio Department. Interviewee 2 (I2): Program Manager . . . 44

3.3.1.4 Handwriting Recognition Department: Interviewee 3 (I3): Software Architect . . . 45

3.3.1.5 Office division. Interviewee 4 (I4): Lead Marketing Research Manager . . . 46

3.3.2 Company B: Longitudinal study of modelling . . . 47

3.3.2.1 Introduction. Interviewee 5 (I5): Product Manager . . . 47

3.3.2.2 Software development environment . . . 47

3.3.2.3 Modelling in 2001 . . . 48

3.3.2.4 2002: What developers were doing one year later . . . 51

3.3.2.5 2003: What developers were doing eighteen months later 54 3.3.3 Interviewee 10 (I10): Software development methodology designer 61 3.3.4 New Zealand: Interviewee 11 (I11): Software Development Team Leader . . . 61

3.3.5 New Zealand: Interviewee 12 (I12): Data Administrator . . . 63

3.3.6 Non-modeller: Interviewee 9 (I9): Computer Scientist . . . 65

3.4 How the interviewees used modelling . . . 67

3.4.1 Discussion about the exploratory interviews . . . 67

3.4.2 Categorisation of interviewees’ use of modelling . . . 68

3.4.3 Translationists . . . 68

3.4.4 Non-translationists . . . 69

3.4.4.1 Introduction . . . 69

3.4.4.2 Offloading ideas from working memory . . . 69

3.4.4.3 Modelling to communicate, share and develop ideas with others . . . 71

3.4.5 Most popular diagrams . . . 73

3.4.6 Problems with UML as perceived by interviewees . . . 74

3.5 How the modelling use discoveries impact future research . . . 75

3.6 Conclusion . . . 77

vi

(8)

Chapter Description Page

4 METHODOLOGY

78

4.0 Introduction . . . 78

4.1 Research questions . . . 81

4.1.1 Research question related to programmer performance . . . 81

4.1.2 Research questions related to programmers’ cognitive behaviours 81 4.1.2.1 Introduction: the framework . . . 81

4.1.2.2 Cognitive behaviour questions: UML usage and cognitive support . . . 84

4.2 Verbal protocol collection . . . 86

4.2.1 Introduction . . . 86

4.2.2 ‘Thinking aloud’ – concurrent verbal reports . . . 87

4.2.3 Concurrent verbal protocol collection of data – some concerns . . . 89

4.2.3.1 Verbalisation slows thought processes . . . 89

4.2.3.2 Variation in subject ability to verbalise whilst doing a task . . . 89

4.2.3.3 Monitor interference . . . 90

4.2.3.4 Sample sizes . . . 91

4.2.3.5 Effects of session times . . . 93

4.2.3.6 Encoding of transcriptions . . . 94

4.3 Challenges for empirical work with programmers . . . 96

4.3.1 Programmer variability, novices and experts . . . 96

4.3.2 Concerns for program modification use in an experiment . . . 97

4.3.3 Program presentation for comprehension and modification . . . 97

4.4 Method procedures . . . 98

4.4.1 Introduction . . . 98

4.4.2 The applications . . . 99

4.4.3 The subjects . . . 100

4.4.4 The venue . . . 100

4.4.5 Session timing . . . 100

4.4.6 Pre-session practice . . . 100

4.4.7 Monitor intervention . . . 100

4.4.8 Pre- and post-session questions . . . 101

4.4.9 Pilot run . . . 101

4.4.10 Transcription . . . 101

4.5 Conclusion . . . 101

5 THE EXPERIMENTS AND HOW THE PARTICIPANTS PERFORMED

. . . 103

5.0 Introduction . . . 103

5.1 The applications . . . 104

5.2 The modifications . . . 106

5.3 The UML documentation . . . 107

5.4 The subjects . . . 109

5.5 The experiments . . . 109

5.6 Performance results for participants . . . 110

5.7 Research question discussion . . . 121

5.8 Conclusion . . . 123

(9)

Chapter Description Page

6 RESULTS: BEHAVIOUR

. . . 124

6.0 Introduction . . . 124

6.1 Verbal protocol performance . . . 127

6.2 Explanation of notation used in the narrative summaries . . . 127

6.3 Explanation of notation used in behaviour graphs . . . 128

6.4 Industry-experienced subjects’ results . . . 130

6.4.1 Introduction . . . 130

6.4.2 Summaries and behaviour graphs . . . 131

Subject 04 . . . 132

Subject 09 . . . 140

Subject 15 . . . 142

Subject 16 . . . 152

Subject 17 . . . 167

Subject 18 . . . 178

Subject 20 . . . 180

6.4.3 Collation of results from industry-experienced subjects . . . 194

6.4.3.1 Introduction . . . 194

6.4.3.2 Using UML documentation to assist with comprehension 194 6.4.3.3 Using UML documentation in a set with the problem space . . . 195

6.4.3.4 Using UML documentation for offloading from working memory . . . 195

6.4.4 Conclusion for industry-experienced group . . . 198

6.5 Student subjects without industry experience . . . 198

6.5.1 Introduction . . . 198

6.5.2 Summaries and behaviour graphs . . . 199

Subject 01 . . . 200

Subject 02 . . . 202

Subject 03 . . . 210

Subject 05 . . . 216

Subject 07 . . . 225

Subject 13 . . . 232

Subject 21 . . . 243

6.5.3 Collation of results from non-industry-experienced subjects . . . 246

6.5.3.1 Introduction . . . 246

6.5.3.2 Using UML documentation to assist with comprehension 246 6.5.3.3 Using UML documentation in a set with the problem space . . . 247

6.5.3.4 Using UML documentation for offloading from working memory . . . 247

6.5.4 Conclusion for non-industry-experienced group . . . 249

6.6 Using the results to answer the research questions . . . 250

6.7 Conclusion . . . 252

viii

(10)

Chapter Description Page

7 DISCUSSING THE FINDINGS

. . . 254

7.0 Introduction . . . 254

7.1 The interviews . . . 255

7.1.1 Introduction . . . 255

7.1.2 Challenges and limitations . . . 255

7.1.3 What was found out from the interviews . . . 255

7.1.4 Conclusion . . . 257

7.2 Performance results . . . 258

7.2.1 Introduction . . . 258

7.2.2 Challenges and limitations . . . 259

7.2.3 Performance results . . . 260

7.3 Results of cognitive behaviour experiments . . . 261

7.3.1 Introduction . . . 261

7.3.2 Concurrent verbal protocol collection . . . 261

7.3.3 Results of analysis . . . 263

7.3.3.1 General discussion . . . 263

7.3.3.2 The framework . . . 266

7.3.3.3 Evidence of UML providing cognitive support . . . 268

7.3.4 Conclusions for cognitive behaviour analysis . . . 271

7.4 Conclusion . . . 271

8 CONCLUSION . . . 272

APPENDICES

. . . 276

A Interview plan . . . 277

B Invoice application: Invoice form screen dump . . . 279

C Diary application: Diary form screen dump . . . 280

D Invoice application documentation . . . 281

Modification requirements . . . 282

Use case model . . . 283

Use case description for ‘Create invoice’ . . . 284

Use case description for ‘Add customer’ . . . 285

Use case description for ‘Add product’ . . . 286

Class diagram for invoice application . . . 287

Sequence diagram for ‘Create invoice’ . . . 288

Sequence diagram for ‘Print invoice’ . . . 289

E Diary application documentation . . . 290

Modification requirements . . . 291

Use case model . . . 292

Use case description for ‘Add appointment’ . . . 293

Use case description for ‘Change appointment’ . . . 294

Use case description for ‘Delete appointment’ . . . 295

Class diagram for diary application . . . 296

Sequence diagram for ‘Add appointment’ . . . 297

LIST OF REFERENCES . . . 298

(11)

List of Tables

No. Description Page

2.1 Framework for categorising cognitive steps in problem solving with the assistance

of system models as external representations 35

3.1 Profiles of interviewees 41

3.2 Categories of modelling use in software development 69

3.3 How models were used to communicate ideas to others 71

3.4 Interviewees’ subjective perceptions of problems with UML 74

4.1 (copy of 2.1) Framework for categorising cognitive steps in problem solving with

the assistance of system models as external representations 83

4.2 Table showing number of subjects used for verbal protocol collection in software

engineering research. 92

4.3 Verbal protocol cognitive episode categories for solving a problem with the

assistance of external representations (extracted from Table 4.1) 95

5.1 Subject profiles 105

5.2 Post-session comments from participants 108

5.3 Sub-goals to be achieved to complete the invoice modification 111

5.4 Sub-goals to be achieved to complete the diary modification 112

5.5 Non-formatting sub-goals achieved by subjects in invoice modification 113

5.6 Sub-goals achieved by subjects in diary modification 114

5.7 Subjects’ percentage success at achieving sub-goals in invoice and diary

modifications 115

5.8 Previous experience of subjects in coding invoice and diary applications 116 5.9 Subjects grouped as to which modification they attempted first, and diagram

distribution 117

5.10 Subjects grouped with modification with UML documentation listed first 119 5.11 Subjects grouped according to which application they modified, and sequence 120 5.12 Sub-goal achievement for subjects with at least one modification % achievement

>=50% 121

6.1 (copy of 4.3) Verbal protocol cognitive episode categories for solving a problem

with the assistance of external representations 128

6.2 Legend for cue/destination codes for behaviour graph episodes 129

6.3 How the episodes that involved UML documentation were applied; for six subjects

with industry experience 196

6.4 Episodes that demonstrate cognitive support supplied by UML documentation for

industry-experienced subjects 197

6.5 How the episodes that involved UML documentation were applied; for five non-

industry-experienced subjects 248

6.6 Cognitive support supplied by UML documentation for non-industry-experienced

subjects 249

7.1 (copy of 6.5) How the episodes that involved UML documentation were applied;

for five non-industry-experienced subjects 264

7.2 (copy of 6.3) How the episodes that involved UML documentation were applied;

for six subjects with industry experience 264

7.3 (copy of 6.6) Cognitive support supplied by UML documentation for non-industry-

experienced subjects 267

7.4 (copy of 6.4) Episodes that demonstrate cognitive support supplied by UML

documentation for industry-experienced subjects 267

7.5 Episodes where plan and design schemas were formed by subjects 268

7.6 Number of episodes providing evidence of UML cognitive support 270

x

(12)

List of Figures

No Description Page

2.1 An information processing model (Mayer, 1989) 14

2.2 A model of co-evolutionary design (Maher & Tang, 2003) 17

2.3 Cognitive framework for the rule development process in Object-oriented design

(Kim et al., 1995) 18

2.4 The theoretical framework of distributed representations (Zhang & Norman, 1994) 28 2.5 Representational system showing knowledge flow for a distributed cognitive task

for an individual problem solver 30

2.6 General organisation of a problem solver (Newell & Simon, 1972, p.89) 34 4.1 Chart of number of participants versus average transcribed session time in minutes

per participant for verbal protocol collection in software engineering research. 93 4.2 Template for documentation of a categorised episode in behaviour graph 96 6.1 (copy of 4.2) Template for cognitive activity episode in behaviour graph 128

6.2 Sample section of behaviour graph 130

6.3 Behaviour graph for Subject 04: 1st modification: invoice app. with documentation 137 6.4 Subject 09’s offloading onto paper during modification of the diary application

without the aid of UML documentation 141

6.5 The diary form as modified by Subject 15 143

6.6 Behaviour graph for Subject 15: 1st modification: diary app. with documentation 148

6.7 Diary form as modified by Subject 16 155

6.8 Subject 16’s offloading to a structure diagram during his first modification of the

diary application with UML documentation. 159

6.9 Some of Subject 16’s offloading to paper whilst modifying the invoice application

without UML documentation – his second modification 160

6.10 Behaviour graph for Subject 16: 1st modification: diary app. with documentation 161 6.11 Copy of Subject 17’s sketch of the DateTimeBody inheritance hierarchy 172 6.12 Behaviour graph for Subject 17: 1st modification: invoice app. with documentation 174 6.13 Behaviour graph for Subject 20: 2nd modification: invoice app. with

documentation 187

6.14 What Subject 01 offloaded to A3 paper whilst modifying the invoice application

without UML documentation 201

6.15 Behaviour graph for Subject 02: 2nd modification: invoice app. with

documentation 207

6.16 Behaviour graph for Subject 03: 1st modification: diary app. with documentation 214

6.17 Diary form as modified by Subject 05 217

6.18 Subject 05’s offloadings during modification of the diary application with the

assistance of UML documentation 221

6.19 Behaviour graph for Subject 05: 1st modification: diary app. with documentation 222 6.20 Behaviour graph for Subject 07: 2nd modification: invoice app. with

documentation 229

6.21 Diary form as modified by Subject 13 233

6.22 Form for data entry of the reminder for the appointment, for Subject 13 233 6.23 Behavior graph for Subject 13: 2nd modification: diary app. with documentation 240 6.24 Subject 21’s offloading whilst modifying the invoice application with supplied

UML documentation 244

6.25 Subject 21’s offloading whilst modifying the diary application with no UML

documentation 244

7.1 Chart of number of subjects versus average transcribed session time in minutes per

Referensi

Dokumen terkait