human) and should be experimentally studied. design ...renzo/cs485/hci-se.pdf · human) and should...

18
HCI of Software HCI of Software 1 Software (Engineering) is a subset of HCIs (CS/IT professionals are human) and should be experimentally studied. Software is expensive, major cost is human Software costs and production time Software reliability and maintenance Design Methodologies Tools CASE, UML, Patterns Interface Builders Program Practice / style Languages, API, Frameworks Software metrics: complexity, effort, KLOC requirements design implement verify / validate maintain

Upload: dangnhan

Post on 20-Mar-2018

214 views

Category:

Documents


1 download

TRANSCRIPT

HCI of Software HCI of Software 1

Software (Engineering) is a subset of HCIs (CS/IT professionals are

human) and should be experimentally studied.

Software is expensive, major cost is human

Software costs and production time

Software reliability and maintenance

Design Methodologies Tools

CASE, UML, Patterns

Interface Builders

Program Practice / style

Languages, API, Frameworks

Software metrics: complexity, effort,

KLOC

requirements

design

implement

verify / validate

maintain

Experimental support for indentation HCI of Software 2

Miara, R.J., Musselman, J.A., Navarro, J.A., Shneiderman, B., Program indentation and

comprehensibility, Communications of the ACM, 26, 1983

Experimental Variables

indentation space: 0, 2, 4, 6

indentation method:

non-blocked – indent first line after begin

blocked – first line flush with begin

expertise: novice ( < 3 years), expert ( > 3 years)

Dependent Variables

comprehension quiz

preference rating

Task: Study Pascal program (LOC = 102), no comments, no blank lines

take quiz, make preference rating

Quiz experience significantly better than novice (Surprise!)

level of indentation was significant (2 > 4, 6 == 0)

Preference Novices more affected by indentation, Blocked preferred

Control Flow & Data Structure Documentation HCI of Software 3

Sheniderman, B., Control flow and data structure documentation: two experiments. ,

Communications of the ACM, 25, 1982 http://dl.acm.org (search title)

Previous work w/ flowcharts had failed to obtain significant results:

"...critics cheered our results as justification...

adherents found fault and pronounced confidence in their own work..."

Program = control flow information + data structure information

Exp 1 - program comprehension

Experimental Variables (IVs)

program + input specifications (IS)

program + IS + psuedocode

program + IS + data structure graphic

Dependent Variables (measurements)

comprehension quiz

HCI of Software 4

Results

F

Program + IS 5.06

Program + IS + psuedocode 6.06

Program + IS + Data Structure 8.47

* significant p < 0.01

Interpretation

More information in psuedocode and data structures than just input

specifications.

Comparison of psuedocode and data structures is confounded since one

is textual and the other is graphic.

Mixing both media and information.

Need to separate information from media of presentation.

* *

Exp 2 HCI of Software 5

0

2

4

6

8

10

text graphics

Mediac

om

pre

he

ns

ion

DS

CF

Information (DS, CF) by Media (Text, Graphic)

A 2 by 2 factorial, between subject design

Source Info Media

flowchart control flow graphic

pseudocode control flow text

DS Diagram Data Structure graphic

DS Description Data Structure text

Results: Text Graphics

Data Structure 7.75 8.37

Control Flow 4.50 3.87

Info was significant p < 0.02

Media and Info by Media were non significant

Interpretation

Source and control flow is redundant information.

Data Structure information is new

GUI: scrollbar by item justification HCI of Software 6

Barnes, G.M. & Kellener, E.K, "Effects of scroll bar orientation and item justification in using

list box widgets", Proceedings of the Human Factors and Ergonomics Society 45th Annual

Meeting, 2001, pp 662-666.

24 participants in an Orientation (2) by Justification (3) by Width (2) by

Size (2). 3 main (! justification) and all 6 interactions were significant.

When item justification matched scroll bar orientation fastest and

preferred (significant 2 way interaction).

Support for locality (consistency) in UI design: consider task item and

task operator.

Software Complexity: HCI of Software 7

Understanding, developing, and maintaining software

Understanding software is central to:

implementation of designs

debugging

maintenance

Understanding software (or design) is a function of its complexity.

Complexity can be measured:

Structurally absolute Lines of Code

relative modules / calls

Logically graph # of paths

Comprehension is a function of logical flow, programming style, data

flow, + ...

McCabe's Complexity HCI of Software 8

Psychological complexity is a function of the paths (circuits) through a

program.

Program represented as a graph if directed edges -- cyclomatic number

estimates complexity:

V(G) = # edges - # nodes + 2 ( # connected components)

V(G) is approximated well by the number of logical predicates (tests) in

a program.

Program path changes only on a logical predicate.

V(G) measures modularity:

3 - 7 good design

+ 10 needs to be decomposed

V(G) correlates w/ programmers rating of code.

Halstead's Software Science HCI of Software 9

A program's complexity should be measured from its components (like

reading) Halstead determined several measures of software from:

n1 number of unique operators

n2 number of unique operands

N1 frequency of operators

N2 frequency of operands

program's vocabulary (n) = n1 + n2

implementation length (N) = N1 + N2

volume (V) = N (log2 n) // bits to represent

volume could be estimated from program specification

effort (E) = V (n1 / n2) (N2 / 2)

Halstead predicted time to complete programs from specs w/in 12% (for

assembler solns)

Similarity among software metrics HCI of Software 10

Numerous software metrics have been developed in response to McCabe

and Halstead.

There exist tools that measure requirements, specifications and software

complexity.

Curtis, B., Sheppard, S.B., Milliman, P., Borst, M.A., Love, T., Measuring the Psychological

Complexity of Software Maintenance Tasks with the Halstead and McCabe Metrics. IEEE

Transactions on Software Engineering, 1979, pp 96-104.

ccorrelated Halstead's Effort, McCabes V(G), and Lines of Code (LOC)

E V(G)

V(G) .84*

LOC .97 * .64* * p < 0.001

Jensen & Vairavan ('85) looked at real-time software complexity.

They found correlations between E and V(G) in the range of .70 to .92

across 5 sets of programs from different sources.

.93

.97 .99

.98 .98 .98

.90 .95 .95 .92

.82 .84 .83 .84 .72

.80 .67 .68 .66 .55 .46

.60 .62 .61 .71 .60 .59 .31

LO

C

Volu

me

Len

gth

V(G

)

Self

Oth

ers

Meth

ods

VolumeLength

V(G)Self

OthersMethods

Variables

OOP Metrics HCI of Software 11

Comparing software complexity measures in an OOP language (Actor):

ActQOOL (Barnes and Swim, Journal of Object Oriented Programming, 1993)

Self and Others are counts of messages sent to self or other methods

Methods and Variables are counts of local methods and variables in a

class

ActQOOL HCI of Software 12

SmallTalk like browser for code editing that also visually displayed

software metrics.

For example IndexedCollection a subclass of Collection

Class/Ancestor Syntax-Based Metrics:

num of lines 115/553

Fisheye software views HCI of Software 13

Jakobsen, M.R, & Hornbæk, K., Evaluating a Fisheye View of Source

Code, Proceedings CHI 2006, 2006.

Fisheye view Vs. common, linear presentation of source code.

16 participants performed some tasks significantly faster with the fisheye

view (complex results), and significantly preferred fisheye view.

devices 143D program visualization

I. Goldman's 3D program visualizer (2002)

devices 153D programming language

M.A. Najork S.M. Kaplan, 1991, The CUBE Language

devices 16Visual programming

Alice, Scratch (Snap!), Kodu game lab, App Inventor

Represents classes, methods (block code selection from drop down

lists)/

No syntax errors possible.

HCI of Software 17

Software can be measured & experimental software engineering can be

done !

Convergent evidence in Software Engineering

career / practice naturalistic

case studies naturalistic

expert opinions anecdotal / introspective

controlled studies hypothesis testing

Renewed interest in empirical research.

Where is the science in Computer Science?

How do you think the HCI of software design, development,

verification, validation, and documentation can be:

improved ??

studied ??

Related References HCI of Software 18

Binkley, D., Gold, N., Harman, M., An Empirical Study of Static Program Slice Size,

ACM Transactions on Software Engineering and Methodology,Vol. 16, No. 2, Article 8,

Publication date: April 2007.

Brandt, P.J., Lewenstein, J., Dontcheva, M., Klemmer, S.R., Two Studies of

Opportunistic Programming: Interleaving Web Foraging, Learning, and Writing

Code, CHI 2009, http://dl.acm.org (search title)

Murray, A., Lethbridge, T.C., On generating cognitive patterns of software

comprehension, CASCON '05 Proceedings, 2005, http://dl.acm.org (search title)

Myers, Brad and Ko, Andrew, The Past, Present and Future of Programming in

HCI (2009). Institute for Software Research. Paper 782.

http://repository.cmu.edu/isr/782

Rosson, M.B., Human Factors in Programming and Software Development,

ACM Computing Surveys, Vol. 28, No. 1, March 1996. http://dl.acm.org (search title)