• 제목/요약/키워드: Code Smells

검색결과 9건 처리시간 0.022초

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

  • 김태웅;김태공
    • 정보처리학회논문지D
    • /
    • 제15D권6호
    • /
    • pp.825-840
    • /
    • 2008
  • 리팩토링은 내부적으로는 시스템의 품질을 개선하고, 외부적으로는 시스템의 기능을 유지하는 일종의 소프트웨어를 변경하는 과정이다. 이러한 리팩토링을 적용하여 기존 소스코드를 개선하기 위해서는 개선할 사항이 무엇인지를 아는 것이 우선이다. 이를 위해 Martin Fowler와 Kent Beck은 코드속의 나쁜 냄새(코드스멜)를 식별할 수 있는 방법을 제시 하였다. 또한 코드스멜을 탐지하고 어디에 어떤 리팩토링을 적용할 것인가를 결정하는 문제와 관련된 몇몇 연구가 발표되었다. 그러나 이러한 연구들은 코드스멜에 대한 명확한 표현이 부족하거나 한정된 코드스멜만을 탐지하는 단점이 있다. 그리고 리팩토링을 적용할 경우 행위보존을 위한 선행조건들의 표현방법이 리팩토링 절차에 포함되어 있거나 정형화되지 않아 행위보존의 모호함이 발생되는 단점을 가지고 있다. 이에 본 논문에서는 OCL을 이용하여 코드스멜의 정보를 정확히 명세화하고, OCL 번역기를 통해 코드스멜을 자동으로 탐지하여 리팩토링하는 프레임워크를 제안한다. 또한 적용사례를 통하여 자바소스코드속의 코드스멜을 OCL로 명세화하여 자동탐지하고, 리팩토링을 적용해 봄으로써 활용성과 효용성을 검증해본다.

Application Consideration of Machine Learning Techniques in Satellite Systems

  • Jin-keun Hong
    • International journal of advanced smart convergence
    • /
    • 제13권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
    • /
    • 제7권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
    • /
    • 제16권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.

Metrics for Code Quality Check in SEED_mode.c

  • Jin-Kuen Hong
    • International Journal of Internet, Broadcasting and Communication
    • /
    • 제16권3호
    • /
    • pp.184-191
    • /
    • 2024
  • The focus of this paper is secure code development and maintenance. When it comes to safe code, it is most important to consider code readability and maintainability. This is because complex code has a code smell, that is, a structural problem that complicates code understanding and modification. In this paper, the goal is to improve code quality by detecting and removing smells existing in code. We target the encryption and decryption code SEED.c and evaluate the quality level of the code using several metrics such as lines of code (LOC), number of methods (NOM), number of attributes (NOA), cyclo, and maximum nesting level. We improved the quality of SEED.c through systematic detection and refactoring of code smells. Studies have shown that refactoring processes such as splitting long methods, modularizing large classes, reducing redundant code, and simplifying long parameter lists improve code quality. Through this study, we found that encryption code requires refactoring measures to maintain code security.

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

  • 이제욱;김두환;홍장의
    • 정보처리학회논문지:소프트웨어 및 데이터공학
    • /
    • 제5권5호
    • /
    • pp.209-220
    • /
    • 2016
  • 최근 스마트폰, 태블릿과 같은 기기의 사용량이 증가하면서, 이에 탑재되는 소프트웨어는 더욱 복잡해지고 규모가 커지고 있다. 배터리의 전력으로 구동되는 모바일 기기들은 전력 공급의 한계로 인해 운용시간을 증가시키는 것이 중요한 이슈이다. 최근에는 소프트웨어 동작이 하드웨어 구동을 통해 전력 소모를 일으킨다는 점에서, 효율적인 동작 패턴을 갖는 소프트웨어 개발에 대한 연구들이 진행되고 있다. 그러나 모바일 기기에 탑재되는 소프트웨어는 그 개발 주기가 짧은 경우가 많아 최적화와 전력 소모량을 반영하기 어려운 경우가 많다. 따라서 본 연구에서는 소모전력 절감을 위한 코드 리팩토링 기법을 제안하여, 소프트웨어 개발 및 유지보수에서 보다 용이하게 저전력 요구사항을 충족시키고자 한다. 이를 위해 전력 소모량을 감소시킬 수 있는 코드 패턴에 대하여 Energy Bad Smell을 식별하고, 이를 제거하기 위한 새로운 코드 리팩토링 기법을 제안하며, 실험을 통해 그 효용성을 검증하였다.

LEA 코드를 위한 코드 스멜 관점에서 메트릭 접근 (Metrics Approach in aspect of Code Smell for LEA Code)

  • 홍진근
    • 한국인터넷방송통신학회논문지
    • /
    • 제24권4호
    • /
    • pp.49-55
    • /
    • 2024
  • 코드 스멜은 Kent Beck에 의해 사용된 개념으로, 잠재적인 품질 문제를 나타내며 리팩토링의 필요성을 제시한다. 본 논문은 LEA 코드베이스에서 코드 스멜을 평가하며, 분류와 관련된 메트릭에 중점을 둔다. 연구에서는 LEA_core.c와 LEA.cpp를 분석하여 코드 품질과 복잡성의 차이를 강조한다. 또한 연구에서는 LOC, NOM, NOA, CYCLO, MAXNESTING, FANOUT와 같은 메트릭을 사용하여 크기, 복잡성, 결합도, 캡슐화, 상속, 응집도를 평가한다. 연구 결과에서는 LEA_core.c가 LEA.cpp에 비해 더 복잡하고 유지보수가 어려운 것으로 나타났다. 우리는 향후 연구에서 실시간 코드 스멜 탐지 및 리팩토링 제안을 위한 자동화 도구를 개발할 것이다.

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

  • 이브로키모브 사도르벡;우균
    • 한국정보처리학회:학술대회논문집
    • /
    • 한국정보처리학회 2024년도 춘계학술발표대회
    • /
    • 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
    • 한국컴퓨터정보학회논문지
    • /
    • 제26권6호
    • /
    • pp.89-96
    • /
    • 2021
  • 본 논문에서는 개발자가 작성한 코드와 써드파티 라이브러리로 인해 발생하는 Permission Smell을 탐지하여 그 영향에 대해 다각적으로 분석했다. 이를 위해서 실제 구글 플레이 스토어에 존재하는 Android 앱로 구성된 대규모 데이터셋을 활용하여 존재하는 Permission Smell의 영향을 조사 및 분석하는 실증적 연구를 수행하였다. 연구 결과에 따르면 대다수의 안드로이드 앱에 Permission Smell이 존재하며 특히 써드파티 라이브러리는 개발자가 사용하지 않는 기능에 대해서도 권한을 요구하므로 이러한 Smell 들을 더 많이 발생시킨다. 또한, 대다수의 개발자는 써드파티 라이브러리로 인해 선언된 불필요한 권한을 올바르게 비활성화하지 않는다는 것을 파악하였다. 이러한 결과를 바탕으로 본 논문에서는 Permission Smell이 사용자 경험에 미치는 영향에 대해 논의한다. 결과적으로 불필요한 권한을 요구하는 앱이더라도 다운로드 횟수에 영향을 주지는 않았다. 그러나 불필요한 권한을 요구하는 앱들은 사용자들로부터 더 낮은 평가를 받았다.