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

검색결과 13건 처리시간 0.021초

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.

코드 리팩토링을 위한 확장된 IPO 기법 (Extended IPO technique for Code Refactoring)

  • 박재진;이재욱;홍장의
    • 한국정보과학회:학술대회논문집
    • /
    • 한국정보과학회 2012년도 한국컴퓨터종합학술대회논문집 Vol.39 No.1(B)
    • /
    • pp.255-257
    • /
    • 2012
  • 긴 파라미터 리스트(Long parameter list)는 소프트웨어 코드의 품질을 저해시키는 Bad Smell들 중 하나로써, 코드에 대한 이해도를 떨어뜨리고 코드의 변경을 어렵게 한다는 문제점이 있다. 이러한 문제를 해결하는 기법들 중 하나인 IPO(Introduce Parameter Object) 기법은 함께 사용되는 빈도가 높은 파라미터들을 하나의 클래스로 만든 후에 관련된 기능들을 해당 클래스의 메소드로 추출하여 사용하므로 코드의 중복을 막아 재사용성을 높이고 코드에 대한 이해도를 높일 수 있다. 하지만 IPO 기법의 주된 관심사는 파라미터 그룹의 발생 빈도에 초점을 두고 있으며, 커플링에 대한 고려가 충분히 이루어지지 않는다. 따라서 본 연구에서는 IPO 기법과 커플링의 관계를 분석하여 IPO 기법이 커플링까지 고려할 수 있도록 확장된 IPO기법을 제안한다. 제안된 기법은 기존의 기법에 비해 더 낮은 커플링을 달성하여 고품질의 코드를 얻을 수 있다.

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

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