Deprewriter: On the fly rewriting method ...
Document type :
Article dans une revue scientifique
DOI :
Title :
Deprewriter: On the fly rewriting method deprecations.
Author(s) :
Ducasse, Stephane [Auteur]
Centre de Recherche Réseau Image SysTème Architecture et MuLtimédia [CRISTAL]
Analyses and Languages Constructs for Object-Oriented Application Evolution [RMOD]
Polito, Guillermo [Auteur]
Analyses and Languages Constructs for Object-Oriented Application Evolution [RMOD]
Centre de Recherche en Informatique, Signal et Automatique de Lille - UMR 9189 [CRIStAL]
Zaitsev, Oleksandr [Auteur]
Arolla
Analyses and Languages Constructs for Object-Oriented Application Evolution [RMOD]
Denker, Marcus [Auteur]
Pharo consortium
Centre de Recherche Réseau Image SysTème Architecture et MuLtimédia [CRISTAL]
Analyses and Languages Constructs for Object-Oriented Application Evolution [RMOD]
Tesone, Pablo [Auteur]
Pharo consortium
Centre de Recherche Réseau Image SysTème Architecture et MuLtimédia [CRISTAL]
Analyses and Languages Constructs for Object-Oriented Application Evolution [RMOD]

Centre de Recherche Réseau Image SysTème Architecture et MuLtimédia [CRISTAL]
Analyses and Languages Constructs for Object-Oriented Application Evolution [RMOD]
Polito, Guillermo [Auteur]

Analyses and Languages Constructs for Object-Oriented Application Evolution [RMOD]
Centre de Recherche en Informatique, Signal et Automatique de Lille - UMR 9189 [CRIStAL]
Zaitsev, Oleksandr [Auteur]
Arolla
Analyses and Languages Constructs for Object-Oriented Application Evolution [RMOD]
Denker, Marcus [Auteur]

Pharo consortium
Centre de Recherche Réseau Image SysTème Architecture et MuLtimédia [CRISTAL]
Analyses and Languages Constructs for Object-Oriented Application Evolution [RMOD]
Tesone, Pablo [Auteur]
Pharo consortium
Centre de Recherche Réseau Image SysTème Architecture et MuLtimédia [CRISTAL]
Analyses and Languages Constructs for Object-Oriented Application Evolution [RMOD]
Journal title :
The Journal of Object Technology
Pages :
1-23
Publisher :
Chair of Software Engineering
Publication date :
2022
ISSN :
1660-1769
English keyword(s) :
Dynamically-typed language
deprecation
automatic rewriting
program transformation
runtime
refactoring
reflection
Pharo
deprecation
automatic rewriting
program transformation
runtime
refactoring
reflection
Pharo
HAL domain(s) :
Informatique [cs]/Langage de programmation [cs.PL]
English abstract : [en]
Deprecations are a common way to indicate that a given feature or API will not be available in subsequent versions of a library or framework. While raising deprecation warnings lets developers of libraries evolve their ...
Show more >Deprecations are a common way to indicate that a given feature or API will not be available in subsequent versions of a library or framework. While raising deprecation warnings lets developers of libraries evolve their APIs, the developers of client applications often have to manually rewrite their applications to adapt to the deprecation (removal, new APIs.. .). Some may use static analysis tools to support the rewriting. However, dynamically-typed languages or the use of reflective features often produce incorrect rewrite candidates. This is a costly activity that can lead to bug introductions. In this article, we present a method deprecation approach and a tool called DEPREWRITER that can automatically rewrite the callers of deprecated methods during program execution. Clients of a deprecated API execute their program and associated tests, and DEPREWRITER dynamically rewrites the source code of methods that called a deprecated API to use the new API. The implementation of DEPREWRITER is based on dynamic program transformation: when a deprecated method is executed, a program transformation engine rewrites and recompiles the caller's code before continuing the execution. The approach presented in this article has been developed by the Pharo consortium. Since 2016, DEPREWRITER is used in production in multiple distributions of the Pharo programming language: Pharo 6, 7, 8, and 9 alpha. This article presents and validates this approach. The validation is done in two steps: first with an analysis of deprecations available in Pharo 8 and second with an open survey of software developers about DEPREWRITER. We studied 367 Pharo 8 deprecations, among which we analyzed the 218 rewriting deprecations that use transformation rules. We identified the validity conditions and reported defects to the community. We also proposed 33 transformation rules to be added to the non-rewriting deprecations. Both contributions were accepted into Pharo 9 alpha. We classified the rules and identified possible points of improvement. In addition, we performed a user survey and collected information from 46 software developers: some of them used existing DEPREWRITER' rules and executed them on their code, others used DEPREWRITER to create rewriting deprecations, and finally, some were not aware of DEPREWRITER. 28 of 46 developers (60%) reported that the rewriting deprecations helped them, while 10 stated the inverse and 8 were uncertain. After discussing the current implementation, we sketch possible implementations for other languages than Pharo, showing that the approach is general enough to be applied to other languages.Show less >
Show more >Deprecations are a common way to indicate that a given feature or API will not be available in subsequent versions of a library or framework. While raising deprecation warnings lets developers of libraries evolve their APIs, the developers of client applications often have to manually rewrite their applications to adapt to the deprecation (removal, new APIs.. .). Some may use static analysis tools to support the rewriting. However, dynamically-typed languages or the use of reflective features often produce incorrect rewrite candidates. This is a costly activity that can lead to bug introductions. In this article, we present a method deprecation approach and a tool called DEPREWRITER that can automatically rewrite the callers of deprecated methods during program execution. Clients of a deprecated API execute their program and associated tests, and DEPREWRITER dynamically rewrites the source code of methods that called a deprecated API to use the new API. The implementation of DEPREWRITER is based on dynamic program transformation: when a deprecated method is executed, a program transformation engine rewrites and recompiles the caller's code before continuing the execution. The approach presented in this article has been developed by the Pharo consortium. Since 2016, DEPREWRITER is used in production in multiple distributions of the Pharo programming language: Pharo 6, 7, 8, and 9 alpha. This article presents and validates this approach. The validation is done in two steps: first with an analysis of deprecations available in Pharo 8 and second with an open survey of software developers about DEPREWRITER. We studied 367 Pharo 8 deprecations, among which we analyzed the 218 rewriting deprecations that use transformation rules. We identified the validity conditions and reported defects to the community. We also proposed 33 transformation rules to be added to the non-rewriting deprecations. Both contributions were accepted into Pharo 9 alpha. We classified the rules and identified possible points of improvement. In addition, we performed a user survey and collected information from 46 software developers: some of them used existing DEPREWRITER' rules and executed them on their code, others used DEPREWRITER to create rewriting deprecations, and finally, some were not aware of DEPREWRITER. 28 of 46 developers (60%) reported that the rewriting deprecations helped them, while 10 stated the inverse and 8 were uncertain. After discussing the current implementation, we sketch possible implementations for other languages than Pharo, showing that the approach is general enough to be applied to other languages.Show less >
Language :
Anglais
Popular science :
Non
Collections :
Source :
Files
- https://hal.inria.fr/hal-03563605/document
- Open access
- Access the document
- http://www.jot.fm/issues/issue_2022_01/article1.pdf
- Open access
- Access the document
- https://hal.inria.fr/hal-03563605/document
- Open access
- Access the document
- http://www.jot.fm/issues/issue_2022_01/article1.pdf
- Open access
- Access the document
- https://hal.inria.fr/hal-03563605/document
- Open access
- Access the document
- document
- Open access
- Access the document
- Duca22a-JOT-Deprewriter.pdf
- Open access
- Access the document
- article1.pdf
- Open access
- Access the document