|
|
Using Code Metrics for Targeted Code Refactoring by Andrew Glover Often times, candidate code for refactoring
is based upon a source file's smell, which its spotting can take time to acquire and is
largely based upon subjective determinations. The proper use of code metrics, such as
Cyclomatic Complexity, Fan-In, Fan-Out, and Depth of Inheritance can also facilitate
the discovery of candidate code which is in need of refactoring.
For example, Cyclomatic Complexity is adept at spotting methods containing a high degree
of conditional logic, which, conseqently, can be replaced with polymorphism as elaborated
in Martin Fowler's seminal work, Refactoring with the Replace Conditional with Polymorphism
pattern. Additionally, excessively deep hierarchy trees create problematic testing targets, which
can be broken out into separate objects with Fowler's Replace Inheritance with Delegation and
Collapse Hierarchy patterns. Fan-In and Fan-Out are quite effective at pinpointing brittle code,
which can be refactored into a more stable state with a plethora of patterns including
Extract Hierarchy and Extract Class. The knowledge of how to effectively spot smelly code and
replace it with proven patterns will ultimately lead to a more stable, maintainable and elegant code base.
Bio: Andrew Glover is the founder and CEO of Vanward Technologies, a Washington, DC, metro
area company specializing in the construction of automated testing frameworks, which lower
software bug counts, reduce integration and testing times, and improve overall code stability. Mr.Glover's
career includes leadership in software development for such notable companies as IBM, Philips
Electronics, and Proctor & Gamble and is the co-author
of "Java Testing Patterns".
Agenda: Thursday, May 26, 2005
6:30pm - 7:00pm: Networking
7:00pm - 8:00pm: Presentation, Questions/Discussion
8:00pm - ?: Networking
Host: DeVry University - Orlando campus
Room: TBA
4000 Millenia Boulevard
Orlando, FL 32839
407 355 3131
-Michael Levin
OrlandoJUG
|
| Other Local Websites:
|
-
TechBizFL.com is a site dedicated
to promoting a sense of community along the high-tech I-4
corridor, spanning from Tampa/St. Pete through Orlando to
the Spacecoast.
|
|