Gaze2Src - Getting Started


  • Python 2.7
    • Windows path entry
  • srcML (develop branch version, or 1.0 release)
    • Necessary if you intend to generate your own srcml input file
    • Windows path entry
  • lxml

Proposed Toolchain:

  1. Integrates data from core and plugins
  2. Computes source code tokens and syntatic context from line/col data
  3. Applies fixation filters to raw gaze data
  4. Renders highlighted tokens based on fixation data

Fixation Filters

  • basic: Generic area based fixation algorithm.
  • ivt: Calculate velocitiy based fixations. Remove high velocity gazes to create clusters of slower eye movements, then filter those clusters to ensure they meet a minimum fixation length to get the final set of fixations.
  • idt: Calulate dispersion based fixations. These are sequences of gazes (of at least a minimum length) where the sum of the maximum difference in x values and the maximum difference in y values is less than the dispersion threshold.

Processing Source Code Using srcML

It is necessary to provide gaze2src with an XML marked up version of the source code under study using srcML. This can be done with the following command:

srcml [source code] --position -o output.xml

In the command above, source code can be individual files, a directory, a compressed archive, or any combination of the three. The position option addes details concerning line and column information of the original source code. If there are issues with position data encoded into the output XML such as invalid positions, you can supplement the above command with the option --jobs 1 which may resolve the issue.

For additional information about srcml, please visit

Example Usage:

Basic usages requires the following:

python [path to core xml file] [path to plugin xml file] [path to srcml generated xml of source code] -o [Output directory to store results and intermediate files] -f [fixation filter]

More advanced usage allows for fixation filter parameters to be applied during processing. Listed below are the options and to what filters they apply.

window (-w) X   X
peak (-p) X    
radius (-r) X    
velocity (-v)   X  
duration (-u)   X  
dispesion (-s)     X

In the event that a filter parameter is set that is not applicable to the chosen filter the value will simply be ignored.

Results from running gaze2src include:

  • a complete sqlite3 database of all raw data, source code tokens and syntatic context, and fixation IDs associated with each raw gaze data point
  • a TSV file showing the calculated fixations, IDs, and tokens
  • an html version for each source code file viewed with the source code tokens for each fixation highlighted