• Title/Summary/Keyword: Code Smells

Search Result 7, Processing Time 0.021 seconds

Automated Code Smell Detection and Refactoring using OCL (OCL을 이용한 자동화된 코드스멜 탐지와 리팩토링)

  • Kim, Tae-Woong;Kim, Tae-Gong
    • The KIPS Transactions:PartD
    • /
    • v.15D no.6
    • /
    • pp.825-840
    • /
    • 2008
  • Refactoring is a kind of software modification process that improves system qualities internally but maintains system functions externally. What should be improved on the existing source codes should take precedence over the others in such a modification process using this refactoring. Martin Fowler and Kent Beck proposed a method that identifies code smells for this purpose. Also, some studies on determining what refactoring will be applied to which targets through detecting code smells in codes were presented. However, these studies have a lot of disadvantages that show a lack of precise description for such code smells and detect limited code smells only. In addition, these studies showed other disadvantages that generate ambiguity in behavior preservation due to the fact that a description method of pre-conditions for the behavior preservation is included in a refactoring process or unformalized. Thus, our study represents a precise specification of code smells using OCL and proposes a framework that performs a refactoring process through the automatic detection of code smells using an OCL interpreter. Furthermore, we perform the automatic detection in which the code smells are be specified by using OCL to the java program and verify its applicability and effectivity through applying a refactoring process.

Application Consideration of Machine Learning Techniques in Satellite Systems

  • Jin-keun Hong
    • International journal of advanced smart convergence
    • /
    • v.13 no.2
    • /
    • pp.48-60
    • /
    • 2024
  • With the exponential growth of satellite data utilization, machine learning has become pivotal in enhancing innovation and cybersecurity in satellite systems. This paper investigates the role of machine learning techniques in identifying and mitigating vulnerabilities and code smells within satellite software. We explore satellite system architecture and survey applications like vulnerability analysis, source code refactoring, and security flaw detection, emphasizing feature extraction methodologies such as Abstract Syntax Trees (AST) and Control Flow Graphs (CFG). We present practical examples of feature extraction and training models using machine learning techniques like Random Forests, Support Vector Machines, and Gradient Boosting. Additionally, we review open-access satellite datasets and address prevalent code smells through systematic refactoring solutions. By integrating continuous code review and refactoring into satellite software development, this research aims to improve maintainability, scalability, and cybersecurity, providing novel insights for the advancement of satellite software development and security. The value of this paper lies in its focus on addressing the identification of vulnerabilities and resolution of code smells in satellite software. In terms of the authors' contributions, we detail methods for applying machine learning to identify potential vulnerabilities and code smells in satellite software. Furthermore, the study presents techniques for feature extraction and model training, utilizing Abstract Syntax Trees (AST) and Control Flow Graphs (CFG) to extract relevant features for machine learning training. Regarding the results, we discuss the analysis of vulnerabilities, the identification of code smells, maintenance, and security enhancement through practical examples. This underscores the significant improvement in the maintainability and scalability of satellite software through continuous code review and refactoring.

A Catalog of Bad Smells in Design-by-Contract Methodologies with Java Modeling Language

  • Viana, Thiago
    • Journal of Computing Science and Engineering
    • /
    • v.7 no.4
    • /
    • pp.251-262
    • /
    • 2013
  • Bad smells are usually related to program source code, arising from bad design and programming practices. Refactoring activities are often motivated by the detection of bad smells. With the increasing adoption of Design-by-Contract (DBC) methodologies in formal software development, evidence of bad design practices can similarly be found in programs that combine actual production code with interface contracts. These contracts can be written in languages, such as the Java Modeling Language (JML), an extension to the Java syntax. This paper presents a catalog of bad smells that appear during DBC practice, considering JML as the language for specifying contracts. These smells are described over JML constructs, although several can appear in other DBC languages. The catalog contains 6 DBC smells. We evaluate the recurrence of DBC smells in two ways: first by describing a small study with graduate student projects, and second by counting occurrences of smells in contracts from the JML models application programming interface (API). This API contains classes with more than 1,600 lines in contracts. Along with the documented smells, suggestions are provided for minimizing the impact or even removing a bad smell. It is believed that initiatives towards the cataloging of bad smells are useful for establishing good design practices in DBC.

A Systematic Literature Survey of Software Metrics, Code Smells and Refactoring Techniques

  • Agnihotri, Mansi;Chug, Anuradha
    • Journal of Information Processing Systems
    • /
    • v.16 no.4
    • /
    • pp.915-934
    • /
    • 2020
  • Software refactoring is a process to restructure an existing software code while keeping its external behavior the same. Currently, various refactoring techniques are being used to develop more readable and less complex codes by improving the non-functional attributes of software. Refactoring can further improve code maintainability by applying various techniques to the source code, which in turn preserves the behavior of code. Refactoring facilitates bug removal and extends the capabilities of the program. In this paper, an exhaustive review is conducted regarding bad smells present in source code, applications of specific refactoring methods to remove that bad smell and its effect on software quality. A total of 68 studies belonging to 32 journals, 31 conferences, and 5 other sources that were published between the years 2001 and 2019 were shortlisted. The studies were analyzed based on of bad smells identified, refactoring techniques used, and their effects on software metrics. We found that "long method", "feature envy", and "data class" bad smells were identified or corrected in the majority of studies. "Feature envy" smell was detected in 36.66% of the total shortlisted studies. Extract class refactoring approach was used in 38.77% of the total studies, followed by the move method and extract method techniques that were used in 34.69% and 30.61% of the total studies, respectively. The effects of refactoring on complexity and coupling metrics of software were also analyzed in the majority of studies, i.e., 29 studies each. Interestingly, the majority of selected studies (41%) used large open source datasets written in Java language instead of proprietary software. At the end, this study provides future guidelines for conducting research in the field of code refactoring.

Code Refactoring Techniques Based on Energy Bad Smells for Reducing Energy Consumption (Energy Bad Smells 기반 소모전력 절감을 위한 코드 리팩토링 기법)

  • Lee, Jae-Wuk;Kim, Doohwan;Hong, Jang-Eui
    • KIPS Transactions on Software and Data Engineering
    • /
    • v.5 no.5
    • /
    • pp.209-220
    • /
    • 2016
  • While the services of mobile devices like smart phone, tablet, and smart watch have been increased and varied, the software embedded into such devices has been also increased in size and functional complexity. Therefore, increasing operation time of mobile devices for serviceability became an important issue due to the limitation of battery power. Recent studies focus on the software development having efficient behavioral patterns because the energy consumption of mobile devices is caused by software behaviors which control the hardware operations. However, it is often difficult to develop the embedded software with considering energy-efficiency and behavior optimization due to the short development cycle of the mobile services in many cases. Therefore, this paper proposes the refactoring techniques for reducing energy consumption, and enables to fulfill the energy requirements during software development and maintenance. We defined energy bad smells with the code patterns that can excessively consume the energy, and our refactoring techniques are to remove these bad smells. We performed some case studies to verify the usefulness of our refactoring techniques.

Comparative Analysis of Cross-Platform and Native Mobile App Development Approaches (교차 플랫폼 및 네이티브 모바일 앱 개발 접근 방식의 비교 분석)

  • Ibrokhimov Sardorbek Rustam Ugli;Gyun Woo
    • Proceedings of the Korea Information Processing Society Conference
    • /
    • 2024.05a
    • /
    • pp.53-56
    • /
    • 2024
  • Though lots of approaches to develop mobile apps are suggested up to now, developers have difficulties selecting a right one. This study compares native and cross-platform application development approaches, particularly focusing on the shift in preference from Java to Kotlin and the increasing use of Flutter. This research offers practical insights into factors influencing developers' choice of programming languages and frameworks in mobile application development by creating identical applications using Java, Kotlin, and Dart (Flutter). Furthermore, this study explores the best practices for development by examining the quality of code in 45 open-source GitHub repositories. The study evaluates LOC and code smells using semi-automated SonarQube assessments to determine the effects of selecting a specific language or framework on code maintainability and development efficiency. Preliminary findings show differences in the quality of the code produced by the two approaches, offering developers useful information on how to best optimize language and framework selection to reduce code smells and improve project maintainability.

An Empirical Study on the Impact of Permission Smell in Android Applications

  • Wu, Zhiqiang;Lee, Hakjin;Lee, Scott Uk-Jin
    • Journal of the Korea Society of Computer and Information
    • /
    • v.26 no.6
    • /
    • pp.89-96
    • /
    • 2021
  • In this paper, we proposed a sniffer to detect permission smells from developer and third-party libraries' code. Moreover, we conducted an empirical study to investigate unnecessary permissions on large real-world Android apps. Our analysis indicates that permission smell extensively exists in Android apps. According to the results, permission smells exist in most Android apps. In particular, third-party libraries request permission for functionalities that are not used by developers, which cause more smells. Moreover, most developers do not properly disable unnecessary permissions that are declared for third-party libraries. We discussed the impacts of permission smells on user experiences. As a result, the existence of permission smell does not impact the number of downloads. However, apps that have more unnecessary permissions have received lower ratings from users.