Code sniffer: a risk based smell detection framework to enhance code quality using static code analysis

نویسندگان

  • Ahmad Tahmid
  • Md. Nurul Ahad Tawhid
  • Sumon Ahmed
  • Kazi Sakib
چکیده

To maintain software and enhance its code quality, code smell, i.e., undesired design flaws need to be detected. However, as the system size increases, manual smell detection becomes difficult. In this paper, a static code analysis framework, named code sniffer, is proposed to detect code smells with predicting their risk severity. This has been calculated using code metrics, and defined as low, moderate and high. The system consists of three main components: parser extracts a syntax tree from the given source code to identify the code structure. The syntax tree is searched against the syntax of class and method. Analyser searches found classes and methods against various code syntax to identify key features like line of code (LOC), number of properties (NOP), etc. In smell and risk detector, code smells, risky code segments and their severity are detected as a set of quantitative values (using LOC, NOP, etc.) using which classes and methods are judged. A comparative case study of this risk based static analyser is performed with a dynamic analyser, FxCop, and the comparison results support each other.

برای دانلود رایگان متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Automation of Refactoring and Refactoring Suggestions for TTCN-3 Test Suites. The TRex TTCN-3 Refactoring and Metrics Tool

Refactoring is not only useful for source code of implementations, but as well for test specifications. The open source TRex tool automates the application of refactorings and the detection of refactoring opportunities for test suites that are specified using the standardised Testing and Test Control Notation (TTCN-3). Depending on the refactoring, the behaviour preserving transformations may i...

متن کامل

Code-Smells Detection using Good and Bad Software Design Examples

Code-Smells refer to design situations that may adversely affect the maintenance of software. They make a system difficult to change, which may in turn introduce bugs. Codesmells are detected, in general, using quality metrics that formalize some symptoms based on detection rules. We propose in this work to consider the problem of code-smells detection as a multi-objective problem where example...

متن کامل

A Framework for Reverse Engineering Large C++ Code Bases

When assessing the quality and maintainability of large C++ code bases, tools are needed for extracting several facts from the source code, such as: architecture, structure, code smells, and quality metrics. Moreover, these facts should be presented in such ways so that one can correlate them and find outliers and anomalies. We present SolidFX, an integrated reverse-engineering environment (IRE...

متن کامل

Code-Smells Detection as a Bi-Level Problem

Code-Smells represent design situations that can affect the maintenance and evolution of software. They make a system difficult to evolve. Code-smells are detected, in general, using quality metrics that represent some symptoms. However, the selection of suitable quality metrics is challenging due to the absence of consensus to identify some code-smells based on a set of symptoms and also the h...

متن کامل

An Empirical Study of Bad Smell in Code on Maintenance Effort

In this paper, we represent an automated code smell detection and refactoring tool for calculating risk factor by detecting Code Smells and decrease risk factor by Refactoring Techniques. Refactoring is a process for restructuring or improving internal structure of software without changing its behavior. A new code smell (Lazy Catch) detection is also presented. To achieve this aim Declarative ...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2017