Title: Reverse Engineering Goal Models from Legacy Code
1Reverse Engineering Goal Models from Legacy Code
- Yijun Yu1
- Yiqiao Wang1
- John Mylopoulos1
- Sotirios Liaskos1
- Alexei Lapouchnian1
- Julio Cesar Sampaio do Prado Leite2
- http//www.cs.toronto.edu/yijun/
21. Motivation
- In legacy software, the purpose (goals,
requirements) of a software system is almost
always lost in legacy code - In the new era, open and dynamic systems require
high-variability software - So, we need to recover the purpose of the legacy
software in order to adapt it for the new context
3Put into reengineering perspective
Horseshoe Model
abstract
Reverse engineering
Forward engineering
Requirements
IntentionsTradeoffs
GOAL MODEL
GOAL MODEL
customizablearchitecture
SOA
Architectures
BEHAVIOUR MODEL
Web services
Functions
components
LEGACY CODE
Code
time
4Hard goal model
5Soft goal model
6Put into reengineering perspective
Horseshoe Model
Reverse engineering
Forward engineering
Requirements
IntentionsTradeoffs
GOAL MODEL
GOAL MODEL
customizablearchitecture
SOA
Architectures
BEHAVIOUR MODEL
Web services
Functions
components
LEGACY CODE
Code
72. A tool supported reverse engineering
2.1
FPT compiler
FPT compiler
2.2
2.3
2.4
2.4
82.1 Software Refactoring
- Software refactoring Restructuring existing
code by altering its internal structure without
changing its external behaviour - Martin
Fowler, also Comments signal the semantic gap
between the code and the programmers purpose
entry
// the following does S S1(I1, O1) S2(I2,
O2) // other
// refactored S(I, O)
exit
I Variables defined before the entry of the
block O Variables defined in the block that will
be used after the exit
92.2 Statecharts refactoring
- Statecharts are used to bridge the semantics
abstraction gap between source code and goal
models - refactored source code
- equivalent statechart
- higher-level statechart
- unstructured high-level program
- structured high-level program
102.3 Goal model from structured programs
112.4 Identifying NFR and softgoals
- Create a set of functional tests
- If removing a method does not break the
functional test, then the goal associated with
the method is a NFR - If the identified NFR improves some quality
attribute, then - There is a soft goal for the quality attribute
- There is a contribution from the NFR to the
softgoal
123. Case studies
- Case study selection criteria
- Email software systems as they are the target for
personal RE - Software popularity with a large user base, must
support wide-range of requirements - Open-source the validity of the findings can be
verified - Applicable with our tool support
133.1 The Columba case study
- 1 ColumbaLogger.createDefaultHandler()
- 2 registerCommandLineArguments()
- 3 // handle commandline parameters
- 4 if (handleCoreCommandLineParameters(args))
- 5 System.exit(0)
- ...
-
- Why Columba?
- it is an email system
- popular
- 140 KLoc
- Open-source
- Java
- Ver. 1.0RC2
- Whats New!
- Ver. 1.0RC3 has put one of our resulting NFR
into comments
1 ColumbaLogger.createDefaultHandler() 2
registerCommandLineArguments() 3
handle_commandline_parameters(args) ...
- 1 // ColumbaLogger.createDefaultHandler()
- 2 registerCommandLineArguments()
- 3 handle_commandline_parameters(args)
- ...
- boolean maintainability_logging false
- ...
- 1 if (maintainability_logging)
- 2 ColumbaLogger.createDefaultHandler()
- 3 registerCommandLineArguments()
- ...
14(No Transcript)
15A running Columba
16The core functional Columba
17JUnit testing for Preserved Functionality
183.2 The Squirrel Mail case study
- Why Squirrel Mail?
- it is also an email system
- popular
- PHP HTML
- 70 KLoc
- Open-source
- unstructured
- Check this
- Its reliable, secure, easy to use
- but not that fast
19Restructure AST Goal Graph into Stakeholder Goals
204. Conclusion
- A reverse engineering process is proposed to
recover a goal model from legacy code. - This is a critical step in reengineering legacy
code to improve its quality through variability. - Reverse Engineering research has focused almost
exclusively on recovering design information
(rather than purposes) - Future work
- Need to further evaluate the effectiveness of
heuristics used - Need more experiments
21Welcome to the 1st RETR workshop
- Reverse engineering to Requirements
- Collocated with WCRE05, November Pittsburg, USA
- http//www.cs.toronto.edu/km/retr