Font Size: a A A

Incremental code refactoring using ghost object

Posted on:1999-01-08Degree:M.S.C.SType:Thesis
University:University of Massachusetts LowellCandidate:Sharma, PracheeFull Text:PDF
GTID:2468390014473930Subject:Computer Science
Abstract/Summary:
Refactoring is a technique to improve software maintainability by reorganizing a program's data structures. Our goal is to permit refactoring in smaller testable increments and catch errors earlier and with less effort. Our approach uses ghost objects, a technique inspired by Martin Ward's ghost variables. Ghost Objects comprise a new target data structure that is semantically equivalent to the original structure. Both the original and ghost data structures remain in place while the code is changed in arbitrarily small testable increments. When refactoring for variables only, both the original variables and new ghost variables must be encapsulated behind 'set' and 'get' access functions. Each 'set' function is modified to: (1) Update both original and ghost copies, and (2) Check get/set pre/post condition (that original and ghost copies of the data must agree).;Clients of the object to be changed are gradually modified to reference ghost objects instead of the original ones. When all the steps in a refactoring task are completed, some or all of the original objects may no longer be referenced and may be deleted.
Keywords/Search Tags:Refactoring, Ghost, Original, Data, Objects
Related items