Title: Using Sex Differences to Link Spatial Cognition and Program Comprehension
1Using Sex Differences to Link Spatial Cognition
and Program Comprehension
- Maryanne Fisher, Anthony Cox, Lin Zhao
- Presenter Manas Hardas
- Program Comprehension, Spring 2008
2Authors
Lin Zhao Dalhousie University Graduated in 2007
Maryanne Fisher Department of Psychology Saint
Mary's University Research Interests
Intrasexual Competition, Gender and Program
Comprehension
Anthony Cox Faculty of Computer Science
Dalhousie University Research InterestsHuman
Factors in Computing, Program Comprehension, and
Tool Use/Evaluation
3Whats it about?
- Spatial cognition and program comprehension are
cognitively similar tasks - Navigation through real maps (sort of spatial
cognition) is similar to navigation through code
(sort of program comprehension!) - Navigation through real maps is done using survey
maps or route maps approach. Whereas navigation
through code is done using top down or bottom up
approach.
4Continued
- Route maps based approach bottom up approach
cognitively low risk approach typical to
women - Survey maps based approach top down approach
cognitively high risk approach typical to men - Assuming of course that a high risk taker will
always take high risks and low risk taker will
always take less risks
5Introduction
- New cognitive skills are developed on previously
acquired skills. Each new task doesnt need whole
new set of skills ! (Chown et.al. 95, Clark 89)
- Program comprehension being relatively new, the
cognitive skills required for it must be
developed from existing ones ! i.e. spatial
cognition. - Navigation skills in real-space is similar to
those in virtual space (Vinson, 99).
6Codespace
- Mental map of source code codespace
- Mental maps or codespace uses spatial imagery
(Green 95,97, Douce et.al. 99) - Thus mental map concepts are in context of
space ! - Programmers must form mental maps because they
dont navigate sequentially and can jump between
code artifacts (Mosemann and Wiedenback 01). - Thus,
- navigation of source code ? program comprehension
- navigation of source code ? navigation in real
time - navigation in real time ? spatial cognition
- Therefore, program comprehension ? spatial
cognition !!!
7Program Comprehension
Program Comprehension
- source code
mental models - Topdown Form hypothesis and go on validating
or dismissing them going from high level to low
level of abstraction (Brooks 83, Soloway et.al.
84) - Bottom-up Construct control flow program model
to concept based situation model going from low
level to high level of abstraction (Pennington
87) - Opportunist Based on experience use as needed
(von Mayrhauser 94) - However all strategies need software navigation.
8Spatial cognition
- A process composed of a series of psychological
transformations by which an individual acquires,
stores, recalls, and decodes information about
the relative locations and attributes of the
phenomena in their everyday spatial environment.
(Downs and Stea 73) - Simply put, cognitive skills that enable you to,
- learn
- memorize
- remember
- and interpret
- objects, their location and other attributes
(length, width, physical proximity etc.) in a 3-D
space. - Just like driving (navigating) your car !
9Spatial cognition elements
- Way finding Ability to find your way using
- Landmarks
- Route maps sequence of instruction involving
landmarks - Survey maps topological maps describing spatial
layout - 75 of population use route maps (Appleyard 69)
- Person uses strategies on individual preference
(Aginsky 97) - Person uses multiple strategies (Kitchin 97)
- People with better sense of direction used
multiple strategies and switched more
appropriately (Kato and Takeuchi 2003).
10Elements of spatial cognition continued
- Object location memory Ability to recall
position of objects - Different levels of abstraction (recalling where
your toe is, is way different than recalling
where the student center is!) - Ability measure using test developed by Silverman
and Eals (1992), modified by James and Kimura
(1997) to also include location shift or location
exchange.
11Elements continued
- Mental rotation Ability to manipulate a 3-D
object such that we can visualize the object from
different perspective. - Measure using Vandenburg and Kuse (1978) mental
rotation test. Given a 2-D image, identify its
3-D image from different solutions. - Thus spatial cognition is a complex task
consisting of way finding, object location and
mental rotation like tasks which are often
performed opportunistically as is program
comprehension.
12Difference between men and women!
- Risk taking It is well established that men
take more risks than women (Daly and Wilson
2001) - More code more mistakes. Therefore, women must
tend to write shorter pieces of code and compile
more often ? women must be using more bottom-up
lower risk approach to assist their style of
debugging! - Persons risk taking behavior remains constant.
(reference needed) - Thus, women bottom-up approach low level of
abstraction similar to landmark (object)
identification use route-based navigation - Huge leap in assumptions !!!
- women can just be better designers!
- risk taking in social life may not necessarily
imply risk taking in software development! (maybe
rash driving has a correlation)
13differences continued
- Men top-down approach high level abstraction
similar to mental rotation used by survey
based navigation ! - Assumption here is that, every person uses same
skills to perform a particular task. Can I use my
cognitive skills I developed to eat, for reading
tasks. Or rather, can I use someone elses
cognitive skills he/she developed to eat, to
read?
14Comparing spatial cognition and program
comprehension
- Although it seems that there are similarities in
both there are actually significant details when
examined carefully. - These differences are only brought out when
discussed in context of sex differences i.e.
risks involved in both - Both have low risk tasks (route-based navigation
and bottom-up program comprehension) and high
risk tasks (survey-based navigation and top-down
program comprehension) which are only brought to
light when discussed in terms of men and women.
15Experimental validation
- Setup
- Test the use of spatial cognition (object
location and mental rotation) as they are used in
the codespace - Participants asked to perform maintenance on 300
line Java calculator program consisting of 1
class and 10 functions (small code for high
quality of experiments) - Post maintenance questionnaire to test
- 30 participants (7 undergrad and 23 grad, 3 from
Engineering, 2 from science and 25 from computer
science) - Half male with average age 27, half female avg.
age 25
16Procedure
- Three tasks
- Switch positions of two buttons
- Change type of variable from primitive type
double to class Double - Change background color to blue and button to
magenta
17Post maintenance tasks
- After maintenance, participants sort methods as
they appeared in the code (test for recall,
object location) - Participants locate method in particular lines of
code (0-75, 76-150 etc.) (test for location) - Participants were then given pairs of methods and
guess which occurred first (test for location
with respect to another method) - Participants guess length of methods (test for
object recall) - Participants were then given pairs of methods and
guess LOC between the two methods (test for
location w.r.t. each other) - Participants take Vandenburg and Kuse mental
rotation test.
18Findings
- Location and Object memory
- No significant difference between men and women!
(a 0.05) - Location memory significantly correlates with
post maintenance task 1, 3 and method sort, but
men perform bad in location memory task.
Therefore correlation is a sequence of womens
abilities. - Womens location memory highly correlated to
cards sort as against mens. - Object memory not correlated for post maintenance
tasks for either, however significantly
correlated to womens maintenance tasks.
19Findings
- Mental Rotation
- No significant difference for either.
- Womens mental rotation did not significantly
correlate but mens does for maintenance tasks.
Inference
- Women have high correlation for object memory
and location memory which is a more route map
based bottom up approach while men have
significant correlation with mental rotation
which is essentially a survey map based top down
approach.
20Future Work
- Landmarks Beacons (sort of)
- Use for navigation by feature location
- Composition of landmarks by beacons
- Roles in program comprehension and spatial
cognition - Visual Subsystem
- Human visual system of contour identifies object
and human visual location system determines
spatial location (spatial cognition) - How humans look for concepts in source code
- Risk taking during comprehension
- Risk taking behavior determines which approach
for comprehension
21Conclusion
- Program comprehension is correlated to spatial
cognition in terms of navigation - Difference between men and women in risk taking
highlight similarities between PC and SC. - Complex model and experiment, not completely
conclusive. - Results can help in creating tailored tools for
program comprehension (instead of tailored
people!) - Will help educators
- Depending on sex based differences, instruction
can be tailored based on the population
22Thoughts
- Good paper!
- Well written and straight forward, has its short
comings an makes some big assumptions but not
hesitant to mention them. - Conspicuously lacking in figures and tables
because of unnecessarily complex non symmetrical
experimentation or presentation of results. - The idea of relating cognitive skills required to
comprehend programs may be similar to cognitive
skills required in spatial cognition is
interesting. Should look at other tasks which
could need similar skills, script/story/poetry
writing?!!!
23Thank you! Questions?