An Empirical Investigation of Boilerplate Code

Presenter: Christina Chaniotaki, AUEB
Date: 19 January 2022

Abstract

Over the years, the use of computer applications and thus the creation of new software programs is growing rapidly. As a result, the creation and usage of new programming languages and services to meet existing needs is also developing quickly. Hence, the phenomenon of code repetition and reuse has been introduced to a large extent for the development of new applications, either intentionally or unintentionally. Consequently, a new research field of Computer Science was created known as “Code Cloning”. One subcategory of this field is the use of Boilerplate Code. Boilerplate code is code snippets that are used over and over again with little or no modifications, either in the same program or in different ones.

This work presents the concept of the Boilerplate Code as analyzed and understood by us and by previous research on the subject, over the last 21 years. In addition, an analysis has been carried out in order to comprehend Code Cloning, Clone Detection, and Clone Management. These theoretical analyses were performed using the Systematic Literature Review Process (SLR) and also two surveys were conducted. The first is a Qualitative Boilerplate Code Analysis using a clone detection tool. Specifically, open-source repositories were analyzed in terms of the amount and type of boilerplate code they contained, and categorization of boilerplate code was performed using the Open Coding method from Ground Theory. The second is an open survey in which questionnaires were distributed to software engineers and developers in order to understand how the concept of boilerplate code is perceived and how it is used. Finally, the results of these surveys are presented and discussed.