13,303 research outputs found
Recommended from our members
An empirical investigation into the impact of refactoring on regression testing
It is widely believed that refactoring improves software quality and developer’s productivity by making it easier to maintain and understand software systems. On the other hand, some believe that refactoring has the risk of functionality regression and increased testing cost. This paper investigates the impact of refactoring edits on regression tests using the version history of Java open source projects: (1) Are there adequate regression tests for refactoring in practice? (2) How many of existing regression tests are relevant to refactoring edits and thus need to be re-run for the new version? (3) What proportion of failure-inducing changes are relevant to refactorings? By using a refactoring reconstruction analysis and a change impact analysis in tandem, we investigate the relationship between the types and locations of refactoring edits identified by RefFinder and the affecting changes and affected tests identified by the FaultTracer change impact analysis. The results on three open source projects, JMeter, XMLSecurity, and ANT, show that only 22% of refactored methods and fields are tested by existing regression tests. While refactorings only constitutes 8% of atomic changes, 38% of affected tests are relevant to refactorings. Furthermore, refactorings are involved in almost a half of failed test cases. These results call for new automated regression test augmentation and selection techniques for validating refactoring edits.Electrical and Computer Engineerin
Development of a Refactoring Learning Environment
This paper describes a Refactoring Learning Environment, which is
intended to analyze and assess programming code, based on refactoring rules. The
Refactoring Learning Environment architecture includes an intelligent assistant –
Refactoring Agent, which is responsible for analysis and assessment of the code,
written by students in real time by using a set of refactoring methods. According to
the situation and based on the refactoring method, which should be applied, the
agent could react in different ways. Its goal is to show the student, as much as
possible, the weak places of his programming code and the possible ways to makes
it better
Using Modularity Metrics to assist Move Method Refactoring of Large System
For large software systems, refactoring activities can be a challenging task,
since for keeping component complexity under control the overall architecture
as well as many details of each component have to be considered. Product
metrics are therefore often used to quantify several parameters related to the
modularity of a software system. This paper devises an approach for
automatically suggesting refactoring opportunities on large software systems.
We show that by assessing metrics for all components, move methods refactoring
an be suggested in such a way to improve modularity of several components at
once, without hindering any other. However, computing metrics for large
software systems, comprising thousands of classes or more, can be a time
consuming task when performed on a single CPU. For this, we propose a solution
that computes metrics by resorting to GPU, hence greatly shortening computation
time. Thanks to our approach precise knowledge on several properties of the
system can be continuously gathered while the system evolves, hence assisting
developers to quickly assess several solutions for reducing modularity issues
A heuristic-based approach to code-smell detection
Encapsulation and data hiding are central tenets of the object oriented paradigm. Deciding what data and behaviour to form into a class and where to draw the line between its public and private details can make the difference between a class that is an understandable, flexible and reusable abstraction and one which is not. This decision is a difficult one and may easily result in poor encapsulation which can then have serious implications for a number of system qualities. It is often hard to identify such encapsulation problems within large software systems until they cause a maintenance problem (which is usually too late) and attempting to perform such analysis manually can also be tedious and error prone. Two of the common encapsulation problems that can arise as a consequence of this decomposition process are data classes and god classes. Typically, these two problems occur together – data classes are lacking in functionality that has typically been sucked into an over-complicated and domineering god class. This paper describes the architecture of a tool which automatically detects data and god classes that has been developed as a plug-in for the Eclipse IDE. The technique has been evaluated in a controlled study on two large open source systems which compare the tool results to similar work by Marinescu, who employs a metrics-based approach to detecting such features. The study provides some valuable insights into the strengths and weaknesses of the two approache
Proactive Empirical Assessment of New Language Feature Adoption via Automated Refactoring: The Case of Java 8 Default Methods
Programming languages and platforms improve over time, sometimes resulting in
new language features that offer many benefits. However, despite these
benefits, developers may not always be willing to adopt them in their projects
for various reasons. In this paper, we describe an empirical study where we
assess the adoption of a particular new language feature. Studying how
developers use (or do not use) new language features is important in
programming language research and engineering because it gives designers
insight into the usability of the language to create meaning programs in that
language. This knowledge, in turn, can drive future innovations in the area.
Here, we explore Java 8 default methods, which allow interfaces to contain
(instance) method implementations.
Default methods can ease interface evolution, make certain ubiquitous design
patterns redundant, and improve both modularity and maintainability. A focus of
this work is to discover, through a scientific approach and a novel technique,
situations where developers found these constructs useful and where they did
not, and the reasons for each. Although several studies center around assessing
new language features, to the best of our knowledge, this kind of construct has
not been previously considered.
Despite their benefits, we found that developers did not adopt default
methods in all situations. Our study consisted of submitting pull requests
introducing the language feature to 19 real-world, open source Java projects
without altering original program semantics. This novel assessment technique is
proactive in that the adoption was driven by an automatic refactoring approach
rather than waiting for developers to discover and integrate the feature
themselves. In this way, we set forth best practices and patterns of using the
language feature effectively earlier rather than later and are able to possibly
guide (near) future language evolution. We foresee this technique to be useful
in assessing other new language features, design patterns, and other
programming idioms
Extract Class Refactoring by analyzing class variables
Software maintenance activities often cause design erosion and lead to increased software complexity and maintenance costs. Extract Class Refactoring attempts to address design erosion by identifying and pulling out extraneous functionalities from a class and distributing them to new classes. This thesis extends previous research in this area by improving a metric known as Structural Similarity between Methods (SSM) used during Extract Class Refactoring. The improved metric, called Variable based Similarity between methods (VSM), establishes similarities between methods based on the variables they share, and on how they use these variables. Strongly connected methods are then allocated into new classes. The thesis also introduces another metric, Cognate Members Metric (CMM), which identifies those members of a class that are only used in combination with each other, and hence, probably belong together in a separate class. Additionally, this work extends and modifies existing refactoring processes for extracting classes. A software prototype that performs Extract Class Refactoring has been developed to substantiate the research. A few Case studies are discussed and comparison and analysis of results of refactoring using the new and older approaches of the Extract Class Refactoring process are presented
A meta-analysis approach to refactoring and XP
The mechanics of seventy-two different Java refactorings are described fully in Fowler's text. In the same text, Fowler describes seven categories of refactoring, into which each of the seventy-two refactorings can be placed. A current research problem in the refactoring and XP community is assessing the likely time and testing effort for each refactoring, since any single refactoring may use any number of other refactorings as part of its mechanics and, in turn, can be used by many other refactorings. In this paper, we draw on a dependency analysis carried out as part of our research in which we identify the 'Use' and 'Used By' relationships of refactorings in all seven categories. We offer reasons why refactorings in the 'Dealing with Generalisation' category seem to embrace two distinct refactoring sub-categories and how refactorings in the 'Moving Features between Objects' category also exhibit specific characteristics. In a wider sense, our meta-analysis provides a developer with concrete guidelines on which refactorings, due to their explicit dependencies, will prove problematic from an effort and testing perspective
- …