Chulalongkorn University Theses and Dissertations (Chula ETD)

การตรวจจับร่องรอยที่ไม่ดีสำหรับรีแฟคทอริง โดยใช้มาตรวัดซอฟต์แวร์เชิงวัตถุ

Other Title (Parallel Title in Other Language of ETD)

Bad-smell detection for refactoring using object-oriented software metrics

Year (A.D.)

2004

Document Type

Thesis

First Advisor

พรศิริ หมื่นไชยศรี

Faculty/College

Faculty of Engineering (คณะวิศวกรรมศาสตร์)

Degree Name

วิทยาศาสตรมหาบัณฑิต

Degree Level

ปริญญาโท

Degree Discipline

วิทยาศาสตร์คอมพิวเตอร์

DOI

10.58837/CHULA.THE.2004.1233

Abstract

นำเสนอวิธีการตรวจจับร่องรอยที่ไม่ดีสำหรับซอร์สโค้ด 6 ประเภท คือ Feature Envy, Large Classs, Lazy Class, Long Method, Long Parameter Lists และ Switch Statement โดยใช้มาตรวัดซอฟต์แวร์เชิงวัตถุ ซึ่งมาตรวัดที่นำเสนอเหล่านี้ใช้เพื่อช่วยตรวจสอบว่า ส่วนใดของโค้ดเป็นร่องรอยที่ไม่ดี และวิธีการนี้ได้เสนอแนะวิธีการรีแฟคทอริง เพื่อแก้ไขร่องรอยที่ไม่ดีที่พบในซอร์สโค้ด จากนั้นประเมินความสามารถของมาตรวัดร่องรอยที่ไม่ดี โดยเปรียบเทียบค่ามาตรวัดร่องรอยที่ไม่ดี ก่อนและหลังการประยุกต์ใช้วิธีรีแฟคทอริง ผู้วิจัยได้พัฒนาเครื่องมือสำหรับตรวจจับร่องรอยที่ไม่ดีของซอร์สโค้ดภาษาจาวา โดยคำนวณค่ามาตรวัดร่องรอยที่เกี่ยวข้องกับร่องรอยที่ไม่ดีทั้ง 6 ประเภท ผลการทดสอบพบว่า ค่ามาตรวัดร่องรอยที่ไม่ดีนั้นดีขึ้น หลังจากประยุกต์ใช้วิธีแฟคทอริงแล้ว แสดงให้เห็นว่า มาตรวัดร่องรอยที่ไม่ดีที่เสนอในงานวิจัยนี้ ช่วยในการตรวจจับร่องรอยที่ไม่ดีได้

Other Abstract (Other language abstract of ETD)

To propose an approach for detecting and locating six bad-smells (such as feature envy, large class, lazy class, long method, long parameter lists, and switch statement) from source code using object-oriented software metrics. The metrics are proposed to be used as indicators for determining whether a particular fraction of code contains the bad-smell or not. The approach also provides suggestion to modify the code by particular refactoring techniques, and then it is evaluated by comparing bad-smell metrics before and after applying the refactoring techniques. This research work also constructs an automated tool for detecting the bad-smell from java source code by measuring bad-smell metrics that are related to the six bad-smell. The result shows that these bad-smell metrics are enhanced after we apply the refactoring. All proposed bad-smell metrics can be used as indicators for detecting and locating bad-smells.

Share

COinS