Method Chaining Redux: An Empirical Study of Method Chaining in Java, Kotlin, and Python

03/20/2023
by   Ali M. Keshk, et al.
0

There are possible benefits and drawbacks to chaining methods together, as is often done in fluent APIs. A prior study investigated how Java developers chain methods in over 2.7k open-source projects. That study observed, for the dataset analyzed, that the use of method chaining in Java is popular and seems to be increasing over time. That study however was limited to a smaller sample of Java projects, and it is also not clear if the results generalize to other languages. In this work, we first replicate the prior results by building a similar dataset and our own analysis scripts. We then extend those results by analyzing a much larger dataset of 89k Java projects and generalizing to other programming languages by analyzing 26k Kotlin projects and 98k Python projects. The results show chaining is more popular in Java and Kotlin than Python, chaining use in Kotlin is not growing, and Python sees more use in non-testing code.

READ FULL TEXT

page 5

page 7

page 8

research
01/22/2021

An Empirical Study of Flaky Tests in Python

Tests that cause spurious failures without any code changes, i.e., flaky...
research
06/12/2018

Evaluating Maintainability Prejudices with a Large-Scale Study of Open-Source Projects

Exaggeration or context changes can render maintainability experience in...
research
09/02/2021

Python Crypto Misuses in the Wild

Background: Previous studies have shown that up to 99.59 using crypto A...
research
07/12/2022

Making Python Code Idiomatic by Automatic Refactoring Non-Idiomatic Python Code with Pythonic Idioms

Compared to other programming languages (e.g., Java), Python has more id...
research
10/11/2018

An Initial Step Towards Organ Transplantation Based on GitHub Repository

Organ transplantation, which is the utilization of codes directly relate...
research
05/04/2018

Characterizing the Usage and Impact of Java Annotations Over 1000+ Projects

As a kind of meta-data feature, annotations have been formally introduce...
research
06/20/2023

Outside the Sandbox: A Study of Input/Output Methods in Java

Programming languages often demarcate the internal sandbox, consisting o...

Please sign up or login with your details

Forgot password? Click here to reset