1.2 The Problem – Too Low Level Refactoring Applied to Legacy Code
The problem is that the programmer which is equipped with those excellent methods
and techniques still needs more guidance on how to apply them to the actual mission
at hand. In particular, Code refactoring [7] methods are being collected and described
as patterns for improving code in incremental ways. Most of these patterns are rather
at a quite low level of coding and in fact today are being automated by IDEs.
1.3 Related Work
Agility, among others terms and practices relevant to our work, includes unit testing
[8], and test-driven-development [1].
There is a wide literature concerning generic higher abstraction level ideas that can
enhance the process of working with legacy code. We mention Ontologies [2],
Knowledge Management [3], Software Knowledge [5], Domain Driven Design [4],
and more broadly, Patterns and Principles, e.g. [9, 12] and their use in object oriented
programming and software engineering. It is out of scope for this paper to describe in
detail the various ideas, and the interested reader is invited to check the above
references and other resources.
In [14] it is shown how ontology can guide the development of a new system, in
contrast to the current work in which the emphasis is on existing software. Yang et al.
[15] proposes extracting ontologies from legacy code, to improve the understanding
and eventually the re-engineering of the respective code. Their emphasis is on the
ontology extraction, while ours is on the ontology utilization in the refactoring
process.
Specific ontologies relevant to the use case in this work include, e.g. ITSMO [11] a
service management ontology, referring to software utilities, and OWL-S: Semantic
Markup for Web Services [13].
The remaining of this paper is organized as follows: In Section 2 we detail the
original proposed process and how we elaborate on it, in Section 3, we bring one use
case for demonstrating this improved method and then in section 4 we conclude with
some remarks and future work.
2 The Solution – Refactoring with Domain Knowledge
2.1 Standard Refactoring Process
The main process suggested by Feathers for adding new features is as follows:
1. Identify Change Points: that is, finding the actual place(s) in the code where
the change is going to be applied. This can be achieved in many ways, e.g.,
identifying the related and relevant areas in the code, consulting (original)
developers, reading documentation and error reports, etc.
2. Find Test Point: sometimes and especially with legacy code, it is not so easy
to determine what, where and how to test the code. Legacy code, as described,
64