Reverse Engineering
Definition
Reverse Engineering is the process of analyzing an existing software system to identify its components, their relationships, and to create representations of the system at a higher level of abstraction (e.g., recovering design or requirements from source code) — essentially "working backward" from implementation to understanding.
Why Reverse Engineering Is Needed
- Original design documentation is missing, lost, or outdated
- Original developers are no longer available (staff turnover)
- Need to understand a legacy system before modifying, migrating, or replacing it
- Need to assess quality, security, or compliance of third-party/inherited code
Levels of Reverse Engineering (Abstraction Recovery)
Requirements ◀── (highest abstraction, hardest to recover)
▲
Design
▲
Implementation (source code) ◀── (starting point of reverse engineering)
Reverse engineering moves upward — from code toward design and (ideally) requirements — the opposite direction of forward engineering (design → code).
Reverse Engineering Activities
- Code Analysis — understand the existing source code structure
- Design Recovery — reconstruct design diagrams (structure charts, class diagrams) from the code
- Documentation Generation — produce missing documentation
- Data Reverse Engineering — recover database schema/data models from existing databases
Reverse Engineering vs. Forward Engineering
| Forward Engineering | Reverse Engineering |
|---|---|
| Requirements → Design → Code | Code → Design → (Requirements) |
| Building something new | Understanding something existing |
| Standard SDLC direction | Opposite direction |
Tools Used
- Code analysis tools, UML reverse-engineering tools (that generate class diagrams from code), database schema analyzers
Relationship to Reengineering
Reverse Engineering is often the first step of Software Reengineering (next topic) — you must understand the existing system (reverse engineer it) before you can systematically restructure/rebuild it (reengineer it).
Exam tip: Draw the "upward arrow" diagram (Code → Design → Requirements) to show reverse engineering moves opposite to normal forward SDLC direction — a frequently asked conceptual diagram question.