Hadiningrum, Tiara Rahmania (2025) Evaluasi Teknik Refaktorisasi Code Smell Menggunakan Metrik Penilaian Reusability dan Testability Barbasis ISO/IEC 25023 pada Kode Program PHP. Masters thesis, Institut Teknologi Sepuluh Nopember.
Text
6025231079-Master_Thesis.pdf Restricted to Repository staff only until 1 April 2027. Download (4MB) | Request a copy |
Abstract
Dalam pengembangan perangkat lunak, kualitas kode memegang peranan penting dalam keberlanjutan, pemeliharaan, dan efisiensi sistem. Permasalahan yang sering terjadi dalam pengembangan perangkat lunak PHP adalah munculnya code smell yang dapat menurunkan kualitas kode dan mempersulit proses pengembangan. Meskipun tersedia berbagai teknik refaktorisasi, belum ada panduan yang terukur untuk memilih teknik yang tepat sesuai jenis code smell yang dihadapi. Penelitian ini bertujuan untuk mengidentifikasi code smell pada kode program PHP, menentukan teknik refaktorisasi yang sesuai untuk mengatasinya, serta menganalisis pengaruh penerapan teknik refaktorisasi tersebut berdasarkan standar ISO/IEC 25023. Evaluasi dilakukan dengan fokus pada metrik reusability (MRe-1G) yang mengukur rasio modul yang dirancang untuk mendukung penggunaan kembali kode, dan metrik testability (MTe-1G) yang mengevaluasi kelengkapan fungsi pengujian pada modul yang direfaktorisasi. Hasil penelitian menunjukkan bahwa code smell berhasil diidentifikasi pada kode PHP menggunakan tools seperti SonarQube, Code Climate, Codacy, dan Deep Source, yang kemudian divalidasi ulang secara manual. Untuk mengatasi code smell yang terdeteksi, teknik refaktorisasi seperti Move Method efektif mengatasi code smell seperti Lazy Class, dengan peningkatan reusability sebesar 0,94% dan testability sebesar 0,87%. Teknik Rename Comment meningkatkan reusability sebesar 0,30% dan testability sebesar 0,17%. Introduce Foreign Method menunjukkan peningkatan reusability sebesar 5,96% dan testability sebesar 7,10%, terutama pada code smell seperti Incomplete Library Class. Teknik Extract Method juga memberikan peningkatan pada Duplicate Code (0,3%), Message Chain (0,51%), dan Shotgun Surgery (0,89%). Namun, teknik seperti Inline Variable, Encapsulate Field, dan Remove Code tidak menunjukkan peningkatan signifikan pada kedua metrik. Uji signifikansi T-Test dan Wilcoxon menunjukkan bahwa teknik refaktorisasi secara signifikan meningkatkan testability pada divergent change, feature envy, inappropriate intimacy, dan message chains, serta reusability pada incomplete library class. Penelitian ini menekankan pentingnya pemilihan teknik refaktorisasi yang tepat dan membuka peluang untuk penelitian lanjutan pada otomatisasi refaktorisasi lintas bahasa pemrograman.
=================================================================================================================================
In software development, code quality plays an important role in system sustainability, maintenance, and efficiency. A common problem in PHP software development is the appearance of code smell that can reduce code quality, increase maintenance costs, and complicate the development process. Although various refactoring techniques are available, there is no measurable guide to choose the right technique according to the type of code smell encountered. This study aims to identify code smell in PHP program code, determine the appropriate refactoring technique to overcome it, and analyze the effect of applying the refactoring technique based on the ISO/IEC 25023 standard. The evaluation is conducted with a focus on the reusability metric (MRe-1G) which measures the ratio of modules designed to support code reuse, and the testability metric (MTe-1G) which evaluates the completeness of test functions in refactored modules. The results showed that code smell was successfully identified in PHP code using tools such as SonarQube, Code Climate, Codacy, and Deep Source, which were then manually revalidated. To overcome the detected code smell, refactoring techniques such as Move Method are effective in overcoming code smells such as Lazy Class, with an increase in reusability by 0.94% and testability by 0.87%. Rename Comment technique increases reusability by 0.30% and testability by 0.17%. Introduce Foreign Method shows an increase in reusability of 5.96% and testability of 7.10%, especially in code smells such as Incomplete Library Class. The Extract Method technique also provides improvements in Duplicate Code (0.3%), Message Chain (0.51%), and Shotgun Surgery (0.89%). However, techniques such as Inline Variable, Encapsulate Field, and Remove Code did not show significant improvement in either metric. T-Test and Wilcoxon significance tests showed that refactoring techniques significantly improved testability on divergent change, feature envy, inappropriate intimacy, and message chains, and reusability on incomplete library classes. This research emphasizes the importance of choosing the right refactoring technique and opens up opportunities for further research on refactoring automation across programming languages
Actions (login required)
View Item |