Identifying and introducing interfaces and callbacks using Wrangler

Lamela Seijas, Pablo and Thompson, Simon (2016) Identifying and introducing interfaces and callbacks using Wrangler. In: 28th Symposium on the Implementation and Application of Functional Programming Languages, 31 Aug - 02 Sep 2016, Leuven, Belgium. (doi:https://doi.org/10.1145/3064899.3064909) (Access to this publication is currently restricted. You may be able to access a copy if URLs are provided)

PDF - Publisher pdf
Restricted to Repository staff only
Contact us about this Publication Download (283kB)
[img]
Official URL
http://dx.doi.org/10.1145/3064899.3064909

Abstract

Duplicating code can make it easier to read in some contexts, but in general it is detrimental in several ways: it increases the compilation time, the size of the source code and, more critically, the cost of maintenance and the probability of introducing new bugs during maintenance. We can avoid code duplication by introducing abstraction for reusable functionalities. This is an established and desirable practice, but it can take considerable effort and it is error prone by itself, which acts as a deterrent. In this paper, we provide two ways of automating abstraction through refactorings. The first way (that we call iterative) allows developers to introduce an abstraction layer by choosing manually the parts to abstract (one at a time), and the refactoring does the necessary code manipulations. The second way (that we call integrated) takes a partial mapping that identifies equivalent nodes of the ASTs of two modules, and automatically abstracts the mapped common parts to a separate module with a common interface, through the introduction of the template pattern. Implementation for both of the refactorings, their dependencies, and a matching algorithm to infer partial mappings between two ASTs, are available as part of the open-source refactoring tool Wrangler for Erlang.

Item Type: Conference or workshop item (Proceeding)
Uncontrolled keywords: Erlang behaviour; Wrangler; abstraction; template pattern; behaviour extraction; refactoring; generalisation; erlang-diff
Subjects: Q Science > QA Mathematics (inc Computing science) > QA 76 Software, computer programming,
Divisions: Faculties > Sciences > School of Computing
Depositing User: Pablo Lamela-Seijas
Date Deposited: 22 Nov 2017 17:09 UTC
Last Modified: 20 Nov 2018 10:05 UTC
Resource URI: https://kar.kent.ac.uk/id/eprint/64632 (The current URI for this page, for reference purposes)
Thompson, Simon: https://orcid.org/0000-0002-2350-301X
  • Depositors only (login required):

Downloads

Downloads per month over past year