Searcharxiv⌕ Search

arXiv subjects

Jesús Moreno-León

Publications and source records attributed to Jesús Moreno-León.

1 recordsLinked to original sources

Code Cloning and Procedural Abstraction in Scratch: A Large-Scale Study of Co-Existing Reuse Practices

Code cloning is a long-standing software-evolution concern: duplicated implementations diverge as software changes. In block-based programming, however, duplication is an everyday reuse mechanism, and Scratch facilitates a copy-and-paste culture that may hinder abstraction. We study this relation in 2.04 million public Scratch projects. We compare cloned sequences with existing abstractions and examine how their use varies across Computational Thinking (CT) score levels. Clones occur in 6.2% of projects and custom blocks in 11.9%. Of 436,198 detected clone instances, 16.1% have a normalized sequence matching a custom block in the same project and 17.8% match a custom block only outside it. At the pattern level, 83 of the 100 most frequent clone patterns have counterparts implementable as custom blocks elsewhere in the corpus. Of the remaining 17 patterns, 15 are amenable to custom-block extraction, while in two cases the benefit of abstraction is ambiguous; no class of frequent clone resists abstraction in principle. Yet the abstractions that do exist are often shallow: 53.0% of custom blocks are parameter-free. Increased use of abstraction does not coincide with less cloning. Both become more prevalent at higher CT-score levels, and their combined use dominates the highest band. These findings are consistent with cloning and procedural abstraction being co-existing reuse practices rather than mutually exclusive stages. Closing that gap requires both instruction on when to abstract, not only how, and platform support for refactoring.

cs.SE↗