Test Code Comprehension: Insights from an Eye Tracker

More Info
expand_more

Abstract

Software maintenance is an essential and time-consuming task during the software development cycle. Readability of test code is a crucial element for performing programming tasks, such as testing, bug fixing and maintaining code. Hence poorly written tests are difficult to maintain and lose their value to developers. In order to overcome this problem, we need to understand how programmers read the test code. Therefore we conducted an empirical study to analyze the various reading patterns in novices and professionals using a sophisticated eye tracking device. Our results show that (i) all programmers first comprehended the production code and then switched between test and production codes, (ii) novices had higher fixations reading test code and assert statements, (iii) professionals revisited the test code more than novices, (iv) professionals had significantly lesser test code coverage than novices, and (v) there is a significant difference in reading test code between novice and professionals.