An Empirical Study of Data Constraint Implementations in Java

07/09/2021
by   Juan Manuel Florez, et al.
0

Software systems are designed according to guidelines and constraints defined by business rules. Some of these constraints define the allowable or required values for data handled by the systems. These data constraints usually originate from the problem domain (e.g., regulations), and developers must write code that enforces them. Understanding how data constraints are implemented is essential for testing, debugging, and software change. Unfortunately, there are no widely-accepted guidelines or best practices on how to implement data constraints. This paper presents an empirical study that investigates how data constraints are implemented in Java. We study the implementation of 187 data constraints extracted from the documentation of eight real-world Java software systems. First, we perform a qualitative analysis of the textual description of data constraints and identify four data constraint types. Second, we manually identify the implementations of these data constraints and reveal that they can be grouped into 30 implementation patterns. The analysis of these implementation patterns indicates that developers prefer a handful of patterns when implementing data constraints and deviations from these patterns are associated with unusual implementation decisions or code smells. Third, we develop a tool-assisted protocol that allows us to identify 256 additional trace links for the data constraints implemented using the 13 most common patterns. We find that almost half of these data constraints have multiple enforcing statements, which are code clones of different types.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
01/25/2019

Unveiling Exception Handling Guidelines Adopted by Java Developers

Despite being an old language feature, Java exception handling code is o...
research
08/30/2019

An Empirical Study of the Relationships between Code Readability and Software Complexity

Code readability and software complexity are important software quality ...
research
09/02/2021

APIzation: Generating Reusable APIs from StackOverflow Code Snippets

Developer forums like StackOverflow have become essential resources to m...
research
05/04/2022

An Empirical Study on Maintainable Method Size in Java

Code metrics have been widely used to estimate software maintenance effo...
research
12/14/2020

Software Quality Assessment for Robot Operating System

Robot Operating System (ROS) is widely used in academia and industry, an...
research
03/22/2021

ConfInLog: Leveraging Software Logs to Infer Configuration Constraints

Misconfigurations have become the dominant causes of software failures i...
research
06/18/2023

An Empirical Study of Untangling Patterns of Two-Class Dependency Cycles

Dependency cycles pose a significant challenge to software quality and m...

Please sign up or login with your details

Forgot password? Click here to reset