A Feature Envy Detection Method Based on Data Flow Analysis
Autor: | Bo-Hong Li, 李柏鋐 |
---|---|
Rok vydání: | 2017 |
Druh dokumentu: | 學位論文 ; thesis |
Popis: | 105 Feature Envy is a code small indicating that a method (function) seems to be more interested in a class other than the one it is actually in. Such a method performs computations for another class, takes on responsibilities beyond its own, and violates the fundamental object-abstraction principle that an object should offer computations for its own attributes. When Feature Envy appears, object cohesion may be decreased and object coupling increased, signifying a degradation in code quality. Hence, several Feature Envy detection approaches have been proposed. However, current approaches can only determine whether a method is of Feature Envy. In case that the method is lengthy, it can be difficult for the user to pinpoint the statements (inside the method) that are guilty for Feature Envy. Furthermore, when a method uses too many classes and/or mixes several kinds of behaviors, current approaches could easily be fooled. This thesis proposes a Feature Envy detection method called FEED (FEature Envy Detection) that uses dataflow analysis to analyze the variable definitions and uses in each statement. Such information is then used to determine whether a particular statement overly uses another class. In comparison to previous approaches, our approach offers a better detection granularity: whether a statement is of Feature Envy can be detected. In addition, our approach provides a better detection accuracy. |
Databáze: | Networked Digital Library of Theses & Dissertations |
Externí odkaz: |