229 research outputs found
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
State of Refactoring Adoption: Towards Better Understanding Developer Perception of Refactoring
Context: Refactoring is the art of improving the structural design of a software system without altering its external behavior. Today, refactoring has become a well-established and disciplined software engineering practice that has attracted a significant amount of research presuming that refactoring is primarily motivated by the need to improve system structures. However, recent studies have shown that developers may incorporate refactoring strategies in other development-related activities that go beyond improving the design especially with the emerging challenges in contemporary software engineering. Unfortunately, these studies are limited to developer interviews and a reduced set of projects. Objective: We aim at exploring how developers document their refactoring activities during the software life cycle. We call such activity Self-Affirmed Refactoring (SAR), which is an indication of the developer-related refactoring events in the commit messages. After that, we propose an approach to identify whether a commit describes developer-related refactoring events, to classify them according to the refactoring common quality improvement categories. To complement this goal, we aim to reveal insights into how reviewers develop a decision about accepting or rejecting a submitted refactoring request, what makes such review challenging, and how to the efficiency of refactoring code review. Method: Our empirically driven study follows a mixture of qualitative and quantitative methods. We text mine refactoring-related documentation, then we develop a refactoring taxonomy, and automatically classify a large set of commits containing refactoring activities, and identify, among the various quality models presented in the literature, the ones that are more in-line with the developer\u27s vision of quality optimization, when they explicitly mention that they are refactoring to improve them to obtain an enhanced understanding of the motivation behind refactoring. After that, we performed an industrial case study with professional developers at Xerox to study the motivations, documentation practices, challenges, verification, and implications of refactoring activities during code review. Result: We introduced SAR taxonomy on how developers document their refactoring strategies in commit messages and proposed a SAR model to automate the detection of refactoring. Our survey with code reviewers has revealed several difficulties related to understanding the refactoring intent and implications on the functional and non-functional aspects of the software. Conclusion: Our SAR taxonomy and model, can work in conjunction with refactoring detectors, to report any early inconsistency between refactoring types and their documentation and can serve as a solid background for various empirical investigations. In light of our findings of the industrial case study, we recommended a procedure to properly document refactoring activities, as part of our survey feedback
Automated migration of build scripts using dynamic analysis and search-based refactoring
The efficiency of a build system is an important factor for developer productivity. As a result, developer teams have been increasingly adopting new build systems that allow higher build parallelization. However, migrating the existing legacy build scripts to new build systems is a tedious and error-prone process. Unfortunately, there is insufficient support for automated migration of build scripts, making the migration more problematic. We propose the first dynamic approach for automated migration of build scripts to new build systems. Our approach works in two phases. First, from a set of execution traces, we synthesize build scripts that accurately capture the intent of the original build. The synthesized build scripts are typically long and hard to maintain. Second, we apply refactorings that raise the abstraction level of the synthesized scripts (e.g., introduce functions for similar fragments). As different refactoring sequences may lead to different build scripts, we use a search-based approach that explores various sequences to identify the best (e.g., shortest) build script. We optimize search-based refactoring with partial-order reduction to faster explore refactoring sequences. We implemented the proposed two phase migration approach in a tool called METAMORPHOSIS that has been recently used at Microsoft
30 Years of Software Refactoring Research:A Systematic Literature Review
Due to the growing complexity of software systems, there has been a dramatic
increase and industry demand for tools and techniques on software refactoring
in the last ten years, defined traditionally as a set of program
transformations intended to improve the system design while preserving the
behavior. Refactoring studies are expanded beyond code-level restructuring to
be applied at different levels (architecture, model, requirements, etc.),
adopted in many domains beyond the object-oriented paradigm (cloud computing,
mobile, web, etc.), used in industrial settings and considered objectives
beyond improving the design to include other non-functional requirements (e.g.,
improve performance, security, etc.). Thus, challenges to be addressed by
refactoring work are, nowadays, beyond code transformation to include, but not
limited to, scheduling the opportune time to carry refactoring, recommendations
of specific refactoring activities, detection of refactoring opportunities, and
testing the correctness of applied refactorings. Therefore, the refactoring
research efforts are fragmented over several research communities, various
domains, and objectives. To structure the field and existing research results,
this paper provides a systematic literature review and analyzes the results of
3183 research papers on refactoring covering the last three decades to offer
the most scalable and comprehensive literature review of existing refactoring
research studies. Based on this survey, we created a taxonomy to classify the
existing research, identified research trends, and highlighted gaps in the
literature and avenues for further research.Comment: 23 page
30 Years of Software Refactoring Research: A Systematic Literature Review
Peer Reviewedhttps://deepblue.lib.umich.edu/bitstream/2027.42/155872/4/30YRefactoring.pd
Detection of microservice smells through static analysis
A arquitetura de microsserviços é um modelo arquitetural promissor na área de software,
atraindo desenvolvedores e empresas para os seus princÃpios convincentes. As suas vantagens
residem no potencial para melhorar a escalabilidade, a flexibilidade e a agilidade, alinhando se com as exigências em constante evolução da era digital. No entanto, navegar entre as
complexidades dos microsserviços pode ser uma tarefa desafiante, especialmente à medida
que este campo continua a evoluir.
Um dos principais desafios advém da complexidade inerente aos microsserviços, em que o seu
grande número e interdependências podem introduzir novas camadas de complexidade. Além
disso, a rápida expansão dos microsserviços, juntamente com a necessidade de aproveitar as
suas vantagens de forma eficaz, exige uma compreensão mais profunda das potenciais
ameaças e problemas que podem surgir. Para tirar verdadeiramente partido das vantagens
dos microsserviços, é essencial enfrentar estes desafios e garantir que o desenvolvimento e a
adoção de microsserviços sejam bem-sucedidos.
O presente documento pretende explorar a área dos smells da arquitetura de microsserviços
que desempenham um papel tão importante na dÃvida técnica dirigida à área dos
microsserviços.
Embarca numa exploração de investigação abrangente, explorando o domÃnio dos smells de
microsserviços. Esta investigação serve como base para melhorar um catálogo de smells de
microsserviços. Esta investigação abrangente obtém dados de duas fontes primárias:
systematic mapping study e um questionário a profissionais da área. Este último envolveu 31
profissionais experientes com uma experiência substancial no domÃnio dos microsserviços.
Além disso, são descritos o desenvolvimento e o aperfeiçoamento de uma ferramenta
especificamente concebida para identificar e resolver problemas relacionados com os
microsserviços. Esta ferramenta destina-se a melhorar o desempenho dos programadores
durante o desenvolvimento e a implementação da arquitetura de microsserviços.
Por último, o documento inclui uma avaliação do desempenho da ferramenta. Trata-se de
uma análise comparativa efetuada antes e depois das melhorias introduzidas na ferramenta.
A eficácia da ferramenta será avaliada utilizando o mesmo benchmarking de microsserviços
utilizado anteriormente, para além de outro benchmarking para garantir uma avaliação
abrangente.The microservices architecture stands as a beacon of promise in the software landscape,
drawing developers and companies towards its compelling principles. Its appeal lies in the
potential for improved scalability, flexibility, and agility, aligning with the ever-evolving
demands of the digital age. However, navigating the intricacies of microservices can be a
challenging task, especially as this field continues to evolve.
A key challenge arises from the inherent complexity of microservices, where their sheer
number and interdependencies can introduce new layers of intricacy. Furthermore, the rapid
expansion of microservices, coupled with the need to harness their advantages effectively,
demands a deeper understanding of the potential pitfalls and issues that may emerge. To
truly unlock the benefits of microservices, it is essential to address these challenges head-on
and ensure a successful journey in the world of microservices development and adoption.
The present document intends to explore the area of microservice architecture smells that
play such an important role in the technical debt directed to the area of microservices.
It embarks on a comprehensive research exploration, delving into the realm of microservice
smells. This research serves as the cornerstone for enhancing a microservice smell catalogue.
This comprehensive research draws data from two primary sources: a systematic mapping
research and an industry survey. The latter involves 31 seasoned professionals with
substantial experience in the field of microservices.
Moreover, the development and enhancement of a tool specifically designed to identify and
address issues related to microservices is described. This tool is aimed at improving
developers' performance throughout the development and implementation of microservices
architecture.
Finally, the document includes an evaluation of the tool's performance. This involves a
comparative analysis conducted before and after the tool's enhancements. The tool's
effectiveness will be assessed using the same microservice benchmarking as previously
employed, in addition to another benchmark to ensure a comprehensive evaluation
- …