Characterizing Structural Testability in JavaScript: An Empirical Study
Software testability has long been recognized as a software quality attribute that influences testing effort and effectiveness. While prior work has extensively studied testability in object-oriented systems and, more recently, concurrent software, comparatively little is known about how structural testability manifests in modern JavaScript ecosystems. JavaScript applications rely heavily on asynchronous execution, event-driven control flow, closures, and dynamic interactions, yet these constructs are not explicitly captured by existing testability frameworks. This paper presents a large-scale empirical study of structural testability in JavaScript systems. To enable this study, we operationalize structural testability as a seven-dimensional construct capturing controllability, observability, branching complexity, asynchronous coordination, event-driven behaviour, encapsulation, and side-effect intensity. These dimensions are derived from AST-based static analysis and aggregated into a Composite Testability Score (CTS) that supports comparative analysis across functions, files, and projects. We apply this framework to 30 open-source JavaScript projects spanning diverse domains and sizes. Our analysis characterizes the distribution of structural testability, identifies recurring structural archetypes among low-CTS functions, and examines associations between project characteristics and testability patterns. We find that structurally-challenging functions are concentrated within a relatively small subset of files and emerge through multiple recurring structural configurations rather than a single dominant pattern. At the ecosystem level, project activity and size exhibit stronger associations with structural testability than project age, popularity, or framework choice. These findings provide new insight into how structural testability manifests in modern JavaScript systems and establish a foundation for future studies of testing effort, test generation effectiveness, testability-aware refactoring, and software quality assessment in dynamic and event-driven environments.
Tue 15 SepDisplayed time zone: Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna change
16:00 - 16:55 | Code QualityResearch Track / Engineering Track at A51S Chair(s): Yutaro Kashiwa Nara Institute of Science and Technology | ||
16:00 18mTalk | Characterizing Structural Testability in JavaScript: An Empirical Study Research Track | ||
16:18 18mTalk | IntentProbe: Turning Source/Specification Mismatches into Executable Probes for Hidden-Failure Triage Research Track Shenzhou Liu School of Computer Science, Wuhan University | ||
16:36 18mTalk | Precise Taint Analysis built on Symbolic Execution Engineering Track | ||