Enhancing software quality: Python code smell detection using machine learning techniques and refactoring long methods using extract method algorithm

dc.contributor.advisorAzmain, Md. Aquib
dc.contributor.authorFerdoshi, Jannatul
dc.contributor.authorAbdullah, Shabab
dc.contributor.authorKnobo, Kazi Zunayed Quader
dc.contributor.authorUddin, Mohammed Sharraf
dc.date.accessioned2024-11-25T05:27:09Z
dc.date.available2024-11-25T05:27:09Z
dc.date.issued2024-05
dc.descriptionCatalogued from PDF version of thesis.
dc.descriptionIncludes bibliographical references (pages 65-68).
dc.descriptionThis thesis is submitted in partial fulfillment of the requirements for the degree of Bachelor of Science in Computer Science, 2024.
dc.description.abstractPython has witnessed substantial growth, establishing itself as one of the world’s most popular programming languages. Its versatile applications span various software and data science projects, empowered by features like classes, method chaining, lambda functions, and list comprehension. However, this flexibility introduces the risk of code smells, diminishing software quality, and complicating maintenance. While extensive research addresses code smells in Java, the Python landscape lacks comprehensive automated solutions. Our paper fills this gap in two ways. Firstly, by constructing a dataset using a tool from existing literature, Pysmell [16]. The tool, given a project directory, determines python files and produces comma separated files for code smells that are present in the python file. We create a dataset containing github projects and run the tool on our dataset. Then we select five comma separated code smell files: Large Class, Long Method, Long Lambda Function, Long Parameter List and Long Message Chain. The comma separated files are then combined to produce a multi-label dataset of code smells. Ensemble techniques and neural networks are trained on the dataset to analyse the performance of machine learning models in predicting code smells given a metric. Secondly, our approach extends to designing and building a simple automated refactoring algorithm, aiming to reduce long method code smells by extracting out large if-else statements and elevate overall software quality. In a landscape where automated detection and refactoring for Python code smells are nascent, our research contributes essential advancements.
dc.identifier.otherID 20301193
dc.identifier.otherID 20301005
dc.identifier.otherID 20241020
dc.identifier.otherID 20241018
dc.identifier.otherhttps://dspace.bracu.ac.bd/server/api/core/items/7639c3e1-8208-4afa-8622-678d15576ed9
dc.identifier.urihttp://hdl.handle.net/10361/24816
dc.language.isoen
dc.publisherBRAC University
dc.sourceBRAC University Institutional Repository
dc.subjectPython
dc.subjectCode refactoring
dc.subjectMachine learning
dc.subjectSoftware quality
dc.subjectSoftware maintenance
dc.subjectGitHub repositories
dc.titleEnhancing software quality: Python code smell detection using machine learning techniques and refactoring long methods using extract method algorithm
dc.typeThesis

Files

Original bundle

Now showing 1 - 1 of 1
Thumbnail Image
Name:
20241018, 20241020, 20301005, 20301193 _CSE.pdf
Size:
4.62 MB
Format:
Adobe Portable Document Format