# Comprehending Test Code: An Empirical Study

**Authors:** Chak Shun Yu, Christoph Treude, Maur\'icio Aniche

arXiv: 1907.13365 · 2019-08-01

## TL;DR

This empirical study investigates how developers comprehend Java test code, identifying key factors like prior knowledge and experience that influence reading time, understanding, and test case extension capabilities.

## Contribution

It provides new insights into the factors affecting test code comprehension, highlighting the roles of prior knowledge and experience in understanding and extending test suites.

## Key findings

- Prior knowledge reduces reading time
- Java experience influences test comprehension strategies
- Experience with automated tests improves extension ability

## Abstract

Developers spend a large portion of their time and effort on comprehending source code. While many studies have investigated how developers approach these comprehension tasks and what factors influence their success, less is known about how developers comprehend test code specifically, despite the undisputed importance of testing. In this paper, we report on the results of an empirical study with 44 developers to understand which factors influence developers when comprehending Java test code. We measured three dependent variables: the total time spent reading a test suite, the ability to identify the overall purpose of a test suite, and the ability to produce additional test cases to extend a test suite. The main findings of our study, with several implications for future research and practitioners, are that (i) prior knowledge of the software project decreases the total reading time, (ii) experience with Java affects the proportion of time spent on the Arrange and Assert sections of test cases, (iii) experience with Java and prior knowledge of the software project positively influence the ability to produce additional test cases of certain categories, and (iv) experience with automated tests is an influential factor towards understanding and extending an automated test suite.

## Full text

_Full body text omitted from this summary view._ Fetch the complete paper as Markdown: https://tomesphere.com/paper/1907.13365/full.md

## References

56 references — full list in the complete paper: https://tomesphere.com/paper/1907.13365/full.md

---
Source: https://tomesphere.com/paper/1907.13365