Metric-based code smell detection technique for python software
In software life cycle, maintenance is reported to cost between 80% and 90% of the total software cost. Instead of improving, software quality can deteriorate if maintenance of software is not carried out in line with design principles. A term, “code smell” has been framed to refer to software co...
Saved in:
Main Author: | |
---|---|
Format: | Thesis |
Language: | English |
Published: |
2018
|
Subjects: | |
Online Access: | http://psasir.upm.edu.my/id/eprint/90722/1/FSKTM%202019%2055%20IR.pdf http://psasir.upm.edu.my/id/eprint/90722/ |
Tags: |
Add Tag
No Tags, Be the first to tag this record!
|
id |
my.upm.eprints.90722 |
---|---|
record_format |
eprints |
spelling |
my.upm.eprints.907222021-09-12T13:33:51Z http://psasir.upm.edu.my/id/eprint/90722/ Metric-based code smell detection technique for python software Leeman, Samaila Ja'afaru In software life cycle, maintenance is reported to cost between 80% and 90% of the total software cost. Instead of improving, software quality can deteriorate if maintenance of software is not carried out in line with design principles. A term, “code smell” has been framed to refer to software constructs that deviates from design principles’ implementation. Refactoring, a process of removing code smells has been recommended to improve maintainability qualities. However, for refactoring to be applied, code smells must be detected in the location where they exist. While research on code smells in Java and C++ programmed codes is mature, similar research in Python software is scarce. There are few literatures that show metric-based approaches have been used to detect code smells in Python Software. However, the techniques require selection of metrics and a tedious calibration of threshold upon which detection is done. Existing metric-based techniques anticipates parser to handle only one version of Python though Python 2 and 3 are popular and end of life for Python 2 has been announced. This research proposes an enhanced metric-based technique named PySTect that extracts structural information from parsed models of any version of Python software and translates them into metrics for detection of code smells. This research is divided into four phases. The first phase involves reviewing the literatures on code smells detection techniques, parser models, and code smells in Python software. In the second phase, details of conceptual and architectural design of the metric-based technique are presented. Thirdly, PySTect technique is implemented and evaluated in three experiments. In the first experiment, precision and recall of 100% and 96% were recorded which indicates the effectiveness of the PySTect technique in detecting five code smells. In the second and third experiments 1,167,180 lines of code from 13 open source Python projects are analysed. Results of the second experiment shows codes smell increases with evolution of Python software projects and the third experiment indicates the most dominant smells in Python SDKs are Lazy Class, Improper Method Declaration, a Python specific smell and large class, in that order. This research work has proposed an enhanced metric-based detection technique for Python software that analyses Python codes irrespective of its versions and extracts thresholds from good designed codes saving developers effort to calibrate threshold. It has contributed in specifying and detecting a new code smell, Improper Method Declaration and also confirmed that dynamic programming language suffers from large class, lazy class, long method and long parameter list like static languages. Lastly, this research found that code smells increases in Python programs with evolution and, lazy class and improper method declaration should be prioritized in SDK domain. 2018-03 Thesis NonPeerReviewed text en http://psasir.upm.edu.my/id/eprint/90722/1/FSKTM%202019%2055%20IR.pdf Leeman, Samaila Ja'afaru (2018) Metric-based code smell detection technique for python software. Masters thesis, Universiti Putra Malaysia. Software maintenance Python (Computer program language) |
institution |
Universiti Putra Malaysia |
building |
UPM Library |
collection |
Institutional Repository |
continent |
Asia |
country |
Malaysia |
content_provider |
Universiti Putra Malaysia |
content_source |
UPM Institutional Repository |
url_provider |
http://psasir.upm.edu.my/ |
language |
English |
topic |
Software maintenance Python (Computer program language) |
spellingShingle |
Software maintenance Python (Computer program language) Leeman, Samaila Ja'afaru Metric-based code smell detection technique for python software |
description |
In software life cycle, maintenance is reported to cost between 80% and 90% of the
total software cost. Instead of improving, software quality can deteriorate if
maintenance of software is not carried out in line with design principles. A term,
“code smell” has been framed to refer to software constructs that deviates from
design principles’ implementation. Refactoring, a process of removing code smells
has been recommended to improve maintainability qualities. However, for
refactoring to be applied, code smells must be detected in the location where they
exist. While research on code smells in Java and C++ programmed codes is mature,
similar research in Python software is scarce. There are few literatures that show
metric-based approaches have been used to detect code smells in Python Software.
However, the techniques require selection of metrics and a tedious calibration of
threshold upon which detection is done. Existing metric-based techniques anticipates
parser to handle only one version of Python though Python 2 and 3 are popular and
end of life for Python 2 has been announced. This research proposes an enhanced
metric-based technique named PySTect that extracts structural information from
parsed models of any version of Python software and translates them into metrics for
detection of code smells. This research is divided into four phases. The first phase
involves reviewing the literatures on code smells detection techniques, parser
models, and code smells in Python software. In the second phase, details of
conceptual and architectural design of the metric-based technique are presented.
Thirdly, PySTect technique is implemented and evaluated in three experiments. In
the first experiment, precision and recall of 100% and 96% were recorded which
indicates the effectiveness of the PySTect technique in detecting five code smells. In
the second and third experiments 1,167,180 lines of code from 13 open source
Python projects are analysed. Results of the second experiment shows codes smell
increases with evolution of Python software projects and the third experiment
indicates the most dominant smells in Python SDKs are Lazy Class, Improper
Method Declaration, a Python specific smell and large class, in that order. This research work has proposed an enhanced metric-based detection technique for
Python software that analyses Python codes irrespective of its versions and extracts
thresholds from good designed codes saving developers effort to calibrate threshold.
It has contributed in specifying and detecting a new code smell, Improper Method
Declaration and also confirmed that dynamic programming language suffers from
large class, lazy class, long method and long parameter list like static languages.
Lastly, this research found that code smells increases in Python programs with
evolution and, lazy class and improper method declaration should be prioritized in
SDK domain. |
format |
Thesis |
author |
Leeman, Samaila Ja'afaru |
author_facet |
Leeman, Samaila Ja'afaru |
author_sort |
Leeman, Samaila Ja'afaru |
title |
Metric-based code smell detection technique for python software |
title_short |
Metric-based code smell detection technique for python software |
title_full |
Metric-based code smell detection technique for python software |
title_fullStr |
Metric-based code smell detection technique for python software |
title_full_unstemmed |
Metric-based code smell detection technique for python software |
title_sort |
metric-based code smell detection technique for python software |
publishDate |
2018 |
url |
http://psasir.upm.edu.my/id/eprint/90722/1/FSKTM%202019%2055%20IR.pdf http://psasir.upm.edu.my/id/eprint/90722/ |
_version_ |
1712286799227781120 |
score |
13.211869 |