An Experiment to Measure the Cognitive Weights of Code Control Structures
David Adamo Jr.
Commonly used software complexity measures do not consider code comprehension
Cognitive complexity measures have been proposed to handle this
Web app presents users with code snippets and tracks response times
14 participants (computer science grad students), 22 code snippets, 3 snippets for each control structure
Normalize for length of snippets
Participant response time for code snippet i.
Normalized response time for code snippet i across all participants
Cognitive weight of a particular control structure
Control Structure Response Times
[1] J. Shao and Y. Wang. A new measure of software complexity. 2003.
[2] Y. Wang. A new measure of software complexity. 2006.
[3] P. A. McQuaid. The profile metric and software quality. 1997.
Additional control structures e.g. exception handling
Eye-tracking data may provide additional insight
Web app may be adapted for different purposes
Experiments with other programming paradigms e.g. functional and logic programming
By David Adamo Jr.