Article

Refactoring: Improving the Design of Existing Programs

Authors:
To read the full-text of this research, you can request a copy directly from the author.

No full-text available

Request Full-text Paper PDF

To read the full-text of this research,
you can request a copy directly from the author.

... Penyebab masalah tersebut ialah kurangnya pengetahuan seorang programmer terkait struktur kode yang baik atau solusi pengembang dirancang dengan tidak tepat, hal tersebut berdampak negatif pada kualitas desain kode. Sehingga dapat memperlambat proses pengembangan dan menimbulkan resiko bug atau kegagalan di masa mendatang (Singh & Kaur, 2018) (Fowler, 1999) (Cairo et al., 2018). ...
... Kemudian development dengan sengaja melakukan copy paste kode-kode program lain. Dalam mengatasi smell code itu sendiri mengusulkan dengan mengunakan Extract Method dalam membangun struktur kode agar lebih terstruktur dan mudah dipahami serta memangkas duplicated code pada program (Fowler, 1999). ...
... 4) Implementasi Refactoring. 5) Pengujian (Fowler, 1999). Berikut merupakan tahapan penelitian ini: a) Identifikasi Masalah Pada tahapan ini dilakukan Identifikasi terhadap perangkat lunak berupa analisis sistem secara umum meliputi analisis masalah struktur internal kode yang ditemukan pada perangkat lunak. ...
Article
Full-text available
Optimalisasi dengan refactoring merupakan aktivitas penting dalam meningkatkan struktur internal kode dan bertujuan untuk meningkatkan kualitas perangkat lunak. Dalam program modul pendaftaran sistem informasi klinik utama nur khadijah, terdapat smell code yang menjadi indikasi adanya permasalahan dari struktur kode program. Permasalahan yang terdapat pada program tersebut yaitu adanya duplicate code yang membuat pemeliharaan perangkat lunak menjadi lebih sulit. Ketika terjadi kesalahan akan sulit menemukan dan memperbaikinya, efek jangka panjang yang terjadi yaitu akan menimbulkan bug. Pada tugas akhir ini melakukan optimalisasi terhadap aplikasi klinik utama nur khadijah menggunakan metode refactoring dengan mengoptimalkan kode program yang terindikasi smell code yaitu duplicated code dan query. Dalam penyelesaian permasalahan duplicate code maka akan dilakukan dengan menggunakan Teknik Extract Method. Setelah itu pengujian Benchmarking untuk menguji performance response time query dengan memanfaatkan tools Mysqlslap. Penelitian ini akan menghasilkan sistem yang lebih optimal dibandingkan dengan system sebelumnya dengan menerapkan optimalisasi dengan metode refactoring
... Bad Smells are code structures or design flaws that have a negative influence on software quality and that can lead to problems. The term was introduced by Fowler et al. [2], who proposed a set of Bad Smells and also suggested refactoring methods that can be used to resolve these Bad Smells. We want to investigate refactoring operations that are capable of resolving specific IEC 61499 Bad Smells. ...
... Common practices from textual languages should be reused or adapted. In his book, Fowler described more than 20 different refactoring operations [2] and collected them in a catalog. To the best of the author's knowledge, there is no refactoring catalog for IEC 61499. ...
... Refactoring or restructuring source code is performed to enhance readability and maintainability of applications [2] [10]. A clearer structure of the source code increases its maintainability, e.g., simplifies adding new features. ...
... The metaphor of code smells is used to indicate the presence of quality issues in source code [1], [2]. A large number of smells in a software system is associated with a high level of technical debt [3] hampering the system's evolution. ...
... Kent Beck coined the term "code smell" [1] and defined it as "certain structures in the code that suggest (or sometimes scream) for refactoring." Code smells indicate the presence of quality problems impacting many facets of quality [2] of a software system [1], [21]. ...
... Kent Beck coined the term "code smell" [1] and defined it as "certain structures in the code that suggest (or sometimes scream) for refactoring." Code smells indicate the presence of quality problems impacting many facets of quality [2] of a software system [1], [21]. The presence of an excessive number of smells in a software system makes it hard to maintain and evolve. ...
Article
Full-text available
Context An excessive number of code smells make a software system hard to evolve and maintain. Machine learning methods, in addition to metric-based and heuristic-based methods, have been recently applied to detect code smells; however, current methods are considered far from mature. Objective First, explore the feasibility of applying deep learning models to detect smells without extensive feature engineering. Second, investigate the possibility of applying transfer-learning in the context of detecting code smells. Methods We train smell detection models based on Convolution Neural Networks and Recurrent Neural Networks as their principal hidden layers along with autoencoder models. For the first objective, we perform training and evaluation on C# samples, whereas for the second objective, we train the models from C# code and evaluate the models over Java code samples and vice-versa. Results We find it feasible to detect smells using deep learning methods though the models’ performance is smell-specific. Our experiments show that transfer-learning is definitely feasible for implementation smells with performance comparable to that of direct-learning. This work opens up a new paradigm to detect code smells by transfer-learning especially for the programming languages where the comprehensive code smell detection tools are not available.
... As an attempt to reduce the costs and complexity of maintaining existing software, a number of techniques have been proposed, including metrics, testing and verification, reverse engineering, and reengineering. A more recent technique, refactoring, i.e., the process of changing a software system to improve its internal quality while preserving its external behavior [11], is gaining increasing acceptance among software developers. Its main goal is to reduce code complexity, which increases rapidly as the code evolves, by making it more extensible, modular, reusable and maintainable [21]. ...
... Its main goal is to reduce code complexity, which increases rapidly as the code evolves, by making it more extensible, modular, reusable and maintainable [21]. The adoption of refactoring has been boosted by the fact that it is one the pillars of Extreme Programming [3], an emerging and increasingly popular software development methodology, and by the wide dissemination of the refactorings catalog created by Fowler [11]. As with other code changing techniques, refactoring is most effectively performed by means of automated tools. ...
Conference Paper
Refactoring, i.e., the process of changing a software system to improve its internal quality while preserving its external behavior, is gaining increasing acceptance among software developers. Even though many refactoring tools are now available for a variety of programming languages, most of them rely on their own, closed mechanisms for representing and manipulating source code information, which makes them difficult to customize, extend and reuse. This paper makes three contributions towards the development of more flexible refactoring tools. Firstly, it proposes an XML-centric refactoring process in which XML is used as a standard way to represent, analyze and modify source code information. Secondly, it presents a concrete realization of that process, in the form of a refactoring framework, called RefaX, which builds on existing XML-based source code models and processing technologies to facilitate the development, extension and reuse of refactoring tools. Finally, it demonstrates the applicability of the proposed process and framework through two RefaX-based refactoring prototypes for Java and C++, respectively.
... Code smells are symptoms of poor design and implementation [1]. Existing literature shows that code smells have a negative impact on maintainability [2], [3], development effort [4], [5], and reliability [6]- [9] among other quality attributes. ...
... This approach helps us better utilize the annotators' effort by considering their inputs where we actually need them. The dataset offers annotated code snippets for three code smells-multifaceted abstraction [18], [19], complex method [20], and long parameter list [1]. In addition to a manually annotated dataset on potentially subjective snippets, we offer DACOSX dataset containing a large number of snippets that are either definitely benign or smelly. ...
Preprint
Full-text available
Researchers apply machine-learning techniques for code smell detection to counter the subjectivity of many code smells. Such approaches need a large, manually annotated dataset for training and benchmarking. Existing literature offers a few datasets; however, they are small in size and, more importantly, do not focus on the subjective code snippets. In this paper, we present DACOS, a manually annotated dataset containing 10,267 annotations for 5,192 code snippets. The dataset targets three kinds of code smells at different granularity: multifaceted abstraction, complex method, and long parameter list. The dataset is created in two phases. The first phase helps us identify the code snippets that are potentially subjective by determining the thresholds of metrics used to detect a smell. The second phase collects annotations for potentially subjective snippets. We also offer an extended dataset DACOSX that includes definitely benign and definitely smelly snippets by using the thresholds identified in the first phase. We have developed TagMan, a web application to help annotators view and mark the snippets one-by-one and record the provided annotations. We make the datasets and the web application accessible publicly. This dataset will help researchers working on smell detection techniques to build relevant and context-aware machine-learning models.
... It allowed us to apply Design Patterns proposed first in (Gamma et al. (1994)) (see also Bafandeh et al. (2017)). Such patterns provide well-structured model and the Refactoring method aimed at redesign of models and code developed by Fowler (1999) (see also Baqais (2020)). Both have proved very useful in model construction and modification. ...
... It should be noticed that we apply here the "Replace inheritance by delegation" refactoring pattern (cf. Fowler (1999) and Baqais (2020)). ...
... Refactoring adalah proses mengubah sistem perangkat lunak sedemikian rupa sehingga tidak mengubah perilaku eksternal kode, namun memperbaiki struktur internalnya [10], [11]. Refactoring adalah cara yang disiplin untuk membersihkan kode yang meminimalkan kemungkinan munculnya bug. ...
Article
Full-text available
Implementasi Clean Architecture dalam pengembangan aplikasi Android menggunakan bahasa pemrograman Kotlin, dengan fokus pada penerapan prinsip desain SOLID. Evaluasi dilakukan pada dampak Clean Architecture terhadap kompleksitas kode yang menunjukkan penurunan rata-rata nilai kompleksitas dari 1,5 menjadi 1,4. Penelitian juga menganalisis perubahan kinerja aplikasi sebelum dan setelah menerapkan Clean Architecture, dengan penekanan pada penggunaan CPU, memori dan waktu eksekusi, Metodologi penelitian mengikuti pendekatan waterfall untuk refactoring aplikasi XYZ. Hasil penelitian memberikan pemahaman mendalam tentang perubahan kode dalam implementasi Clean Architecture dalam pengembangan aplikasi XYZ. Kesimpulannya, penerapan Clean Architecture dapat mengurangi kompleksitas kode dan berpotensi meningkatkan kinerja aplikasi, memberikan landasan yang kuat untuk pengembangan perangkat lunak yang lebih efisien dan dapat dipelajari oleh peneliti di bidang ini.
... As a classical correlation method, we used Spearman's Correlation (SC) as it has no assumptions about the data distribution (Fowler, 1987). The method is also used in many other software engineering papers (Falessi and Kazman, 2021). ...
Preprint
Context: The code review process is conducted by software teams with various motivations. Among other goals, code reviews act as a gatekeeper for software quality. Objective: In this study, we explore whether code reviews have an impact on one specific aspect of software quality, software maintainability. We further extend our investigation by analyzing whether code review process quality (as evidenced by the presence of code review process smells) influences software maintainability (as evidenced by the presence of code smells). Method: We investigate whether smells in the code review process are related to smells in the code that was reviewed by using correlation analysis. We augment our quantitative analysis with a focus group study to learn practitioners’ opinions. Results: Our investigations revealed that the level of code smells neither increases nor decreases in 8 out of 10 code reviews, regardless of the quality of the code review. Contrary to our own intuition and that of the practitioners in our focus groups, we found that code review process smells have little to no correlation with the level of code smells. We identified multiple potential reasons behind the counter-intuitive results based on our focus group data. Furthermore, practitioners still believe that code reviews are helpful in improving software maintainability. Conclusion: Our results imply that the community should update our goals for code review practices and reevaluate those practices to align them with more relevant and modern realities.
... In practice, software systems need frequent restructuring to keep them maintainable [9]. To support the efficient restructuring of a software system, refactorings have been proposed and documented in a human-readable form. ...
Chapter
Full-text available
To ensure the security of a software system, it is vital to keep up with changing security precautions, attacks, and mitigations. Although model-based development enables addressing security already at design-time, design models are often inconsistent with the implementation or among themselves. Such inconsistencies hinder the effective realization and verification of secure software systems. In addition, variants of software systems are another burden to developing secure systems. Vulnerabilities must be identified and fixed on all variants or else attackers could be well-guided in attacking unfixed variants. To ensure security in this context, in the thesis (Peldszus, Security Compliance in Model-driven Development of Software Systems in Presence of Long-Term Evolution and Variants. Springer, Berlin; 2022), we present GRaViTY, an approach that allows security experts to specify security requirements on the most suitable system representation. To preserve security, based on continuous automated change propagation, GRaViTY automatically checks all system representations against these security requirements. To systematically improve the object-oriented design of a software-intensive system, GRaViTY provides security-preserving refactorings. For both continuous security compliance checks and refactorings, we show the application to variant-rich software systems. To support legacy systems, GRaViTY allows to automatically reverse-engineer variability-aware UML models and semi-automatically map existing design models to the implementation. Besides evaluations of the individual contributions, we demonstrate applicability of the approach in two real-world case studies, the iTrust electronics health records system and the Eclipse Secure Storage. This book chapter provides a summary of the thesis, focusing on the addressed problems, identified and answered research questions, the general solution, and its application of it to two case studies. For details on the individual solutions, please refer to the thesis and the corresponding publications referenced in this book chapter.
... He received his Diploma in electrical engineering and his PhD degree in computer science from the Aristotle University of Thessaloniki, Greece, in 1996and 2000, respectively. From 1997to 1999, he was with Intracom, Greece, as a telecommunications software designer. His research interests include objectoriented design, software maintenance, and metrics. ...
Article
Full-text available
The responsibility of a method/function is to perform some desired computations and disseminate the results to its caller through various deliverables, including object fields and variables in output instructions. Based on this definition of responsibility, this paper offers a new algorithm to refactor long methods to those with a single responsibility. We propose a backward slicing algorithm to decompose a long method into slightly overlapping slices. The slices are computed for each output instruction, representing the outcome of a responsibility delegated to the method. The slices will be non-overlapping if the slicing criteria address the same output variable. The slices are further extracted as independent methods, invoked by the original method, if certain behavioral preservation are made. The proposed method has been evaluated on the GEMS extract method refactoring benchmark and three real-world projects. On average, our experiments demonstrate at least a 29.6% improvement in precision and a 12.1% improvement in the recall of uncovering refactoring opportunities compared to the state-of-the-art approaches. Furthermore, our tool improves method-level cohesion metrics by an average of 20% after refactoring. Experimental results confirm the applicability of the proposed approach in extracting methods with a single responsibility.
... Refactoring involves modifying the structure of software without altering its behavior [1]. According to Martin Fowler"s book [2], refactoring is the process of transforming a software system without changing its external behavior. The primary objective of refactoring is to enhance the internal structure quality of the software. ...
Article
Full-text available
With the rapid advancement of technology, it is inevitable that nearly every aspect of our lives involves technology, particularly when accessing information. Through the utilization of sophisticated technology, we can conveniently and practically access various types of information or data using mobile devices. This has led to the development of web applications that encompass diverse data within organizations. The purpose of creating web app is to streamline team management processes, enabling faster and more efficient work. However, quite often we find features in the web apps that can still be enhanced in terms of program code and functionality. Refactoring offers a method to enhance both of the code quality and the feature functionality. It aims to improve the internal quality of a feature, making the system easier to maintain and free from errors or bugs. Using the TestDriven Development approach in this research, a feature has been successfully refactored, resulting in a more userfriendly experience and facilitating easier maintenance for developers.
... Many empirical studies explored the prevalence, nature, co-occurrence, and impact of refactoring activities on software quality. Since Fowler proposed a catalog of refactoring types (Fowler 2002), there have been many studies on refactoring activities. In the following, we will focus on the most recent studies for brevity. ...
Article
Full-text available
Developers often refactor code to improve the maintainability and comprehension of the software. There are many studies on refactoring activities in traditional software systems. However, refactoring in data-intensive systems is not well explored. Understanding the refactoring practices of developers is important to develop efficient tool support. We conducted a longitudinal study of refactoring activities in data-access classes using 29 SQL and NoSQL database based data-intensive systems. We investigated the prevalence, co-occurrence, and evolution of data-access refactorings, and the association of data-access refactorings with data-access smells. We also conducted a manual analysis of 500 samples of data-access refactoring instances to identify the functionalities of the code that are targeted by such refactorings. Furthermore, we analyzed 500 sample data-access refactoring commits to understand the context behind the applied refactorings and explored the characteristics and contribution of developers involved in the refactorings. We also conducted a developer survey to complement our analysis on the subject systems. Our results show that data-access refactorings are prevalent and different in type. Most of the data-access refactorings target codes that implement data fetching and insertion, but they mostly do not modify data-access queries. Most of the data-access refactorings are done when adding or modifying features and during bug fixes. data-access refactoring is often performed by developers with higher development and refactoring experience. Overall, the results show that data-access refactorings focus on improving the code quality but not optimizing the underlying data-access operations by fixing data-access smells. Hence, more work is needed from the research community on providing awareness and support to practitioners on the benefits of addressing data-access smells with refactorings.
... The mutation of one individual consists of moving methods from one microservice candidate to another one, i.e., regrouping vertices in the graphs composing different microservices. In a simplified form, we can see the mutation operator as an analogy of the move method refactoring (Fowler 1999). ...
Article
Full-text available
The expensive maintenance of legacy systems leads companies to migrate such systems to modern architectures. Microservice architectural style has become a trend to modernize monolithic legacy systems. A microservice architecture consists of small, autonomous, and highly-independent services communicating by using lightweight network protocols. To support the designing of microservice architectures, recent studies have proposed either single or multi-objective approaches. In order to improve the effectiveness of existing approaches, we introduced toMicroservices that is a many-objective search-based approach to aid the identification of boundaries among services. In previous studies, we have focused on a qualitative evaluation of the applicability and adoption of the proposed approach from a practical point of view, thus the optimization process itself has not been investigated in depth. In this paper, we extend our previous work by performing a more in-depth analysis of our many-objective approach for microservice identification. We compare our approach against a baseline approach based on a random search using a set of performance indicators widely used in the literature of many-objective optimization. Our results are validated through a real-world case study. The study findings reveal that (i) the criteria optimized by our approach are interdependent and conflicting; and (ii) all candidate solutions lead to better performance indicators in comparison to random search. Overall, the proposed many-objective approach for microservice identification yields promising results, which shed light on insights for further improvements.
... Smells can be defined at different levels of granularity, such as code smells and design smells. Well-known code smells include duplicated code and long method (Fowler 2018). The well-known design smells include spaghetti code and stovepip system (Brown et al. 1998). ...
Article
Full-text available
Regular expressions cause string-related bugs and open security vulnerabilities for DOS attacks. However, beyond ReDoS (Regular expression Denial of Service), little is known about the extent to which regular expression issues affect software development and how these issues are addressed in practice. We conduct an empirical study of 356 regex-related bugs from merged pull requests in Apache, Mozilla, Facebook, and Google GitHub repositories. We identify and classify the nature of the regular expression problems, the fixes, and the related changes in the test code. The most important findings in this paper are as follows: 1) incorrect regular expression semantics is the dominant root cause of regular expression bugs (165/356, 46.3%). The remaining root causes are incorrect API usage (9.3%) and other code issues that require regular expression changes in the fix (29.5%), 2) fixing regular expression bugs is nontrivial as it takes more time and more lines of code to fix them compared to the general pull requests, 3) most (51%) of the regex-related pull requests do not contain test code changes. Certain regex bug types (e.g., compile error, performance issues, regex representation) are less likely to include test code changes than others, and 4) the dominant type of test code changes in regex-related pull requests is test case addition (75%). The results of this study contribute to a broader understanding of the practical problems faced by developers when using, fixing, and testing regular expressions.
... As software systems continue to grow in size and complexity, their maintenance continues to become more challenging and costly [24], [13]. To improve the quality and maintainability of software systems, developers take advantage of refactoring as a means to improve the structure of code without affecting its external behavior [18]. ...
Article
http://deepblue.lib.umich.edu/bitstream/2027.42/170139/1/ASE2021_DependencyIntelligentRefcatoringfv__Copy_.pdf
... The metaphor of code smells refers to the software quality issues impairing the maintainability of a software system [1], [2]. Architecture smells are quality issues at architecture granularity affecting software quality adversely [3], [4]. ...
... For instance, the transformation to unfold a function definition [11] is used in both Code Repair and Shaping stages; e.g. in the former, it allows loops to be merged, and in the latter, it allows the elimination of intermediate queues. The extract method [21] transformation can be similarly used to lift a pipeline into a self-contained function, or to lift its individual stages (back) into separate functions. ...
Article
Full-text available
Parallel patterns are a high-level programming paradigm that enables non-experts in parallelism to develop structured parallel programs that are maintainable, adaptive, and portable whilst achieving good performance on a variety of parallel systems. However, there still exists a large base of legacy-parallel code developed using ad-hoc methods and incorporating low-level parallel/concurrency libraries such as pthreads without any parallel patterns in the fundamental design. This code would benefit from being restructured and rewritten into pattern-based code. However, the process of rewriting the code is laborious and error-prone, due to typical concurrency and pthreading code being closely intertwined throughout the business logic of the program. In this paper, we present a new software restoration methodology, to transform legacy-parallel programs implemented using pthreads into structured farm and pipeline patterned equivalents. We demonstrate our restoration technique on a number of benchmarks, allowing the introduction of patterned farm and pipeline parallelism in the resulting code; we record improvements in cyclomatic complexity and speedups on a number of representative benchmarks.
... The metaphor of code smells refers to the software quality issues impairing the maintainability of a software system [1], [2]. Architecture smells are quality issues at architecture granularity affecting software quality adversely [3], [4]. ...
... It has been observed that the continuous changes made over software system degrade design structure that results in poor understandability and maintainability (Lehman, 1979). To ensure the design quality of software the developers have to follow the various guidelines and principles while developing a software system (Fowler, 1999). But during software evolution due to fast delivery and budget constraints, developers make the changes over the software without considering the design principles of the system (Mkaouer et al., 2015). ...
Preprint
Full-text available
The quality of modular structure of a software system highly affects the success of a software project. Software remodularisation which is used to improve the software structure is a complex task and involves the optimisation of multiple conflicting aspects. To address the optimisation of multiple objectives, many metaheuristic optimisation algorithms have been designed. The customisation of these algorithms according to the suitability of real-world multi-objective software remodularisation problem is a challenging task. In this article, particle swarm optimisation (PSO) a widely used metaheuristic heuristic technique is customised and proposed a PSO-based multi-objective software remodularisation (PSO-MoSR) to address the optimisation of multiple objective issues of software remodularisation. The effectiveness of the proposed PSO-MoSR is evaluated by conducting several experiments by modularising 17 real-world software systems.
... Most of the previous works describe infrastructure code quality in terms of smelliness [5] and defects-proneness of Chef and Puppet infrastructure components. From a smelliness perspective, Schwarz et al. [21], Spinellis et al. [22], and Rahman et al. [18] applied the well-know concept to IaC, and identified code smells that can be grouped into four groups: (i) Implementation Configuration such as complex expressions and deprecated statements; (ii) Design Configuration such as broken hierarchies and duplicate blocks; (iii) Security Smells such as admin by default and hard-coded secrets; (iv) General Smells such as long resources and too many attributes. ...
Conference Paper
Linguistic anti-patterns are recurring poor practices concerning inconsistencies among the naming, documentation, and implementation of an entity. They impede readability, understandability, and maintainability of source code. This paper attempts to detect linguistic anti-patterns in infrastructure as code (IaC) scripts used to provision and manage computing environments. In particular, we consider inconsistencies between the logic/body of IaC code units and their names. To this end, we propose a novel automated approach that employs word embeddings and deep learning techniques. We build and use the abstract syntax tree of IaC code units to create their code embedments. Our experiments with a dataset systematically extracted from open source repositories show that our approach yields an accuracy between 0.785 and 0.915 in detecting inconsistencies.
Chapter
Full-text available
The Ernst Denert Award is already existing since 1992, which does not only honor the award winners but also the software engineering field in total. Software engineering is a vivid and intensively extending field that regularly spawns new subfields such as automotive software engineering , research software engineering , or quantum software engineering , covering specific needs but also generalizing solutions, methods, and techniques when they become applicable. This is the introductory chapter of the book on the Ernst Denert Software Engineering Award 2022. It provides an overview of the five nominated PhD theses.
Article
Purpose: This study examined public school (PS) speech-language pathologists' (SLPs') perceived confidence in managing pediatric feeding disorders (PFDs). Perceived confidence is a rater's self-reported assurance level to manage PFDs. The study then looked for relationships between personal and professional factors that might account for perceived confidence. Geographic location as well as administrative supports and resources were also examined. Method: Participants were PS SLPs from across the United States who were recruited via American Speech-Language-Hearing Association Special Interest Groups. This study measured perceived confidence with a 5-point Likert-type scale for 17 roles and responsibilities in PFD management. Pearson and Spearman correlations were used to identify relationships with personal and professional characteristics. Results: PS SLPs perceived themselves as having low confidence in managing PFDs. Personal and professional characteristics account for low perceived confidence (e.g., number of graduate courses, clinical experience with swallowing and feeding in early intervention or medical settings, managing swallowing and feeding currently, having more administrative support). Conclusions: This study provided a more representative sample (i.e., geographic regions) of PS SLPs. Perceived confidence in PFD management is linked to factors that can be modified through personal and professional changes.
Chapter
Coccinelle is a program matching and transformation engine for C code. This paper introduces the use of Coccinelle through a collection of examples targeting evolutions and bug fixes in the Linux kernel.KeywordsLinux kernelCoccinelleProgram transformation
Article
Full-text available
Architectural smells (AS) are notorious for their long-term impact on the Maintainability and Evolvability of software systems. The majority of research work has investigated this topic by mining software repositories of open source Java systems, making it hard to generalise and apply them to an industrial context and other programming languages. To address this research gap, we conducted an embedded multiple-case case study, in collaboration with a large industry partner, to study how AS evolve in industrial embedded systems. We detect and track AS in 9 C/C++ projects with over 30 releases for each project that span over two years of development, with over 20 millions lines of code in the last release only. In addition to these quantitative results, we also interview 12 among the developers and architects working on these projects, collecting over six hours of qualitative data about the usefulness of AS analysis and the issues they experienced while maintaining and evolving artefacts affected by AS. Our quantitative findings show how individual smell instances evolve over time, how long they typically survive within the system, how they overlap with instances of other smell types, and finally what the introduction order of smell types is when they overlap. Our qualitative findings, instead, provide insights on the effects of AS on the long-term maintainability and evolvability of the system, supported by several excerpts from our interviews. Practitioners also mention what parts of the AS analysis actually provide actionable insights that they can use to plan refactoring activities.
Chapter
Full-text available
We explain what properties the jury looked for to identify strong contributions and why they are important. They are formulated as seven pieces of advice: (1) Be in scope, (2) Enumerate your assumptions, (3) Delineate your contribution, (4) Honestly discuss limitations, (5) Show usefulness and practical applicability, (6) Have a well-prepared nutshell, and (7) Be timeless.
Chapter
Full-text available
Differential software testing is important for software quality assurance as it aims to automatically generate test inputs that reveal behavioral differences in software. Detecting regression bugs in software evolution, analyzing side-channels in programs, maximizing the execution cost of a program over multiple executions, and evaluating the robustness of neural networks are instances of differential software analysis to generate diverging executions of program paths. The key challenge thereby is to simultaneously reason about multiple program paths, often across program variants, in an efficient way. Existing work in differential testing is often not (specifically) directed to reveal a different behavior or is limited to a subset of the search space. This work proposes the concept of Hybrid Differential Software Testing ( HyDiff ) as a hybrid analysis technique to generate difference revealing inputs. HyDiff consists of two components that operate in a parallel setup: (1) a search-based technique that inexpensively generates inputs and (2) a systematic exploration technique to also exercise deeper program behaviors. HyDiff ’s search-based component uses differential fuzzing directed by differential heuristics. HyDiff ’s systematic exploration component is based on differential dynamic symbolic execution that allows to incorporate concrete inputs in its analysis. HyDiff is evaluated experimentally with applications specific for differential testing. The results show that HyDiff is effective in all considered categories and outperforms its components in isolation.
Chapter
Full-text available
Modern software architectures are becoming increasingly complex and interdependent. The days of exclusive in-house software development by companies are over. A key force contributing to this shift is the abundant use of open source frameworks, components, and libraries in software development. Over 90% of all software products include open source components. Being efficient, robust, and affordable, they often cover the non-differentiating product requirements companies have. However, the uncontrolled use of open source software in products comes with legal, engineering, and business risks stemming from incorrect software licensing, copyright issues, and supply chain vulnerabilities. While recognized by a handful of companies, this topic remains largely ignored by the industry and little studied by the academia. To address this relevant and novel topic, we undertook a 3-year research project into open source governance in companies, which resulted in a doctoral dissertation. The key results of our work include a theory of industry best practices, where we captured how more than 20 experts from 15 companies worldwide govern their corporate use of open source software. Acknowledging the broad industry relevance of our topic, we developed a handbook for open source governance that enabled practitioners from various domains to apply our findings in their companies. We conducted three evaluation case studies, where more than 40 employees at three Germany-based multinational companies applied our proposed best practices. This chapter presents the highlights of building and implementing the open source governance handbook.
Chapter
Full-text available
Modern embedded software systems are becoming more and more complex. Engineering embedded systems raise specific challenges that are rarely present in other software engineering disciplines due to the systems’ steady interactions with their environment. Research and industry often describe embedded systems as component and connector models (C&C). C&C models describe the logical architecture by focusing on software features and their logical communications. In C&C models, hierarchical decomposed components encapsulate features, and connectors model the data flow between components via typed ports. As extra-functional properties, for example, safety and security, are also key features of embedded systems, C&C models are mostly enriched with them. However, the process to develop, understand, validate, and maintain large C&C models for complex embedded software is onerous, time consuming, and cost intensive. Hence, the aim of this chapter is to support the automotive software engineer with: (i) automatic consistency checks of large C&C models, (ii) automatic verification of C&C models against design decisions, (iii) tracing and navigating between design and implementation models, (iv) finding structural inconsistencies during model evolution, (v) presenting a flexible approach to define different extra-functional properties for C&C models, and (vi) providing a framework to formalize constraints on C&C models for extra-functional properties for automatic consistency checks.
Chapter
Full-text available
This is the introductory chapter of the book on the Ernst Denert Software Engineering Award 2020. It provides an overview of the 11 nominated PhD theses, the work of the award winner, and the structure of the book.
Chapter
Full-text available
Legacy systems are business-critical software systems whose failure can have a significant impact on the business. Yet, their maintenance and adaption to changed requirements consume a considerable amount of the total software development costs. Frequently, domain experts and developers involved in the original development are not available anymore, making it difficult to adapt a legacy system without introducing bugs or unwanted behavior. This results in a dilemma: businesses are reluctant to change a working system, while at the same time struggling with its high maintenance costs. We propose the concept of Structured Software Reengineering replacing the ad hoc forward engineering part of a reengineering process with the application of behavior-preserving, proven-correct transformations improving nonfunctional program properties. Such transformations preserve valuable business logic while improving properties such as maintainability, performance, or portability to new platforms. Manually encoding and proving such transformations for industrial programming languages, for example, in interactive proof assistants, is a major challenge requiring deep expert knowledge. Existing frameworks for automatically proving transformation rules have limited expressiveness and are restricted to particular target applications such as compilation or peep-hole optimizations. We present Abstract Execution , a specification and verification framework for statement-based program transformation rules on JAVA programs building on symbolic execution. Abstract Execution supports universal quantification over statements or expressions and addresses properties about the (big-step) behavior of programs. Since this class of properties is useful for a plethora of applications, Abstract Execution bridges the gap between expressiveness and automation. In many cases, fully automatic proofs are in possible. We explain REFINITY, a workbench for modeling and proving statement-level JAVA transformation rules, and discuss our applications of Abstract Execution to code refactoring, cost analysis of program transformations, and transformations reshaping programs for the application of parallel design patterns.
Chapter
Full-text available
Recent advances in mobile connectivity as well as increased computational power and storage in sensor devices have given rise to a new family of software architectures with challenges for data and communication paths as well as architectural reconfigurability at runtime. Established in 2012, Fog Computing describes one of these software architectures. It lacks a commonly accepted definition, which manifests itself in the missing support for mobile applications as well as dynamically changing runtime configurations. The dissertation “Dynamically Scalable Fog Architectures” provides a framework that formalizes Fog Computing and adds support for dynamic and scalable Fog Architectures. The framework called xFog (E x tension for Fog Computing) models Fog Architectures based on set theory and graphs. It consists of three parts: xFogCore, xFogPlus, and xFogStar. xFogCore establishes the set theoretical foundations. xFogPlus enables dynamic and scalable Fog Architectures to dynamically add new components or layers. Additionally, xFogPlus provides a View concept which allows stakeholders to focus on different levels of abstraction. These formalizations establish the foundation for new concepts in the area of Fog Computing. One such concept, xFogStar, provides a workflow to find the best service configuration based on quality of service parameters. The xFog framework has been applied in eight case studies to investigate the applicability of dynamic Fog Components, scalable Fog Architectures, and the service provider selection at runtime. The case studies, covering different application domains—ranging from smart environments, health, and metrology to gaming—successfully demonstrated the feasibility of the formalizations provided by xFog, the dynamic change of Fog Architectures by adding new components and layers at runtime, as well as the applicability of a workflow to establish the best service configuration.
Chapter
Full-text available
Debugging is one of the most expensive and challenging phases in the software development life-cycle. One important cost factor in the debugging process is the time required to analyze failures and find underlying faults. Two types of techniques that can help developers to reduce this analysis time are Failure Clustering and Automated Fault Localization. Although there is a plethora of these techniques in the literature, there are still some gaps that prevent their operationalization in real-world contexts. Besides, the abundance of these techniques confuses the developers in selecting a suitable method for their specific domain. In order to help developers in reducing analysis time, we propose methodologies and techniques that can be used standalone or in a form of a tool-chain. Utilizing this tool-chain, developers (1) know which data they need for further analysis, (2) are able to group failures based on their root causes, and (3) are able to find more information about the root causes of each failing group. Our tool-chain was initially developed based on state-of-the-art failure diagnosis techniques. We implemented and evaluated existing techniques. We built on and improved them where the results were promising and proposed new solutions where needed. The overarching goal of this study has been the applicability of techniques in practice.
Chapter
Full-text available
Software requirements specifications (SRS) serve as an important source of information for a variety of roles involved in software engineering (SE) projects. This situation poses a challenge to requirements engineers: Different information needs have to be addressed, which are strongly dependent on the particular role(s) that SRS stakeholders have within a project. This chapter summarizes the contributions of a thesis that aimed to address and reduce role-specific defects in SRS that negatively influence the efficient usage and acceptance of these documents. To achieve this goal, we collected empirical data about role-specific information needs in a series of empirical studies that served as a baseline for a secondary analysis toward the definition of role-specific views. Moreover, we realized a proof-of-concept implementation that is capable of generating role-specific views on SRS. The results of a case study revealed that role-specific views have the potential to efficiently support SRS consumers during the analysis of a given SRS. Besides conducting further empirical studies in industry, future work aims to foster cross-disciplinary collaboration and requirements communication, especially in agile teams. Thereby, we are exploring synergy potential with best practices from non-SE disciplines.
Chapter
Full-text available
Structuring control flow is an essential task almost every programmer faces on a daily basis. At the same time, the control flow of software applications is becoming increasingly complicated, motivating languages to include more and more features like asynchronous programming and generators. Effect handlers are a promising alternative since they can express many of these features as libraries. To bring effect handlers closer to the software engineering practice, we present capability passing as an implementation technique for effect handlers. Capability passing provides the basis for the integration of effect handlers into mainstream object-oriented programming languages and thereby unlocks novel modularization strategies. It also enables programmers to apply lexical reasoning about effects and gives rise to a new form of effect polymorphism. Finally, it paves the path for efficient compilation strategies of control effects.
Chapter
Full-text available
The reliable operation of systems with both timing and energy requirements is a fundamental challenge in the area of safety-critical embedded systems. In order to provide guarantees for the execution of tasks within given resource budgets, these systems demand bounds of the worst-case execution time (WCET) and the worst-case energy consumption (WCEC). While static WCET analysis techniques are well established in the software development process of real-time systems nowadays, these program analysis techniques are not directly applicable to the fundamentally different behavior of energy consumption and the determination of the WCEC. Besides the missing approaches for WCEC bounds, the domain of worst-case analyses generally faces the problem that the accuracy and validity of reported analysis bounds are unknown: Since the actual worst-case resource consumption of existing benchmark programs cannot be automatically determined, a comprehensive validation of these program analysis tools is not possible. This summary of my dissertation addresses these problems by first describing a novel program analysis approach for WCEC bounds, which accounts for temporarily power-consuming devices, scheduling with fixed real-time priorities, synchronous task activations, and asynchronous interrupt service routines. Regarding the fundamental problem of validating worst-case tools, this dissertation presents a technique for automatically generating benchmark programs. The generator combines program patterns so that the worst-case resource consumption is available along with the generated benchmark. Knowledge about the actual worst-case resource demand then serves as the baseline for evaluating and validating program analysis tools. The fact the benchmark generator helped to reveal previously undiscovered software bugs in a widespread WCET tool for safety-critical systems underlines the relevance of such a structured testing technique.
Chapter
Full-text available
During pair programming (PP), two software developers work closely together on a technical task on one computer. Practitioners expect a number of benefits, such as faster progress, higher quality, and knowledge transfer. Much of prior research focused on directly measurable effects from laboratory settings, but could not explain the large variations observed. My research follows the Grounded Theory Methodology and is aimed at understanding how PP actually works by uncovering the underlying mechanisms to ultimately formulate practical advice for developers. The main findings from my qualitative analysis of recordings of 27 industrial PP sessions are: Task-specific knowledge about the software system is crucial for pair programming. Pairs first make sure they have a shared understanding of the relevant parts before they acquire lacking knowledge together. The transfer of general software development knowledge plays a rather small role and only occurs after the pair dealt with its need for system knowledge. Pairs who maintain a shared understanding may have short, but highly-productive Focus Phases ; if their Togetherness gets too low, however, a Breakdown of the pair process may occur.
Chapter
Full-text available
The demanded fast innovation cycles of the ongoing digital transformation create an unstable environment in which the demands of heterogeneous professional communities need to be addressed. Moreover, the information systems infrastructure of these professional communities has a strong influence on their practices. However, the evolution of the web as infrastructure is shaped by an interplay of new technologies and innovative applications. It is characterized by contrasts, such as centralized versus peer-to-peer architectures and a large number of end users versus a small number of developers. Therefore, our aim is to stabilize these dichotomies apparent in the web by means of an agile information systems development methodology. The DevOps approach promotes stronger cooperation between development and operations teams. Our DevOpsUse methodology additionally fosters a stronger involvement of end-user communities in software development by including them in the process of infrastructuring, that is, the appropriation of infrastructure during its usage. The developed DevOpsUse methodology and support tools have been successfully validated by the transitions between three generations of technologies: near real-time peer-to-peer web architectures, edge computing, and the Internet of Things. In particular, we were able to demonstrate our methodology’s capabilities through longitudinal studies in several large-scale international digitalization projects. Beyond web information systems, the framework and its open-source tools are applicable in further areas like Industry 4.0. Its broad adaptability testifies that DevOpsUse has the potential to unlock capabilities for sustainable innovation.
Article
Refactoring is widely adopted nowadays in the industry to restructure the code and meet high quality while preserving the external behavior. Many of the existing refactoring tools and research are based on search-based techniques to find relevant recommendations by finding trade-offs between different quality attributes. While these techniques show promising results on open-source and industry projects, they lack explanations of the recommended changes which can impact their trustworthiness when adopted in practice by developers. Furthermore, most of the adopted search-based techniques are based on random population generation and random change operators (e.g. crossover and mutation). However, it is critical to understand which good refactoring patterns may exist when applying change operators to either keep or exchange them with other solutions rather than destroying them with random changes. In this paper, we propose an enhanced knowledge-informed multi-objective search algorithm, called X-SBR, to provide explanations for refactoring solutions and improve the generated recommendations. First, we generate association rules using the Apriori algorithm to find relationships between applied refactorings in previous commits, their locations, and their rationale (quality improvements). Then, we use these rules to 1) initialize the population, 2) improve the change operators and seeding mechanisms of the multi-objective search in order to preserve and exchange good patterns in the refactoring solutions, and 3) explain how a sequence of refactorings collaborate in order to improve the quality of the system (e.g. fitness functions). The validation on large open-source systems shows that X-SBR provides refactoring solutions of better quality than those given by the state-of-the-art techniques in terms of reducing the invalid refactorings, improving the quality, and increasing the trustworthiness of the developers in the suggested refactorings via the provided explanations.
Article
Successful software products evolve through a process of continual change. However, this process may weaken the design of the software and make it unnecessarily complex, leading to significantly reduced productivity and increased fault-proneness. Refactoring improves the software design while preserving overall functionality and behavior, and is an important technique in managing the growing complexity of software systems. Most of the existing work on software refactoring uses either an entirely manual or a fully automated approach. Manual refactoring is time-consuming, error-prone and unsuitable for large-scale, radical refactoring. On the other hand, fully automated refactoring yields a static list of refactorings which, when applied, leads to a new and often hard to comprehend design. Furthermore, it is difficult to merge these refactorings with other changes performed in parallel by developers. In this paper, we propose a refactoring recommendation approach that dynamically adapts and interactively suggests refactorings to developers and takes their feedback into consideration. Our approach uses NSGA-II to find a set of good refactoring solutions that improve software quality while minimizing the deviation from the initial design. These refactoring solutions are then analyzed to extract interesting common features between them such as the frequently occurring refactorings in the best non-dominated solutions. Based on this analysis, the refactorings are ranked and suggested to the developer in an interactive fashion as a sequence of transformations. The developer can approve, modify or reject each of the recommended refactorings, and this feedback is then used to update the proposed rankings of recommended refactorings. After a number of introduced code changes and interactions with the developer, the interactive NSGA-II algorithm is executed again on the new modified system to repair the set of refactoring solutions based on the new changes and the feedback received from the developer. We evaluated our approach on a set of eight open source systems and two industrial projects provided by an industrial partner. Statistical analysis of our experiments shows that our dynamic interactive refactoring approach performed significantly better than four existing search-based refactoring techniques and one fully-automated refactoring tool not based on heuristic search.
Article
Full-text available
Software refactoring is a software maintenance action to improve the software internal quality without changing its external behavior. During the maintenance process, structural refactoring is performed by remodularizing the source code. Software clustering is a modularization technique to remodularize artifacts of source code aiming to improve readability and reusability. Due to the NP hardness of the clustering problem, evolutionary approaches such as the genetic algorithm have been used to solve this problem. In the structural refactoring literature, there exists no search-based algorithm that employs a hierarchical approach for modularization. Utilizing global and local search strategies, in this paper, a new search-based top-down hierarchical clustering approach, named TDHC, is proposed that can be used to modularize the system. The output of the algorithm is a tree in which each node is an artifact composed of all artifacts in its subtrees and is a candidate to be a software module (i.e., cluster). This tree helps a software maintainer to have better vision on source code structure to decide appropriate composition points of artifacts aiming to create modules (i.e., files, packages, and components). Experimental results on seven folders of Mozilla Firefox with different functionalities and five other software systems show that the TDHC produces modularization closer to the human expert’s decomposition (i.e., directory structure) than the other existing algorithms. The proposed algorithm is expected to help a software maintainer for better remodularization of a source code. The source codes and dataset related to this paper can be accessed at https://github.com/SoftwareMaintenanceLab.
ResearchGate has not been able to resolve any references for this publication.