SlideShare a Scribd company logo
Dharma Ganesan
Reverse Architecting using
Relation Algebra
2
What’s On The Agenda
● Software Architecture
● Reverse Architecting
● A little bit math - I promise
● Extract-Abstract-Present to Reverse Architecting
● Demos (during the presentation)
● Some References
3
Software Architecture
● Software architecture deals with the design of the
high-level structure of the software
● Assembly of architectural elements in some well-chosen
forms to satisfy requirements
● (including Reliability, Scalability, Portability, etc)
● Software architecture deals with
● abstraction
● decomposition and composition
● styles (pipe-and-filter, publish-subscribe, etc.)
4
Describing Software Architecture
using Views
● How to best describe Software Architecture
is a topic of on-going R&D
● In literature, views are used to describe
Software Architecture
● Each view address one concern, for example:
● Structural view shows the decomposition of
system
● Behavioral view shows how components
interact at run-time
● Deployment view shows how components
are assigned to hardware elements
5
Reverse Architecting
Informally, extracting architecture information from
source code (including makefiles, docs, test cases,
etc.)
Some challenges:
● Software architecture is an invisible one
● It is difficult to “see” architecture in source code
● Real-world systems have a lot of code
Goal of reverse architecting: Semi-automatically
extract architecture from source code
6
Some questions we ask
● What are the entry-points to the system?
● Which classes inherit from this class?
● Which files deal with network communication?
● Is this function reachable from ‘main’?
● Are there missing code not in repo?
● Which functions are dead?
● etc. etc. etc.
All these questions can be be viewed as relational
algebra questions!
7
Just a bit of math (I promise)
What do we mean by Relation Algebra?
Three things:
Set - an unordered collection
E.g., set of files {f1.c, f2.c, …}
Binary Relation - an unordered set of pairs
E.g., {<main, run>, <run, execute>, …, }
Multi-Relation - Weighted Binary Relation
E.g., {<caller, callee, 5>, …}
8
Relation Algebra Queries
They are made of set-theory operators only
For example, union, intersection, complement, etc.
Compose two relations using join (a.k.a., comp)
part_of= {<a A}, <b B>, <c C>}
call = {<a b>, <b, c>}
E.g: inverse(part_of) comp (call) comp (part_of)?
9
Relation Algebra Toolset
Made of small utilities for each set-theory operator
Combine utilities using pipe-and-filter style
rel_inv part_of | rel_comp call - | rel_comp -
part_of
I personally used RA tools for several reverse
architecting projects
My Phd thesis has more details
10 A Reverse Architecting
Approach (Philips in 1990s)
Extraction: semi-automated extraction of different
relations (import, inherit, call, etc.)
Abstraction: rise the level of abstraction using
relational algebra queries (imagine SQL)
Presentation: visualize using graphs, tables, etc.
(These were published
by Philips)
11
Extraction
● Language-specific parsers to extract different
relations: inherit, call, include, etc.
○ Code need not compile or link
● Each relation is stored in database/files
● Depending on the goal, more custom parsers
have to be developed to extract code relations
● For example, if your goal is to extract inter-task
RPC views, you need to
○ extract tasks, queue names, which function
writes to or read from queues, etc.
12
Abstraction
A suite of relation algebra operators was developed
for abstraction (see demos)
Again, depending on the goal one could apply
different abstraction operators
Some common abstraction (examples):
● Lift class-level dependencies to package-level
● Filter out irrelevant information for your goal
○ For example, show all Java packages that
depend on Crypto packages
● Abstraction of runtime structure to show
inter-task communication (more details later)
13
Some examples: Folder-level
dependency from code relations
14
A medical device case study
Goal: Extract architecture from source code
Visualize inter-task and msg queue communication
Approach:
Extract relations from code
Abstraction using Relation Algebra
Visualize using our graph visualization tools
15
Extracted relations/sets
Our parser extracts names of tasks, queues,
semaphores, etc by pattern matching of library calls
16
Abstraction
We write SQL-like queries using join, inverse, and
other operations on the extracted relations
Output is also relations/sets
17
Presentation
We visualize relations as graphs or tables in general
For inter-task structure, we have something like this
from abstracted relations:
18
Conclusion/Takeaways
● Reverse architecting is a challenging problem
● Extract-Abstract-Present using relational algebra
can help with reverse architecting
● Many of the analysis questions can be
reformulated as relational algebra questions!
● The key is to have a goal for your reverse
architecting effort - to filter out irrelevant data
19 Some Reverse Engineering
Papers (not complete at all)
https://www.win.tue.nl/~wstomv/edu/2ii45/yea
r-0910/Maintaining_a_Legacy.pdf
https://www.cs.cmu.edu/~aldrich/courses/654-s
p05/ReengineeringTaxonomy.pdf
https://ieeexplore.ieee.org/document/5959691
https://ieeexplore.ieee.org/document/5071104
…

More Related Content

PPTX
Reengineering including reverse & forward Engineering
PPTX
Reverse engineering
PDF
Half-automatic Compilable Source Code Recovery
PPTX
Reverse Engineering: The Crash Course
PPT
reverse(1)
PDF
an analysis and new methodology for reverse engineering of uml behavioral
PPTX
Introduction to Software Reverse Engineering
PDF
International Journal of Engineering Research and Development
Reengineering including reverse & forward Engineering
Reverse engineering
Half-automatic Compilable Source Code Recovery
Reverse Engineering: The Crash Course
reverse(1)
an analysis and new methodology for reverse engineering of uml behavioral
Introduction to Software Reverse Engineering
International Journal of Engineering Research and Development

Similar to Reverse Architecting using Relation Algebra.pdf (20)

PPT
Re ppt1
PPTX
reverse.ppt.pptx
PPTX
reverse engineering and applications and approaches
PPTX
reverse_ee.pptx
PPTX
Software Architectures, Week 2 - Decomposition techniques
PDF
Reverse Engineering for Documenting Software Architectures, a Literature Review
PPTX
9-roslyn-guidelines
PPTX
Reverse Engineering - Protecting and Breaking the Software
PDF
Software cracking and patching
PPTX
Reverse engineering
PPTX
Unit v -Construction and Evaluation
PDF
Reverse Engineering
PDF
Substrait Overview.pdf
PPTX
Reverse Engineering: Protecting and Breaking the Software
PDF
Extracting architectural model of software from source code
PPTX
Reconstructing Software Architecture
PDF
WhitePaperTemplate
PDF
A Comparative Study of Forward and Reverse Engineering
PDF
PPTX
Relation model part 1
Re ppt1
reverse.ppt.pptx
reverse engineering and applications and approaches
reverse_ee.pptx
Software Architectures, Week 2 - Decomposition techniques
Reverse Engineering for Documenting Software Architectures, a Literature Review
9-roslyn-guidelines
Reverse Engineering - Protecting and Breaking the Software
Software cracking and patching
Reverse engineering
Unit v -Construction and Evaluation
Reverse Engineering
Substrait Overview.pdf
Reverse Engineering: Protecting and Breaking the Software
Extracting architectural model of software from source code
Reconstructing Software Architecture
WhitePaperTemplate
A Comparative Study of Forward and Reverse Engineering
Relation model part 1
Ad

More from Dharmalingam Ganesan (20)

PDF
.NET Deserialization Attacks
PDF
How to exploit rand()?
PDF
Cyclic Attacks on the RSA Trapdoor Function
PDF
An Analysis of RSA Public Exponent e
PDF
An Analysis of Secure Remote Password (SRP)
PDF
Thank-a-Gram
PDF
Active Attacks on DH Key Exchange
PDF
Can I write to a read only file ?
PPTX
How do computers exchange secrets using Math?
PDF
On the Secrecy of RSA Private Keys
PDF
Computing the Square Roots of Unity to break RSA using Quantum Algorithms
PDF
Analysis of Short RSA Secret Exponent d
PDF
Dependency Analysis of RSA Private Variables
PDF
Analysis of Shared RSA Modulus
PDF
RSA Game using an Oracle
PDF
RSA Two Person Game
PDF
RSA without Integrity Checks
PPTX
RSA without Padding
PDF
Solutions to online rsa factoring challenges
PDF
Security of RSA and Integer Factorization
.NET Deserialization Attacks
How to exploit rand()?
Cyclic Attacks on the RSA Trapdoor Function
An Analysis of RSA Public Exponent e
An Analysis of Secure Remote Password (SRP)
Thank-a-Gram
Active Attacks on DH Key Exchange
Can I write to a read only file ?
How do computers exchange secrets using Math?
On the Secrecy of RSA Private Keys
Computing the Square Roots of Unity to break RSA using Quantum Algorithms
Analysis of Short RSA Secret Exponent d
Dependency Analysis of RSA Private Variables
Analysis of Shared RSA Modulus
RSA Game using an Oracle
RSA Two Person Game
RSA without Integrity Checks
RSA without Padding
Solutions to online rsa factoring challenges
Security of RSA and Integer Factorization
Ad

Recently uploaded (20)

PPTX
Introduction to Artificial Intelligence
PDF
Understanding Forklifts - TECH EHS Solution
PDF
Odoo Companies in India – Driving Business Transformation.pdf
PDF
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
PPTX
Essential Infomation Tech presentation.pptx
PDF
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
PDF
2025 Textile ERP Trends: SAP, Odoo & Oracle
PPTX
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
PDF
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
PPTX
Odoo POS Development Services by CandidRoot Solutions
PDF
How to Choose the Right IT Partner for Your Business in Malaysia
PDF
Softaken Excel to vCard Converter Software.pdf
PDF
Digital Strategies for Manufacturing Companies
PDF
wealthsignaloriginal-com-DS-text-... (1).pdf
PDF
How to Migrate SBCGlobal Email to Yahoo Easily
PDF
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
PPTX
CHAPTER 2 - PM Management and IT Context
PDF
System and Network Administration Chapter 2
PPTX
L1 - Introduction to python Backend.pptx
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
Introduction to Artificial Intelligence
Understanding Forklifts - TECH EHS Solution
Odoo Companies in India – Driving Business Transformation.pdf
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
Essential Infomation Tech presentation.pptx
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
2025 Textile ERP Trends: SAP, Odoo & Oracle
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
Odoo POS Development Services by CandidRoot Solutions
How to Choose the Right IT Partner for Your Business in Malaysia
Softaken Excel to vCard Converter Software.pdf
Digital Strategies for Manufacturing Companies
wealthsignaloriginal-com-DS-text-... (1).pdf
How to Migrate SBCGlobal Email to Yahoo Easily
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
CHAPTER 2 - PM Management and IT Context
System and Network Administration Chapter 2
L1 - Introduction to python Backend.pptx
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025

Reverse Architecting using Relation Algebra.pdf

  • 1. Dharma Ganesan Reverse Architecting using Relation Algebra
  • 2. 2 What’s On The Agenda ● Software Architecture ● Reverse Architecting ● A little bit math - I promise ● Extract-Abstract-Present to Reverse Architecting ● Demos (during the presentation) ● Some References
  • 3. 3 Software Architecture ● Software architecture deals with the design of the high-level structure of the software ● Assembly of architectural elements in some well-chosen forms to satisfy requirements ● (including Reliability, Scalability, Portability, etc) ● Software architecture deals with ● abstraction ● decomposition and composition ● styles (pipe-and-filter, publish-subscribe, etc.)
  • 4. 4 Describing Software Architecture using Views ● How to best describe Software Architecture is a topic of on-going R&D ● In literature, views are used to describe Software Architecture ● Each view address one concern, for example: ● Structural view shows the decomposition of system ● Behavioral view shows how components interact at run-time ● Deployment view shows how components are assigned to hardware elements
  • 5. 5 Reverse Architecting Informally, extracting architecture information from source code (including makefiles, docs, test cases, etc.) Some challenges: ● Software architecture is an invisible one ● It is difficult to “see” architecture in source code ● Real-world systems have a lot of code Goal of reverse architecting: Semi-automatically extract architecture from source code
  • 6. 6 Some questions we ask ● What are the entry-points to the system? ● Which classes inherit from this class? ● Which files deal with network communication? ● Is this function reachable from ‘main’? ● Are there missing code not in repo? ● Which functions are dead? ● etc. etc. etc. All these questions can be be viewed as relational algebra questions!
  • 7. 7 Just a bit of math (I promise) What do we mean by Relation Algebra? Three things: Set - an unordered collection E.g., set of files {f1.c, f2.c, …} Binary Relation - an unordered set of pairs E.g., {<main, run>, <run, execute>, …, } Multi-Relation - Weighted Binary Relation E.g., {<caller, callee, 5>, …}
  • 8. 8 Relation Algebra Queries They are made of set-theory operators only For example, union, intersection, complement, etc. Compose two relations using join (a.k.a., comp) part_of= {<a A}, <b B>, <c C>} call = {<a b>, <b, c>} E.g: inverse(part_of) comp (call) comp (part_of)?
  • 9. 9 Relation Algebra Toolset Made of small utilities for each set-theory operator Combine utilities using pipe-and-filter style rel_inv part_of | rel_comp call - | rel_comp - part_of I personally used RA tools for several reverse architecting projects My Phd thesis has more details
  • 10. 10 A Reverse Architecting Approach (Philips in 1990s) Extraction: semi-automated extraction of different relations (import, inherit, call, etc.) Abstraction: rise the level of abstraction using relational algebra queries (imagine SQL) Presentation: visualize using graphs, tables, etc. (These were published by Philips)
  • 11. 11 Extraction ● Language-specific parsers to extract different relations: inherit, call, include, etc. ○ Code need not compile or link ● Each relation is stored in database/files ● Depending on the goal, more custom parsers have to be developed to extract code relations ● For example, if your goal is to extract inter-task RPC views, you need to ○ extract tasks, queue names, which function writes to or read from queues, etc.
  • 12. 12 Abstraction A suite of relation algebra operators was developed for abstraction (see demos) Again, depending on the goal one could apply different abstraction operators Some common abstraction (examples): ● Lift class-level dependencies to package-level ● Filter out irrelevant information for your goal ○ For example, show all Java packages that depend on Crypto packages ● Abstraction of runtime structure to show inter-task communication (more details later)
  • 14. 14 A medical device case study Goal: Extract architecture from source code Visualize inter-task and msg queue communication Approach: Extract relations from code Abstraction using Relation Algebra Visualize using our graph visualization tools
  • 15. 15 Extracted relations/sets Our parser extracts names of tasks, queues, semaphores, etc by pattern matching of library calls
  • 16. 16 Abstraction We write SQL-like queries using join, inverse, and other operations on the extracted relations Output is also relations/sets
  • 17. 17 Presentation We visualize relations as graphs or tables in general For inter-task structure, we have something like this from abstracted relations:
  • 18. 18 Conclusion/Takeaways ● Reverse architecting is a challenging problem ● Extract-Abstract-Present using relational algebra can help with reverse architecting ● Many of the analysis questions can be reformulated as relational algebra questions! ● The key is to have a goal for your reverse architecting effort - to filter out irrelevant data
  • 19. 19 Some Reverse Engineering Papers (not complete at all) https://www.win.tue.nl/~wstomv/edu/2ii45/yea r-0910/Maintaining_a_Legacy.pdf https://www.cs.cmu.edu/~aldrich/courses/654-s p05/ReengineeringTaxonomy.pdf https://ieeexplore.ieee.org/document/5959691 https://ieeexplore.ieee.org/document/5071104 …