What’s in a Name? A Study of Identifiers – Dawn Lawrie

This is a talk on the most influential paper of 10 years ago. Dawn wanted to study the impact of identifiers names. For this work there were 3 hypotheses:

  • Full word identifiers are better for source code comprehension
  • Work experience or schooling leads to better scores on code comprehension
  • Gender plays a role in confidence but not code comprehension

As study topics, Dawn selected 12 functions, 6 from textbooks and 6 snippets from real projects. The requirement was that they had to fit on one sheet of paper.

There were 128 participants, of which 80 completed the all questions. 25% were students and 10% were women.

Full word identifiers are better for source code comprehension

the impact of identifiers names. Not in all cases a difference was found, but in 3 out of 12 cases there was a difference and in all those, the full word was better.

Gender plays a role in confidence but not code comprehension

Here there were some interesting findings. Women did worse on one letter variables, but there was no difference between abbreviations and full word identifiers. There have been a few follow up studies on this (I missed the title/authors unfortunately) One study found that there is no difference in accuracy or time, but there was a difference in style: women tend to gather more effort on considering alternative answers.

Look at this heat map of people being asked for the class name:

2016-05-17 09.37.53

Some reflections on the design of the study

In the past, many studies in SE just copied information retrieval studies and repeated them, for example: if a word is used often, it is important, but does that always hold for source code? Dawn says that we should more aim to be inspired by IR, rather than copy their setup.

Video with Dawn: