An Exploratory Study of Decorators in the TypeScript Programming Language

Decorators are a feature of the TypeScript language that allows the configuration of additional metadata on code elements, such as members, methods, and the class definition itself. It has been officially supported only since version 5.0. This feature also exists in other languages, such as Java annotations and C# attributes. To understand and further study how developers use decorators, we conducted an exploratory study on 30 real-world, open-source, and popular projects hosted on GitHub. To extract the characteristics of decorators from the analyzed projects, the DSniffer (Decorators Sniffer) was developed. It can collect source code metrics’ values dedicated to metadata configuration. Among the results obtained, it was observed that 46% of the projects use decorators, among which we highlight some popular ones such as Angular and Visual Studio Code. We also noted that decorators use at most four parameters, but these can be quite complex objects, occupying up to 84 lines of source code. Thus, the study reveals high numbers of decorators in the projects and many repeated metadata configurations. This can negatively impact the readability of the source code and compromise maintenance. The study carried out in this work can serve as a basis for defining reference values or implementing a software visualization approach.

Authors

Publication Details

Published
2025-09-18
DOI
https://doi.org/10.5753/vem.2025.14563
Primary Topic
Software Testing and Debugging Techniques
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

An Exploratory Study of Decorators in the TypeScript Programming Language

Paulo Meirelles, Luiz Eduardo Galvão Martins, Phyllipe Francisco
Software Testing and Debugging Techniques
article

An Exploratory Study of Decorators in the TypeScript Programming Language

Paulo Meirelles, Luiz Eduardo Galvão Martins, Phyllipe Francisco
article en

Abstract

Decorators are a feature of the TypeScript language that allows the configuration of additional metadata on code elements, such as members, methods, and the class definition itself. It has been officially supported only since version 5.0. This feature also exists in other languages, such as Java annotations and C# attributes. To understand and further study how developers use decorators, we conducted an exploratory study on 30 real-world, open-source, and popular projects hosted on GitHub. To extract the characteristics of decorators from the analyzed projects, the DSniffer (Decorators Sniffer) was developed. It can collect source code metrics’ values dedicated to metadata configuration. Among the results obtained, it was observed that 46% of the projects use decorators, among which we highlight some popular ones such as Angular and Visual Studio Code. We also noted that decorators use at most four parameters, but these can be quite complex objects, occupying up to 84 lines of source code. Thus, the study reveals high numbers of decorators in the projects and many repeated metadata configurations. This can negatively impact the readability of the source code and compromise maintenance. The study carried out in this work can serve as a basis for defining reference values or implementing a software visualization approach.

Openalex Percentile: Top 74%
Software Testing and Debugging Techniques
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.