SlideShare une entreprise Scribd logo
1  sur  39
Télécharger pour lire hors ligne
Extracting Architectural Model
from Source Code
By:
Morteza Zakeri – Mohsen Amirian
Advanced Software Engineering Course
Iran University of Science and Technology
Winter 2017
Outline
• What is Software Reverse Engineering (SRE)?
• Two Different Dimensions
• Motivation
• SRE Tools
• Modularity Principles
• Extracting Architectural Model Step by Step
• Practical Case Study
• References
21 February 2017
Extracting Architecture from Source Code -
M.Zakeri, M.Amirian
Page 2 of 38
What is Software Reverse Engineering?
• Software Reverse Engineering (SRE) is the practice
of analyzing a software system, either in whole or in
part, to extract design and implementation
information [1].
• [1] Cipresso, T. (2009). Software Reverse Engineering
Education, (August), 120.
21 February 2017
Extracting Architecture from Source Code -
M.Zakeri, M.Amirian
Page 3 of 38
Two Different Dimensions
• Binary Code Reverse Engineering
• To obtain source code from executable object.
• Source Code Reverse Engineering
• To extract architectural features.
21 February 2017
Extracting Architecture from Source Code -
M.Zakeri, M.Amirian
Page 4 of 38
Motivation
1. Old software systems are often not documented
or very less documentation is available.
• Even in the systems where documentation is available
there is no explicit mention of the architecture that the
code possesses.
21 February 2017
Extracting Architecture from Source Code -
M.Zakeri, M.Amirian
Page 5 of 38
Motivation
2. New changes to the system need a knowledge
of implicit architecture that the system possess.
21 February 2017
Extracting Architecture from Source Code -
M.Zakeri, M.Amirian
Page 6 of 38
Motivation
3. Legacy Transformation
• It is a tough task to convert a 10,000 line COBOL code
to C/C++ code if the programmer is unaware of the
underlying architecture.
• As around 70% of world’s source code is in COBOL and
in scientific communities FORTRAN has been the
obvious choice [2].
• [2] Ali, M. R. (2005). Why teach reverse engineering? SIGSOFT
Softw. Eng. Notes, 30(4), 1–4.
https://doi.org/10.1145/1082983.1083004
21 February 2017
Extracting Architecture from Source Code -
M.Zakeri, M.Amirian
Page 7 of 38
Motivation
4. System evolution
• As system evolves , it tends to drift from it’s original
architecture.
• So it is very important to recover or reconstruct the
architecture of the system in the spirit that new
changes to the system do not affect the existing
working model.
21 February 2017
Extracting Architecture from Source Code -
M.Zakeri, M.Amirian
Page 8 of 38
Motivation
5. Software Testing and Security
• Techniques are used to debug and find bugs and
errors.
• Techniques are used to make sure that the system does
not have any major vulnerabilities and security flaws.
21 February 2017
Extracting Architecture from Source Code -
M.Zakeri, M.Amirian
Page 9 of 38
Binary Code Reverse Engineering Tools
• Disassemblers
• Debuggers
• Hex Editors
• PE and Resource Viewer
• Example:
• IAD Pro, OllyDBG, WinDBG, etc.
21 February 2017
Extracting Architecture from Source Code -
M.Zakeri, M.Amirian
Page 10 of 38
Source Code Reverse Engineering Tools
• Calculate some software metrics.
• Lines of code (LoC)
• Number of Class, Functions, Statements, etc.
• Visualize source code architecture to optimize software
design.
• Sometimes we need higher level of abstraction.
• e.g. Component Diagram.
21 February 2017
Extracting Architecture from Source Code -
M.Zakeri, M.Amirian
Page 11 of 38
Modularity Principles
• Cohesion
• Refers to the degree to which the elements of a
module belong together.
• Coupling
• The degree of interdependence between software
modules.
• Good Design: High cohesion (↑), loose coupling (↓).
21 February 2017
Extracting Architecture from Source Code -
M.Zakeri, M.Amirian
Page 12 of 38
Reversing Steps
21 February 2017
Extracting Architecture from Source Code -
M.Zakeri, M.Amirian
Page 13 of 38
Understand
21 February 2017
Extracting Architecture from Source Code -
M.Zakeri, M.Amirian
Page 14 of 38
Bunch
21 February 2017
Extracting Architecture from Source Code -
M.Zakeri, M.Amirian
• Bunch is a graph clustering tools.
• As part of Ph.D. thesis in Computer Science at
Drexel University.
• By: Brian Mitchell
• Using heuristic searching such as
• Genetic Algorithm,
• Hill Climbing,
• …
Page 15 of 38
‫ساده‬ ‫مثال‬ ‫یک‬ ‫بررسی‬
21 February 2017
Extracting Architecture from Source Code -
M.Zakeri, M.Amirian
•‫برنامه‬‫بر‬ ‫مشتمل‬ ‫ای‬5‫کالس‬a, b, c, e, f‫بگیرید‬ ‫نظر‬ ‫در‬ ‫را‬.
•‫با‬‫بررسی‬ ‫یک‬‫دستی‬‫کال‬ ‫هر‬ ‫متدهای‬ ‫های‬ ‫دستیابی‬ ‫تعداد‬ ‫از‬ ‫اطالعاتی‬ ‫ما‬‫بهه‬ ‫س‬
‫آوریم‬ ‫می‬ ‫دست‬ ‫به‬ ‫دیگر‬ ‫کالس‬ ‫متدهای‬.‫ک‬ ‫در‬ ‫که‬ ‫کنیم‬ ‫می‬ ‫مشاهده‬ ‫مثال‬ ‫برای‬‫الس‬
a‫کالس‬ ‫متدهای‬ ‫بار‬ ‫دو‬b‫است‬ ‫شده‬ ‫فراخوانی‬.
•‫این‬ ‫ما‬‫دهیم‬ ‫می‬ ‫نشان‬ ‫زیر‬ ‫صورت‬ ‫به‬ ‫را‬ ‫اطالع‬:
• a b 2
Page 16 of 38
‫اول‬ ‫گام‬:‫کالس‬ ‫وابستگی‬ ‫گراف‬ ‫قالب‬ ‫در‬ ‫ارتباطی‬ ‫مدل‬ ‫استخراج‬‫ی‬
21 February 2017
Extracting Architecture from Source Code -
M.Zakeri, M.Amirian
Page 17 of 38
‫اول‬ ‫گام‬:‫کالس‬ ‫وابستگی‬ ‫گراف‬ ‫قالب‬ ‫در‬ ‫ارتباطی‬ ‫مدل‬ ‫استخراج‬‫ی‬
21 February 2017
Extracting Architecture from Source Code -
M.Zakeri, M.Amirian
Page 18 of 38
‫دوم‬ ‫گام‬:‫خروجی‬ ‫تبدیل‬Understand‫ورودی‬ ‫به‬Bunch
21 February 2017
Extracting Architecture from Source Code -
M.Zakeri, M.Amirian
•‫ورودی‬ ،‫است‬ ‫دار‬ ‫جهت‬ ‫دار‬ ‫وزن‬ ‫گراف‬ ‫که‬ ‫قبل‬ ‫گام‬ ‫خروجی‬ ‫واقع‬ ‫در‬Bunch‫قرار‬
‫گیرد‬ ‫می‬.
Page 19 of 38
‫دوم‬ ‫گام‬:‫خروجی‬ ‫تبدیل‬Understand‫ورودی‬ ‫به‬Bunch
21 February 2017
Extracting Architecture from Source Code -
M.Zakeri, M.Amirian
Page 20 of 38
‫گام‬‫سوم‬:‫بندی‬ ‫خوشه‬
21 February 2017
Extracting Architecture from Source Code -
M.Zakeri, M.Amirian
Page 21 of 38
Measuring Modularization Quality (MQ)
• Basic MQ
• Inter-connectivity
• (i.e., connections between the components of two
distinct clusters)
• Intra-connectivity
• (i.e., connections between the components of the
same cluster) [3].
21 February 2017
Extracting Architecture from Source Code -
M.Zakeri, M.Amirian
Page 22 of 38
Measuring Modularization Quality (MQ)
• Intra-connectivity measurement 𝐴𝑖 of cluster i
consisting of 𝑁𝑖 components and 𝜇𝑖 intra-edge
relations as:
• 𝐴𝑖 =
𝜇 𝑖
𝑁𝑖
2
21 February 2017
Extracting Architecture from Source Code -
M.Zakeri, M.Amirian
Page 23 of 38
Measuring Modularization Quality (MQ)
• Inter-connectivity 𝐸𝑖,𝑗 between clusters i and j
consisting of 𝑁𝑖 and 𝑁𝑗 components, respectively,
and with 𝜀𝑖 inter-edge dependencies as:
21 February 2017
Extracting Architecture from Source Code -
M.Zakeri, M.Amirian
Page 24 of 38
Measuring Modularization Quality (MQ)
21 February 2017
Extracting Architecture from Source Code -
M.Zakeri, M.Amirian
Page 25 of 38
Measuring Modularization Quality (MQ)
21 February 2017
Extracting Architecture from Source Code -
M.Zakeri, M.Amirian
Page 26 of 38
The BasicMQ Measurement
• The BasicMQ measurement demonstrates the
tradeoff between inter-connectivity and intra-
connectivity by rewarding the creation of highly-
cohesive clusters, while penalizing the creation of
too many inter-edges (k is number of subsystems):
21 February 2017
Extracting Architecture from Source Code -
M.Zakeri, M.Amirian
Page 27 of 38
The BasicMQ Measurement
21 February 2017
Extracting Architecture from Source Code -
M.Zakeri, M.Amirian
Page 28 of 38
‫گام‬‫سوم‬:‫بندی‬ ‫خوشه‬
21 February 2017
Extracting Architecture from Source Code -
M.Zakeri, M.Amirian
Page 29 of 38
‫گام‬‫سوم‬:‫خوشه‬‫بندی‬(‫در‬ ‫نمایش‬Graphviz)
21 February 2017
Extracting Architecture from Source Code -
M.Zakeri, M.Amirian
Page 30 of 38
‫گام‬‫چهارم‬:‫معماری‬ ‫طرح‬ ‫استخراج‬
21 February 2017
Extracting Architecture from Source Code -
M.Zakeri, M.Amirian
• IBM Rational Rose
• rationalrose.tlb
• ProgramFilesRationalRoserationalrose.tlb
•
Page 31 of 38
‫چهارم‬ ‫گام‬:‫طرح‬ ‫استخراج‬‫معماری‬(‫ابزار‬Package View)
21 February 2017
Extracting Architecture from Source Code -
M.Zakeri, M.Amirian
Page 32 of 38
‫چهارم‬ ‫گام‬:‫عملیاتی‬ ‫محیط‬ ‫در‬ ‫نمایش‬Rational Rose
21 February 2017
Extracting Architecture from Source Code -
M.Zakeri, M.Amirian
Page 33 of 38
‫چهارم‬ ‫گام‬:‫عملیاتی‬ ‫محیط‬ ‫در‬ ‫نمایش‬Rational Rose
21 February 2017
Extracting Architecture from Source Code -
M.Zakeri, M.Amirian
Page 34 of 38
‫آتی‬ ‫کارهای‬
•‫یافته‬ ‫ساخت‬ ‫های‬ ‫برنامه‬ ‫معماری‬ ‫استخراج‬ ‫برای‬ ‫برنامه‬ ‫تعمیم‬
•‫گرا‬ ‫شی‬ ‫به‬ ‫یافته‬ ‫ساخت‬ ‫های‬ ‫برنامه‬ ‫خودکار‬ ‫تبدیل‬
•‫منبع‬ ‫کد‬ ‫از‬ ‫طراحی‬ ‫نمودارهای‬ ‫سایر‬ ‫استخراج‬ ‫نحوه‬ ‫بررسی‬
•‫مشابه‬ ‫های‬ ‫محیط‬ ‫دیگر‬ ‫در‬ ‫نمایش‬‫نظیر‬Visual Paradigm،Oracle
Designer‫و‬. ...
21 February 2017
Extracting Architecture from Source Code -
M.Zakeri, M.Amirian
Page 35 of 38
References
• [1] Cipresso, T. (2009). Software Reverse Engineering Education,
(August), 120.
• [2] Ali, M. R. (2005). Why teach reverse engineering? SIGSOFT Softw.
Eng. Notes, 30(4), 1–4. https://doi.org/10.1145/1082983.1083004
• [3] Mitchell, B. S. (2002). A Heuristic Search Approach to Solving the
Software Clustering Problem, (March).
21 February 2017
Extracting Architecture from Source Code -
M.Zakeri, M.Amirian
Page 36 of 38
Tools
• Understand
• https://scitools.com/
• Bunch
• https://www.cs.drexel.edu/~spiros/bunch/
• Graphviz
• http://www.graphviz.org
• IBM Rational Rose Enterprise
• http://www-03.ibm.com/software/products/en/enterprise
21 February 2017
Extracting Architecture from Source Code -
M.Zakeri, M.Amirian
Page 37 of 38
IUST Tools
• Understand 2 Bunch
• Bunch 2 Rational (Package Viewer)
21 February 2017
Extracting Architecture from Source Code -
M.Zakeri, M.Amirian
Page 38 of 38
Extracting architectural model of software from source code

Contenu connexe

Similaire à Extracting architectural model of software from source code

Taming Complexity: On Studying the Application of Model-Driven Engineering to...
Taming Complexity: On Studying the Application of Model-Driven Engineering to...Taming Complexity: On Studying the Application of Model-Driven Engineering to...
Taming Complexity: On Studying the Application of Model-Driven Engineering to...
Florian Rademacher
 
421215833-UNIT-1-OOAD-ppt.ppt
421215833-UNIT-1-OOAD-ppt.ppt421215833-UNIT-1-OOAD-ppt.ppt
421215833-UNIT-1-OOAD-ppt.ppt
rituah
 
421215833-UNIT-1-OOAD-ppt.ppt
421215833-UNIT-1-OOAD-ppt.ppt421215833-UNIT-1-OOAD-ppt.ppt
421215833-UNIT-1-OOAD-ppt.ppt
rituah
 
Introduction to Systems Engineering
Introduction to Systems EngineeringIntroduction to Systems Engineering
Introduction to Systems Engineering
Ali Saaboonchi
 
Adopting code reviews for agile software development
Adopting code reviews for agile software developmentAdopting code reviews for agile software development
Adopting code reviews for agile software development
mariobernhart
 
Paper_19-Software_Architecture_Reconstruction_Method_a_Survey
Paper_19-Software_Architecture_Reconstruction_Method_a_SurveyPaper_19-Software_Architecture_Reconstruction_Method_a_Survey
Paper_19-Software_Architecture_Reconstruction_Method_a_Survey
Zainab Nayyar
 
Model driven development and code generation of software systems
Model driven development and code generation of software systemsModel driven development and code generation of software systems
Model driven development and code generation of software systems
Marco Brambilla
 

Similaire à Extracting architectural model of software from source code (20)

Software Engineering Thesis Topics In Cambridge AI-Driven Software Productivi...
Software Engineering Thesis Topics In Cambridge AI-Driven Software Productivi...Software Engineering Thesis Topics In Cambridge AI-Driven Software Productivi...
Software Engineering Thesis Topics In Cambridge AI-Driven Software Productivi...
 
Taming Complexity: On Studying the Application of Model-Driven Engineering to...
Taming Complexity: On Studying the Application of Model-Driven Engineering to...Taming Complexity: On Studying the Application of Model-Driven Engineering to...
Taming Complexity: On Studying the Application of Model-Driven Engineering to...
 
421215833-UNIT-1-OOAD-ppt.ppt
421215833-UNIT-1-OOAD-ppt.ppt421215833-UNIT-1-OOAD-ppt.ppt
421215833-UNIT-1-OOAD-ppt.ppt
 
421215833-UNIT-1-OOAD-ppt.ppt
421215833-UNIT-1-OOAD-ppt.ppt421215833-UNIT-1-OOAD-ppt.ppt
421215833-UNIT-1-OOAD-ppt.ppt
 
Introduction to Systems Engineering
Introduction to Systems EngineeringIntroduction to Systems Engineering
Introduction to Systems Engineering
 
Software Architecture: Why not just design?
Software Architecture: Why not just design?Software Architecture: Why not just design?
Software Architecture: Why not just design?
 
Developing IIOT System Using Microservices and Its Architectural Evaluation U...
Developing IIOT System Using Microservices and Its Architectural Evaluation U...Developing IIOT System Using Microservices and Its Architectural Evaluation U...
Developing IIOT System Using Microservices and Its Architectural Evaluation U...
 
Adopting code reviews for agile software development
Adopting code reviews for agile software developmentAdopting code reviews for agile software development
Adopting code reviews for agile software development
 
Lecture 3.pptx
Lecture 3.pptxLecture 3.pptx
Lecture 3.pptx
 
Machine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringMachine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their Engineering
 
The critical need for software architecture practices in software development...
The critical need for software architecture practices in software development...The critical need for software architecture practices in software development...
The critical need for software architecture practices in software development...
 
SyMAR - A Systematic Method for software Architecture Recovery
SyMAR - A Systematic Method for software Architecture RecoverySyMAR - A Systematic Method for software Architecture Recovery
SyMAR - A Systematic Method for software Architecture Recovery
 
Additive Manufacturing Simulation - Design and Process
Additive Manufacturing Simulation - Design and ProcessAdditive Manufacturing Simulation - Design and Process
Additive Manufacturing Simulation - Design and Process
 
Paper_19-Software_Architecture_Reconstruction_Method_a_Survey
Paper_19-Software_Architecture_Reconstruction_Method_a_SurveyPaper_19-Software_Architecture_Reconstruction_Method_a_Survey
Paper_19-Software_Architecture_Reconstruction_Method_a_Survey
 
Model driven development and code generation of software systems
Model driven development and code generation of software systemsModel driven development and code generation of software systems
Model driven development and code generation of software systems
 
Iabse2008 Chicago Jyrki Jauhiainen
Iabse2008 Chicago Jyrki JauhiainenIabse2008 Chicago Jyrki Jauhiainen
Iabse2008 Chicago Jyrki Jauhiainen
 
Design Concepts & Principles
Design Concepts & PrinciplesDesign Concepts & Principles
Design Concepts & Principles
 
Software Architecture Erosion and Modernization
Software Architecture Erosion and ModernizationSoftware Architecture Erosion and Modernization
Software Architecture Erosion and Modernization
 
TMPA-2017: Stemming Architectural Decay in Software Systems
TMPA-2017:  Stemming Architectural Decay in Software SystemsTMPA-2017:  Stemming Architectural Decay in Software Systems
TMPA-2017: Stemming Architectural Decay in Software Systems
 
Implementation of a Simulation Model Using the Systems Dynamics: Case Study f...
Implementation of a Simulation Model Using the Systems Dynamics: Case Study f...Implementation of a Simulation Model Using the Systems Dynamics: Case Study f...
Implementation of a Simulation Model Using the Systems Dynamics: Case Study f...
 

Plus de Morteza Zakeri

Plus de Morteza Zakeri (20)

Antlr part3 getting_started_in_c_sharp
Antlr part3 getting_started_in_c_sharpAntlr part3 getting_started_in_c_sharp
Antlr part3 getting_started_in_c_sharp
 
Antlr part1 introduction
Antlr part1 introductionAntlr part1 introduction
Antlr part1 introduction
 
Antlr part2 getting_started_in_java
Antlr part2 getting_started_in_javaAntlr part2 getting_started_in_java
Antlr part2 getting_started_in_java
 
9-roslyn-guidelines
9-roslyn-guidelines9-roslyn-guidelines
9-roslyn-guidelines
 
7-clean-code
7-clean-code7-clean-code
7-clean-code
 
8-bad-smells
8-bad-smells8-bad-smells
8-bad-smells
 
6-TDD
6-TDD6-TDD
6-TDD
 
3-use-casemodelling
3-use-casemodelling3-use-casemodelling
3-use-casemodelling
 
5-modular-design
5-modular-design5-modular-design
5-modular-design
 
4-architectural-views
4-architectural-views4-architectural-views
4-architectural-views
 
2-requirements-modelling
2-requirements-modelling2-requirements-modelling
2-requirements-modelling
 
1-requirements-elicitation
1-requirements-elicitation1-requirements-elicitation
1-requirements-elicitation
 
Analysis of Social Phenomena Using Machine Learning Techniques: A Mixed Resea...
Analysis of Social Phenomena Using Machine Learning Techniques: A Mixed Resea...Analysis of Social Phenomena Using Machine Learning Techniques: A Mixed Resea...
Analysis of Social Phenomena Using Machine Learning Techniques: A Mixed Resea...
 
Internet of Things: Middle-ware Platforms, Security, and Intrusion Detection
Internet of Things: Middle-ware Platforms, Security, and Intrusion DetectionInternet of Things: Middle-ware Platforms, Security, and Intrusion Detection
Internet of Things: Middle-ware Platforms, Security, and Intrusion Detection
 
Community Detection with Genetic Algorithm
Community Detection with Genetic AlgorithmCommunity Detection with Genetic Algorithm
Community Detection with Genetic Algorithm
 
SpotifyX Architectural Review
SpotifyX Architectural ReviewSpotifyX Architectural Review
SpotifyX Architectural Review
 
An overview of anomaly detection techniques
An overview of anomaly detection techniquesAn overview of anomaly detection techniques
An overview of anomaly detection techniques
 
SQLite and object-relational mapping in Java
SQLite and object-relational mapping in JavaSQLite and object-relational mapping in Java
SQLite and object-relational mapping in Java
 
یادگیری توالی به توالی با شبکه های عصبی
یادگیری توالی به توالی با شبکه های عصبییادگیری توالی به توالی با شبکه های عصبی
یادگیری توالی به توالی با شبکه های عصبی
 
Sequence to sequence learning with neural networks
Sequence to sequence learning with neural networksSequence to sequence learning with neural networks
Sequence to sequence learning with neural networks
 

Dernier

VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
dharasingh5698
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
ankushspencer015
 
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night StandCall Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
amitlee9823
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
dharasingh5698
 
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 

Dernier (20)

Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
 
Intro To Electric Vehicles PDF Notes.pdf
Intro To Electric Vehicles PDF Notes.pdfIntro To Electric Vehicles PDF Notes.pdf
Intro To Electric Vehicles PDF Notes.pdf
 
Online banking management system project.pdf
Online banking management system project.pdfOnline banking management system project.pdf
Online banking management system project.pdf
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - V
 
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced LoadsFEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
 
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
 
Unit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfUnit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdf
 
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
 
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night StandCall Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
 
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
 
NFPA 5000 2024 standard .
NFPA 5000 2024 standard                                  .NFPA 5000 2024 standard                                  .
NFPA 5000 2024 standard .
 
Design For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startDesign For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the start
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
 
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.ppt
 
Block diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.pptBlock diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.ppt
 
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
 

Extracting architectural model of software from source code

  • 1. Extracting Architectural Model from Source Code By: Morteza Zakeri – Mohsen Amirian Advanced Software Engineering Course Iran University of Science and Technology Winter 2017
  • 2. Outline • What is Software Reverse Engineering (SRE)? • Two Different Dimensions • Motivation • SRE Tools • Modularity Principles • Extracting Architectural Model Step by Step • Practical Case Study • References 21 February 2017 Extracting Architecture from Source Code - M.Zakeri, M.Amirian Page 2 of 38
  • 3. What is Software Reverse Engineering? • Software Reverse Engineering (SRE) is the practice of analyzing a software system, either in whole or in part, to extract design and implementation information [1]. • [1] Cipresso, T. (2009). Software Reverse Engineering Education, (August), 120. 21 February 2017 Extracting Architecture from Source Code - M.Zakeri, M.Amirian Page 3 of 38
  • 4. Two Different Dimensions • Binary Code Reverse Engineering • To obtain source code from executable object. • Source Code Reverse Engineering • To extract architectural features. 21 February 2017 Extracting Architecture from Source Code - M.Zakeri, M.Amirian Page 4 of 38
  • 5. Motivation 1. Old software systems are often not documented or very less documentation is available. • Even in the systems where documentation is available there is no explicit mention of the architecture that the code possesses. 21 February 2017 Extracting Architecture from Source Code - M.Zakeri, M.Amirian Page 5 of 38
  • 6. Motivation 2. New changes to the system need a knowledge of implicit architecture that the system possess. 21 February 2017 Extracting Architecture from Source Code - M.Zakeri, M.Amirian Page 6 of 38
  • 7. Motivation 3. Legacy Transformation • It is a tough task to convert a 10,000 line COBOL code to C/C++ code if the programmer is unaware of the underlying architecture. • As around 70% of world’s source code is in COBOL and in scientific communities FORTRAN has been the obvious choice [2]. • [2] Ali, M. R. (2005). Why teach reverse engineering? SIGSOFT Softw. Eng. Notes, 30(4), 1–4. https://doi.org/10.1145/1082983.1083004 21 February 2017 Extracting Architecture from Source Code - M.Zakeri, M.Amirian Page 7 of 38
  • 8. Motivation 4. System evolution • As system evolves , it tends to drift from it’s original architecture. • So it is very important to recover or reconstruct the architecture of the system in the spirit that new changes to the system do not affect the existing working model. 21 February 2017 Extracting Architecture from Source Code - M.Zakeri, M.Amirian Page 8 of 38
  • 9. Motivation 5. Software Testing and Security • Techniques are used to debug and find bugs and errors. • Techniques are used to make sure that the system does not have any major vulnerabilities and security flaws. 21 February 2017 Extracting Architecture from Source Code - M.Zakeri, M.Amirian Page 9 of 38
  • 10. Binary Code Reverse Engineering Tools • Disassemblers • Debuggers • Hex Editors • PE and Resource Viewer • Example: • IAD Pro, OllyDBG, WinDBG, etc. 21 February 2017 Extracting Architecture from Source Code - M.Zakeri, M.Amirian Page 10 of 38
  • 11. Source Code Reverse Engineering Tools • Calculate some software metrics. • Lines of code (LoC) • Number of Class, Functions, Statements, etc. • Visualize source code architecture to optimize software design. • Sometimes we need higher level of abstraction. • e.g. Component Diagram. 21 February 2017 Extracting Architecture from Source Code - M.Zakeri, M.Amirian Page 11 of 38
  • 12. Modularity Principles • Cohesion • Refers to the degree to which the elements of a module belong together. • Coupling • The degree of interdependence between software modules. • Good Design: High cohesion (↑), loose coupling (↓). 21 February 2017 Extracting Architecture from Source Code - M.Zakeri, M.Amirian Page 12 of 38
  • 13. Reversing Steps 21 February 2017 Extracting Architecture from Source Code - M.Zakeri, M.Amirian Page 13 of 38
  • 14. Understand 21 February 2017 Extracting Architecture from Source Code - M.Zakeri, M.Amirian Page 14 of 38
  • 15. Bunch 21 February 2017 Extracting Architecture from Source Code - M.Zakeri, M.Amirian • Bunch is a graph clustering tools. • As part of Ph.D. thesis in Computer Science at Drexel University. • By: Brian Mitchell • Using heuristic searching such as • Genetic Algorithm, • Hill Climbing, • … Page 15 of 38
  • 16. ‫ساده‬ ‫مثال‬ ‫یک‬ ‫بررسی‬ 21 February 2017 Extracting Architecture from Source Code - M.Zakeri, M.Amirian •‫برنامه‬‫بر‬ ‫مشتمل‬ ‫ای‬5‫کالس‬a, b, c, e, f‫بگیرید‬ ‫نظر‬ ‫در‬ ‫را‬. •‫با‬‫بررسی‬ ‫یک‬‫دستی‬‫کال‬ ‫هر‬ ‫متدهای‬ ‫های‬ ‫دستیابی‬ ‫تعداد‬ ‫از‬ ‫اطالعاتی‬ ‫ما‬‫بهه‬ ‫س‬ ‫آوریم‬ ‫می‬ ‫دست‬ ‫به‬ ‫دیگر‬ ‫کالس‬ ‫متدهای‬.‫ک‬ ‫در‬ ‫که‬ ‫کنیم‬ ‫می‬ ‫مشاهده‬ ‫مثال‬ ‫برای‬‫الس‬ a‫کالس‬ ‫متدهای‬ ‫بار‬ ‫دو‬b‫است‬ ‫شده‬ ‫فراخوانی‬. •‫این‬ ‫ما‬‫دهیم‬ ‫می‬ ‫نشان‬ ‫زیر‬ ‫صورت‬ ‫به‬ ‫را‬ ‫اطالع‬: • a b 2 Page 16 of 38
  • 17. ‫اول‬ ‫گام‬:‫کالس‬ ‫وابستگی‬ ‫گراف‬ ‫قالب‬ ‫در‬ ‫ارتباطی‬ ‫مدل‬ ‫استخراج‬‫ی‬ 21 February 2017 Extracting Architecture from Source Code - M.Zakeri, M.Amirian Page 17 of 38
  • 18. ‫اول‬ ‫گام‬:‫کالس‬ ‫وابستگی‬ ‫گراف‬ ‫قالب‬ ‫در‬ ‫ارتباطی‬ ‫مدل‬ ‫استخراج‬‫ی‬ 21 February 2017 Extracting Architecture from Source Code - M.Zakeri, M.Amirian Page 18 of 38
  • 19. ‫دوم‬ ‫گام‬:‫خروجی‬ ‫تبدیل‬Understand‫ورودی‬ ‫به‬Bunch 21 February 2017 Extracting Architecture from Source Code - M.Zakeri, M.Amirian •‫ورودی‬ ،‫است‬ ‫دار‬ ‫جهت‬ ‫دار‬ ‫وزن‬ ‫گراف‬ ‫که‬ ‫قبل‬ ‫گام‬ ‫خروجی‬ ‫واقع‬ ‫در‬Bunch‫قرار‬ ‫گیرد‬ ‫می‬. Page 19 of 38
  • 20. ‫دوم‬ ‫گام‬:‫خروجی‬ ‫تبدیل‬Understand‫ورودی‬ ‫به‬Bunch 21 February 2017 Extracting Architecture from Source Code - M.Zakeri, M.Amirian Page 20 of 38
  • 21. ‫گام‬‫سوم‬:‫بندی‬ ‫خوشه‬ 21 February 2017 Extracting Architecture from Source Code - M.Zakeri, M.Amirian Page 21 of 38
  • 22. Measuring Modularization Quality (MQ) • Basic MQ • Inter-connectivity • (i.e., connections between the components of two distinct clusters) • Intra-connectivity • (i.e., connections between the components of the same cluster) [3]. 21 February 2017 Extracting Architecture from Source Code - M.Zakeri, M.Amirian Page 22 of 38
  • 23. Measuring Modularization Quality (MQ) • Intra-connectivity measurement 𝐴𝑖 of cluster i consisting of 𝑁𝑖 components and 𝜇𝑖 intra-edge relations as: • 𝐴𝑖 = 𝜇 𝑖 𝑁𝑖 2 21 February 2017 Extracting Architecture from Source Code - M.Zakeri, M.Amirian Page 23 of 38
  • 24. Measuring Modularization Quality (MQ) • Inter-connectivity 𝐸𝑖,𝑗 between clusters i and j consisting of 𝑁𝑖 and 𝑁𝑗 components, respectively, and with 𝜀𝑖 inter-edge dependencies as: 21 February 2017 Extracting Architecture from Source Code - M.Zakeri, M.Amirian Page 24 of 38
  • 25. Measuring Modularization Quality (MQ) 21 February 2017 Extracting Architecture from Source Code - M.Zakeri, M.Amirian Page 25 of 38
  • 26. Measuring Modularization Quality (MQ) 21 February 2017 Extracting Architecture from Source Code - M.Zakeri, M.Amirian Page 26 of 38
  • 27. The BasicMQ Measurement • The BasicMQ measurement demonstrates the tradeoff between inter-connectivity and intra- connectivity by rewarding the creation of highly- cohesive clusters, while penalizing the creation of too many inter-edges (k is number of subsystems): 21 February 2017 Extracting Architecture from Source Code - M.Zakeri, M.Amirian Page 27 of 38
  • 28. The BasicMQ Measurement 21 February 2017 Extracting Architecture from Source Code - M.Zakeri, M.Amirian Page 28 of 38
  • 29. ‫گام‬‫سوم‬:‫بندی‬ ‫خوشه‬ 21 February 2017 Extracting Architecture from Source Code - M.Zakeri, M.Amirian Page 29 of 38
  • 30. ‫گام‬‫سوم‬:‫خوشه‬‫بندی‬(‫در‬ ‫نمایش‬Graphviz) 21 February 2017 Extracting Architecture from Source Code - M.Zakeri, M.Amirian Page 30 of 38
  • 31. ‫گام‬‫چهارم‬:‫معماری‬ ‫طرح‬ ‫استخراج‬ 21 February 2017 Extracting Architecture from Source Code - M.Zakeri, M.Amirian • IBM Rational Rose • rationalrose.tlb • ProgramFilesRationalRoserationalrose.tlb • Page 31 of 38
  • 32. ‫چهارم‬ ‫گام‬:‫طرح‬ ‫استخراج‬‫معماری‬(‫ابزار‬Package View) 21 February 2017 Extracting Architecture from Source Code - M.Zakeri, M.Amirian Page 32 of 38
  • 33. ‫چهارم‬ ‫گام‬:‫عملیاتی‬ ‫محیط‬ ‫در‬ ‫نمایش‬Rational Rose 21 February 2017 Extracting Architecture from Source Code - M.Zakeri, M.Amirian Page 33 of 38
  • 34. ‫چهارم‬ ‫گام‬:‫عملیاتی‬ ‫محیط‬ ‫در‬ ‫نمایش‬Rational Rose 21 February 2017 Extracting Architecture from Source Code - M.Zakeri, M.Amirian Page 34 of 38
  • 35. ‫آتی‬ ‫کارهای‬ •‫یافته‬ ‫ساخت‬ ‫های‬ ‫برنامه‬ ‫معماری‬ ‫استخراج‬ ‫برای‬ ‫برنامه‬ ‫تعمیم‬ •‫گرا‬ ‫شی‬ ‫به‬ ‫یافته‬ ‫ساخت‬ ‫های‬ ‫برنامه‬ ‫خودکار‬ ‫تبدیل‬ •‫منبع‬ ‫کد‬ ‫از‬ ‫طراحی‬ ‫نمودارهای‬ ‫سایر‬ ‫استخراج‬ ‫نحوه‬ ‫بررسی‬ •‫مشابه‬ ‫های‬ ‫محیط‬ ‫دیگر‬ ‫در‬ ‫نمایش‬‫نظیر‬Visual Paradigm،Oracle Designer‫و‬. ... 21 February 2017 Extracting Architecture from Source Code - M.Zakeri, M.Amirian Page 35 of 38
  • 36. References • [1] Cipresso, T. (2009). Software Reverse Engineering Education, (August), 120. • [2] Ali, M. R. (2005). Why teach reverse engineering? SIGSOFT Softw. Eng. Notes, 30(4), 1–4. https://doi.org/10.1145/1082983.1083004 • [3] Mitchell, B. S. (2002). A Heuristic Search Approach to Solving the Software Clustering Problem, (March). 21 February 2017 Extracting Architecture from Source Code - M.Zakeri, M.Amirian Page 36 of 38
  • 37. Tools • Understand • https://scitools.com/ • Bunch • https://www.cs.drexel.edu/~spiros/bunch/ • Graphviz • http://www.graphviz.org • IBM Rational Rose Enterprise • http://www-03.ibm.com/software/products/en/enterprise 21 February 2017 Extracting Architecture from Source Code - M.Zakeri, M.Amirian Page 37 of 38
  • 38. IUST Tools • Understand 2 Bunch • Bunch 2 Rational (Package Viewer) 21 February 2017 Extracting Architecture from Source Code - M.Zakeri, M.Amirian Page 38 of 38