SlideShare a Scribd company logo
Software Project
Lab -1
Name : Md. Arif Hasan
Roll : BSSE 1112
Superviser : Nadia Nahar
01
“ Code
Categorization ”
Project Name:
02
What is Code categorization ?
Code categorization can be defined as separating some
codes in basis of some predefined characteristics.
These characteristics are determined using a control flow
and data flow graph .
03
Code-2 :
#include<bits/stdc++.h>
using namespace std;
int main()
{
Int x , y , ans;
cout<<"Enter two integers:";
cin>>x>>y;
ans = x + y;
cout<<ans;
return 0;
}
#include<bits/stdc++.h>
using namespace std;
int main()
{
int a, b, sum;
cout<<"Enter two integers:";
cin>>a>>b;
sum = (a+b);
cout<<sum;
return 0;
}
Code- 1 :
04
Code-4 :
1. #include<bits/stdc++.h>
2. using namespace std;
3. void sum(int x,int y)
4. {
5. int ans= x+y;
6. cout<<"The sum is :"<< ans;
7. }
8. int main()
9. {
10. int a, b;
11. cout<<"Enter two integers:";
12. cin>>a>>b;
13. sum(a,b);
14.}
1. #include<bits/stdc++.h>
2. using namespace std;
3. int main()
4. {
5. int a, b, sum;
6. cout<<"Enter two integers:";
7. cin>>a>>b;
8. sum = (a+b);
9. cout<<sum;
10. return 0;
11. }
Code- 3 :
05
Motivation:
❖ Found difficult to categorize my codes manually.
❖ Takes a vast amount of times to find same type of codes
from a cluster of codes.
❖ To Reduce plagiarism .
06
Overview of the project :
● Take some C/C++ files as a input .
● I will represent those codes as a data flow and control
Flow graph.
● Comparing those data flow and control flow graph, i
will categorize those C/C++ codes .
07
Background Study
i) Control Flow Graph
ii) Data flow Graph
iii) Abstract Syntax Tree
08
Control Flow Graph : A control flow graph is a graphical representation of control flow or
computation during the execution of a program.It is a process oriented and directed graph.
1. int main()
2. {
3. int a=2,b=3;
4. int sum=(a+b);
5. if( sum > 0)
6. {
7. cout<<”Ans is: “<<sum;
8. }
9. else if (sum<0)
10. {
11. cout<<”Negative ans”;
12. }
13. else
14. { cout<<” Not valid”;}
15. }
3
4
5
14
11 7
9
F T
T
F
09
Data Flow Graph : A data flow graph is a directed graph in which
assignments and references to variables are represented by the nodes .
1. int main()
2. {
3. int a=20 ;
4. if(a>10)
5. { cout<<” a is less than 10”; }
6. else
7. { cout<<”a is greater than 10”; }
8. return 0;
9. }
3
4
6
7
5
10
Progress:
I can count the variable declared in a code, can detect all the
variables with their line numbers . I can also detect all the functions with their
return type from this code.
The github codes link:
i)Count of variables : https://github.com/Md-Arif-Hasan/SPL-1/blob/master/Count%20of%20variables%20--%202%20.cpp
ii) Detect variables : https://github.com/Md-Arif-Hasan/SPL-1/blob/master/Detect%20Variables.cpp
iii) Detect functions and all variables with line no:
https://github.com/Md-Arif-Hasan/SPL-1/blob/master/variable%20and%20function%20detection(%20with%20struct).cpp
11
PROGRESS:
i)Count of variables :
ii) Detect variables :
12
iii) Detect functions and all variables with line no:
13
Future Plan :
i) Making a data flow graph for each variables using these line
numbers.
ii) Making a control flow graph by using conditions , line numbers,
variables and functions.
iii) Represent the graphs to their corresponding matrix.
iv) Compare these matrices and determine whether they are similar
or not.
14
THANK YOU
15

More Related Content

What's hot

Software Engineering : Requirement Analysis & Specification
Software Engineering : Requirement Analysis & SpecificationSoftware Engineering : Requirement Analysis & Specification
Software Engineering : Requirement Analysis & Specification
Ajit Nayak
 
project
projectproject
project
dnraj
 
Chapter 15 software product metrics
Chapter 15 software product metricsChapter 15 software product metrics
Chapter 15 software product metrics
SHREEHARI WADAWADAGI
 
Software engineering
Software engineering Software engineering
Software engineering
MOHAMED RIYAZUDEEN
 
States, state graphs and transition testing
States, state graphs and transition testingStates, state graphs and transition testing
States, state graphs and transition testing
ABHISHEK KUMAR
 
Abstract class
Abstract classAbstract class
Abstract class
Tony Nguyen
 
Object Oriented Testing
Object Oriented TestingObject Oriented Testing
Object Oriented Testing
AMITJain879
 
Design Model & User Interface Design in Software Engineering
Design Model & User Interface Design in Software EngineeringDesign Model & User Interface Design in Software Engineering
Design Model & User Interface Design in Software Engineering
Meghaj Mallick
 
Software Evolution and Maintenance Models
Software Evolution and Maintenance ModelsSoftware Evolution and Maintenance Models
Software Evolution and Maintenance Models
Moutasm Tamimi
 
Cocomo model
Cocomo modelCocomo model
Cocomo model
MZ5512
 
Risk management(software engineering)
Risk management(software engineering)Risk management(software engineering)
Risk management(software engineering)
Priya Tomar
 
Ch16 component based software engineering
Ch16 component based software engineeringCh16 component based software engineering
Ch16 component based software engineering
software-engineering-book
 
fault-tolerance-slide.ppt
fault-tolerance-slide.pptfault-tolerance-slide.ppt
fault-tolerance-slide.ppt
Shailendra61
 
2. Distributed Systems Hardware & Software concepts
2. Distributed Systems Hardware & Software concepts2. Distributed Systems Hardware & Software concepts
2. Distributed Systems Hardware & Software concepts
Prajakta Rane
 
Dynamic storage allocation techniques
Dynamic storage allocation techniquesDynamic storage allocation techniques
Dynamic storage allocation techniquesShashwat Shriparv
 
Cohesion and coupling
Cohesion and couplingCohesion and coupling
Cohesion and coupling
Aprajita (Abbey) Singh
 
Software Configuration Management (SCM)
Software Configuration Management (SCM)Software Configuration Management (SCM)
Software Configuration Management (SCM)
Er. Shiva K. Shrestha
 
Evolutionary models
Evolutionary modelsEvolutionary models
Evolutionary models
Pihu Goel
 
Software Engineering - chp4- design patterns
Software Engineering - chp4- design patternsSoftware Engineering - chp4- design patterns
Software Engineering - chp4- design patterns
Lilia Sfaxi
 
Polymorphism In c++
Polymorphism In c++Polymorphism In c++
Polymorphism In c++
Vishesh Jha
 

What's hot (20)

Software Engineering : Requirement Analysis & Specification
Software Engineering : Requirement Analysis & SpecificationSoftware Engineering : Requirement Analysis & Specification
Software Engineering : Requirement Analysis & Specification
 
project
projectproject
project
 
Chapter 15 software product metrics
Chapter 15 software product metricsChapter 15 software product metrics
Chapter 15 software product metrics
 
Software engineering
Software engineering Software engineering
Software engineering
 
States, state graphs and transition testing
States, state graphs and transition testingStates, state graphs and transition testing
States, state graphs and transition testing
 
Abstract class
Abstract classAbstract class
Abstract class
 
Object Oriented Testing
Object Oriented TestingObject Oriented Testing
Object Oriented Testing
 
Design Model & User Interface Design in Software Engineering
Design Model & User Interface Design in Software EngineeringDesign Model & User Interface Design in Software Engineering
Design Model & User Interface Design in Software Engineering
 
Software Evolution and Maintenance Models
Software Evolution and Maintenance ModelsSoftware Evolution and Maintenance Models
Software Evolution and Maintenance Models
 
Cocomo model
Cocomo modelCocomo model
Cocomo model
 
Risk management(software engineering)
Risk management(software engineering)Risk management(software engineering)
Risk management(software engineering)
 
Ch16 component based software engineering
Ch16 component based software engineeringCh16 component based software engineering
Ch16 component based software engineering
 
fault-tolerance-slide.ppt
fault-tolerance-slide.pptfault-tolerance-slide.ppt
fault-tolerance-slide.ppt
 
2. Distributed Systems Hardware & Software concepts
2. Distributed Systems Hardware & Software concepts2. Distributed Systems Hardware & Software concepts
2. Distributed Systems Hardware & Software concepts
 
Dynamic storage allocation techniques
Dynamic storage allocation techniquesDynamic storage allocation techniques
Dynamic storage allocation techniques
 
Cohesion and coupling
Cohesion and couplingCohesion and coupling
Cohesion and coupling
 
Software Configuration Management (SCM)
Software Configuration Management (SCM)Software Configuration Management (SCM)
Software Configuration Management (SCM)
 
Evolutionary models
Evolutionary modelsEvolutionary models
Evolutionary models
 
Software Engineering - chp4- design patterns
Software Engineering - chp4- design patternsSoftware Engineering - chp4- design patterns
Software Engineering - chp4- design patterns
 
Polymorphism In c++
Polymorphism In c++Polymorphism In c++
Polymorphism In c++
 

Similar to Control flow Graph

Mid term sem 2 1415 sol
Mid term sem 2 1415 solMid term sem 2 1415 sol
Mid term sem 2 1415 sol
IIUM
 
C++ functions
C++ functionsC++ functions
C++ functions
Dawood Jutt
 
C++ functions
C++ functionsC++ functions
C++ functions
Dawood Jutt
 
C++ Functions.ppt
C++ Functions.pptC++ Functions.ppt
C++ Functions.ppt
kanaka vardhini
 
power point presentation on object oriented programming functions concepts
power point presentation on object oriented programming functions conceptspower point presentation on object oriented programming functions concepts
power point presentation on object oriented programming functions concepts
bhargavi804095
 
C++ manual Report Full
C++ manual Report FullC++ manual Report Full
C++ manual Report Full
Thesis Scientist Private Limited
 
C++ file
C++ fileC++ file
DATA ABSTRACTION.pptx
DATA ABSTRACTION.pptxDATA ABSTRACTION.pptx
DATA ABSTRACTION.pptx
ManavSharma694627
 
Practical basics on c++
Practical basics on c++Practical basics on c++
Practical basics on c++
Marco Izzotti
 
C++
C++C++
12th CBSE Practical File
12th CBSE Practical File12th CBSE Practical File
12th CBSE Practical File
Ashwin Francis
 
Modify this code to use multiple threads with the same data1.Modif.pdf
Modify this code to use multiple threads with the same data1.Modif.pdfModify this code to use multiple threads with the same data1.Modif.pdf
Modify this code to use multiple threads with the same data1.Modif.pdf
mallik3000
 
Unit-IV.pptx
Unit-IV.pptxUnit-IV.pptx
Unit-IV.pptx
Mehul Desai
 
C++
C++C++
NSC #2 - D2 06 - Richard Johnson - SAGEly Advice
NSC #2 - D2 06 - Richard Johnson - SAGEly AdviceNSC #2 - D2 06 - Richard Johnson - SAGEly Advice
NSC #2 - D2 06 - Richard Johnson - SAGEly Advice
NoSuchCon
 
ParallelProgrammingBasics_v2.pdf
ParallelProgrammingBasics_v2.pdfParallelProgrammingBasics_v2.pdf
ParallelProgrammingBasics_v2.pdf
Chen-Hung Hu
 

Similar to Control flow Graph (20)

Mid term sem 2 1415 sol
Mid term sem 2 1415 solMid term sem 2 1415 sol
Mid term sem 2 1415 sol
 
C++ functions
C++ functionsC++ functions
C++ functions
 
C++ functions
C++ functionsC++ functions
C++ functions
 
C++ Functions.ppt
C++ Functions.pptC++ Functions.ppt
C++ Functions.ppt
 
power point presentation on object oriented programming functions concepts
power point presentation on object oriented programming functions conceptspower point presentation on object oriented programming functions concepts
power point presentation on object oriented programming functions concepts
 
C++ manual Report Full
C++ manual Report FullC++ manual Report Full
C++ manual Report Full
 
C++ file
C++ fileC++ file
C++ file
 
CP 04.pptx
CP 04.pptxCP 04.pptx
CP 04.pptx
 
DATA ABSTRACTION.pptx
DATA ABSTRACTION.pptxDATA ABSTRACTION.pptx
DATA ABSTRACTION.pptx
 
Practical basics on c++
Practical basics on c++Practical basics on c++
Practical basics on c++
 
C++
C++C++
C++
 
12th CBSE Practical File
12th CBSE Practical File12th CBSE Practical File
12th CBSE Practical File
 
Labsheet1stud
Labsheet1studLabsheet1stud
Labsheet1stud
 
Modify this code to use multiple threads with the same data1.Modif.pdf
Modify this code to use multiple threads with the same data1.Modif.pdfModify this code to use multiple threads with the same data1.Modif.pdf
Modify this code to use multiple threads with the same data1.Modif.pdf
 
901131 examples
901131 examples901131 examples
901131 examples
 
Unit-IV.pptx
Unit-IV.pptxUnit-IV.pptx
Unit-IV.pptx
 
C++
C++C++
C++
 
Bijender (1)
Bijender (1)Bijender (1)
Bijender (1)
 
NSC #2 - D2 06 - Richard Johnson - SAGEly Advice
NSC #2 - D2 06 - Richard Johnson - SAGEly AdviceNSC #2 - D2 06 - Richard Johnson - SAGEly Advice
NSC #2 - D2 06 - Richard Johnson - SAGEly Advice
 
ParallelProgrammingBasics_v2.pdf
ParallelProgrammingBasics_v2.pdfParallelProgrammingBasics_v2.pdf
ParallelProgrammingBasics_v2.pdf
 

Recently uploaded

NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
Amil Baba Dawood bangali
 
14 Template Contractual Notice - EOT Application
14 Template Contractual Notice - EOT Application14 Template Contractual Notice - EOT Application
14 Template Contractual Notice - EOT Application
SyedAbiiAzazi1
 
Planning Of Procurement o different goods and services
Planning Of Procurement o different goods and servicesPlanning Of Procurement o different goods and services
Planning Of Procurement o different goods and services
JoytuBarua2
 
Fundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptxFundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptx
manasideore6
 
space technology lecture notes on satellite
space technology lecture notes on satellitespace technology lecture notes on satellite
space technology lecture notes on satellite
ongomchris
 
road safety engineering r s e unit 3.pdf
road safety engineering  r s e unit 3.pdfroad safety engineering  r s e unit 3.pdf
road safety engineering r s e unit 3.pdf
VENKATESHvenky89705
 
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
ydteq
 
Gen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdfGen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdf
gdsczhcet
 
Heap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTS
Heap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTSHeap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTS
Heap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTS
Soumen Santra
 
Tutorial for 16S rRNA Gene Analysis with QIIME2.pdf
Tutorial for 16S rRNA Gene Analysis with QIIME2.pdfTutorial for 16S rRNA Gene Analysis with QIIME2.pdf
Tutorial for 16S rRNA Gene Analysis with QIIME2.pdf
aqil azizi
 
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
zwunae
 
Unbalanced Three Phase Systems and circuits.pptx
Unbalanced Three Phase Systems and circuits.pptxUnbalanced Three Phase Systems and circuits.pptx
Unbalanced Three Phase Systems and circuits.pptx
ChristineTorrepenida1
 
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Dr.Costas Sachpazis
 
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdfWater Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation & Control
 
Final project report on grocery store management system..pdf
Final project report on grocery store management system..pdfFinal project report on grocery store management system..pdf
Final project report on grocery store management system..pdf
Kamal Acharya
 
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdfHybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
fxintegritypublishin
 
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
thanhdowork
 
Investor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptxInvestor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptx
AmarGB2
 
AP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specificAP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specific
BrazilAccount1
 
Railway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdfRailway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdf
TeeVichai
 

Recently uploaded (20)

NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
 
14 Template Contractual Notice - EOT Application
14 Template Contractual Notice - EOT Application14 Template Contractual Notice - EOT Application
14 Template Contractual Notice - EOT Application
 
Planning Of Procurement o different goods and services
Planning Of Procurement o different goods and servicesPlanning Of Procurement o different goods and services
Planning Of Procurement o different goods and services
 
Fundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptxFundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptx
 
space technology lecture notes on satellite
space technology lecture notes on satellitespace technology lecture notes on satellite
space technology lecture notes on satellite
 
road safety engineering r s e unit 3.pdf
road safety engineering  r s e unit 3.pdfroad safety engineering  r s e unit 3.pdf
road safety engineering r s e unit 3.pdf
 
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
 
Gen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdfGen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdf
 
Heap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTS
Heap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTSHeap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTS
Heap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTS
 
Tutorial for 16S rRNA Gene Analysis with QIIME2.pdf
Tutorial for 16S rRNA Gene Analysis with QIIME2.pdfTutorial for 16S rRNA Gene Analysis with QIIME2.pdf
Tutorial for 16S rRNA Gene Analysis with QIIME2.pdf
 
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
 
Unbalanced Three Phase Systems and circuits.pptx
Unbalanced Three Phase Systems and circuits.pptxUnbalanced Three Phase Systems and circuits.pptx
Unbalanced Three Phase Systems and circuits.pptx
 
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
 
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdfWater Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdf
 
Final project report on grocery store management system..pdf
Final project report on grocery store management system..pdfFinal project report on grocery store management system..pdf
Final project report on grocery store management system..pdf
 
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdfHybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
 
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
 
Investor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptxInvestor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptx
 
AP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specificAP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specific
 
Railway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdfRailway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdf
 

Control flow Graph

  • 1. Software Project Lab -1 Name : Md. Arif Hasan Roll : BSSE 1112 Superviser : Nadia Nahar 01
  • 3. What is Code categorization ? Code categorization can be defined as separating some codes in basis of some predefined characteristics. These characteristics are determined using a control flow and data flow graph . 03
  • 4. Code-2 : #include<bits/stdc++.h> using namespace std; int main() { Int x , y , ans; cout<<"Enter two integers:"; cin>>x>>y; ans = x + y; cout<<ans; return 0; } #include<bits/stdc++.h> using namespace std; int main() { int a, b, sum; cout<<"Enter two integers:"; cin>>a>>b; sum = (a+b); cout<<sum; return 0; } Code- 1 : 04
  • 5. Code-4 : 1. #include<bits/stdc++.h> 2. using namespace std; 3. void sum(int x,int y) 4. { 5. int ans= x+y; 6. cout<<"The sum is :"<< ans; 7. } 8. int main() 9. { 10. int a, b; 11. cout<<"Enter two integers:"; 12. cin>>a>>b; 13. sum(a,b); 14.} 1. #include<bits/stdc++.h> 2. using namespace std; 3. int main() 4. { 5. int a, b, sum; 6. cout<<"Enter two integers:"; 7. cin>>a>>b; 8. sum = (a+b); 9. cout<<sum; 10. return 0; 11. } Code- 3 : 05
  • 6. Motivation: ❖ Found difficult to categorize my codes manually. ❖ Takes a vast amount of times to find same type of codes from a cluster of codes. ❖ To Reduce plagiarism . 06
  • 7. Overview of the project : ● Take some C/C++ files as a input . ● I will represent those codes as a data flow and control Flow graph. ● Comparing those data flow and control flow graph, i will categorize those C/C++ codes . 07
  • 8. Background Study i) Control Flow Graph ii) Data flow Graph iii) Abstract Syntax Tree 08
  • 9. Control Flow Graph : A control flow graph is a graphical representation of control flow or computation during the execution of a program.It is a process oriented and directed graph. 1. int main() 2. { 3. int a=2,b=3; 4. int sum=(a+b); 5. if( sum > 0) 6. { 7. cout<<”Ans is: “<<sum; 8. } 9. else if (sum<0) 10. { 11. cout<<”Negative ans”; 12. } 13. else 14. { cout<<” Not valid”;} 15. } 3 4 5 14 11 7 9 F T T F 09
  • 10. Data Flow Graph : A data flow graph is a directed graph in which assignments and references to variables are represented by the nodes . 1. int main() 2. { 3. int a=20 ; 4. if(a>10) 5. { cout<<” a is less than 10”; } 6. else 7. { cout<<”a is greater than 10”; } 8. return 0; 9. } 3 4 6 7 5 10
  • 11. Progress: I can count the variable declared in a code, can detect all the variables with their line numbers . I can also detect all the functions with their return type from this code. The github codes link: i)Count of variables : https://github.com/Md-Arif-Hasan/SPL-1/blob/master/Count%20of%20variables%20--%202%20.cpp ii) Detect variables : https://github.com/Md-Arif-Hasan/SPL-1/blob/master/Detect%20Variables.cpp iii) Detect functions and all variables with line no: https://github.com/Md-Arif-Hasan/SPL-1/blob/master/variable%20and%20function%20detection(%20with%20struct).cpp 11
  • 12. PROGRESS: i)Count of variables : ii) Detect variables : 12
  • 13. iii) Detect functions and all variables with line no: 13
  • 14. Future Plan : i) Making a data flow graph for each variables using these line numbers. ii) Making a control flow graph by using conditions , line numbers, variables and functions. iii) Represent the graphs to their corresponding matrix. iv) Compare these matrices and determine whether they are similar or not. 14