SlideShare a Scribd company logo
1 of 31
1
DYNAMIC SLICING OF ASPECT-
ORIENTED PROGRAMS
BY
www.carrertime.in
www.facebook.com/carrertime.in
2
OUTLINE
• Introduction
• Introduction to AspectJ - An AOP Language
• Slicing of AOP
• Motivation of Research
• Objective of Research
• Work Done
• Conclusion
• Future Work
• References
3
Introduction
•Finding all statements in a program that directly or
indirectly affect the value of a variable occurrence is
referred to as Program Slicing.
•The pair <s,v> is known as Slicing Criterion where s is a
program point of interest and v is a variable used or
defined at s.
4
Categories of Slice
•Backward Slice: All statements that might have
affected the value of a variable at a program point
•Forward Slice: All statements that might be affected by
the value of a variable at a program point
•Static Slice: All statements that may affect the value of
a variable at a program point for all possible executions
•Dynamic Slice: All statements that actually affect the
value of a variable at a program point for a particular
execution
•Intra-Procedural Slice: Slice within a single procedure
•Inter-Procedural Slice: Slice within multiple procedure
5
EXAMPLE
1 main( )
2 {
3 int i, sum;
4 sum = 0;
5 i = 1;
6 while(i <= 10)
7 {
8 sum = sum + 1;
9 ++ i;
10 }
11 printf(“%d”, sum);
12 printf(“%d”, i);
13 }
An Example program and its slice w.r.t. <12,i>
6
APPLICATIONS OF PROGRAM SLICING
Debugging
Testing
Software Maintenance
Differencing
Reverse Engineering
7
Approaches to Slicing
•Control Flow Graph (CFG) Based
Data flow equations are solved
•Dependence Graph Based
Dependence graph is used as the intermediate program
representation
Slice is computed as the graph reachability problem
Program Dependence Graph (PDG)
Used for intra-procedural slicing
Nodes represent statements
Edges represent data/control dependencies
System Dependence Graph (SDG)
Used for inter-procedural slicing
Same as PDG except that it includes vertices and edges for call
statements, parameter passing and transitive dependences due to
calls.
8
Aspect-Oriented Programming
•Gregor Kiczales and his team at Xerox PARC originated the
concept of Aspect Oriented Programming (AOP).
•Aspect-oriented programming is a new programming technique
proposed for cleanly modularizing the cross-cutting structure of
concerns such as exception handling, synchronization and
resource sharing.
•An "aspect" is an "area of concern" that cuts across the structure
of a program.
•The main idea behind aspect-oriented programming (AOP) is to
allow a program to be constructed by describing each concern
separately.
9
Fundamental goal of AOP
•Allow for the separation of concerns as appropriate for
a host language.
•Provide a mechanism for the description of concerns
that crosscut other components.
10
AOP Vs. OOP
•Similarities- AOP utilizes advantages of OOP
AOP and OOP both use objects
Objects combine the behavior and data of a
concern into a single physical entity
•Differences- handling of cross-cutting concerns
OOP tries to push the scattered code for these
concerns up in the inheritance tree
This is often not possible and results in tangled
code
AOP collects scattered concerns into a single class
structure
11
Benefits of AOP
•It improves performance because the operations are
more succinct
•It allows programmer to spend less time rewriting the
same code
•Separation of Concerns
AOP makes it possible to encapsulate cross-cutting
concerns
12
Benefits of AOP (Cont.)
•Simpler System Evolution
Join points allow changes to programs to be
incorporated simply with aspects
•Reuse
Aspects can often be reused in other programs with
only slight modifications
13
AspectJ: An AOP Language
•An aspect-oriented extension to the JAVA programming
language
•Created at Xerox PARC by Chris Maeda.
•Compatible with current JAVA platform.
•Compatibility includes
upward compatibility
platform compatibility
tool compatibility
programmer compatibility
14
Features of AspectJ
•Join Points
•Pointcut
•Advice
•Introduction/Inter-type declaration
•Aspect
15
Motivation
•Slicing techniques need to be efficient because of its
use in debugging and testing
•Reports on slicing of AOPs are scarce
•This demands the development of efficient slicing
algorithm for AOPs
16
Objectives
•An appropriate frame-work for computing slices
•Suitable intermediate representation of Aspect-oriented
program
•Development of suitable dynamic slicing technique
17
An Example AspectJ Program
18
Algorithm: Trace file Based algorithm
1. Creation of execution trace file: To create an execution trace
file, do the following:
a) For a given input, execute the program and store each
statement s in the order of execution in a file after it has
been executed.
b) If the program contains loops, then store each statement s
inside the loop in the trace file after each time it has been
executed.
2. Construction of DADG: To Construct the DADG of the aspect-
oriented program P with respect to the trace file, do the
following:
a) For each statement s in the trace file, create a vertex in the
DADG.
b) For each occurrence of a statement s in the trace file, create
a separate vertex.
19
Algorithm: Trace file Based algorithm (Cont.)
c) Add all control dependence edges, data dependence edges
and weaving edges to these vertices.
1. Computation of dynamic slice: To compute the dynamic slice
over the DADG, do the following:
a) Perform the breadth-first or depth-first graph traversal over
the DADG taking any vertex corresponding to the statement
of interest as the starting point of traversal.
3. Mapping of the slice: To obtain the dynamic slice of the
aspect-oriented program P, do the following:
a) Define a mapping function f : DSG(p, q, e, n) → P .
b) Map the resulting slice obtained in step 3(a) over the DADG
to the source code P using f since the slice may contain
multiple occurrences of the same vertex.
20
Working of the Algorithm
Input data: argv[0]=4.
Executed statements in order: 1, 2, 3, 13, 14, 15, 4, 5, 6, 7, 8, 9,
7, 8, 9, 7, 8, 9, 7, 8, 9, 7, 16, 17, 11.
Slicing criterion: < 11, p >.
Breadth-first search algorithm: 11, 17, 8, 16, 7, 8, 9, 7, 13, 5, 9,
7, 8, 9, 9, 3, 2, 4, 7, 8, 9, 1, 15, 7, 6, 14.
Depth-first search algorithm: 11, 8, 9, 9, 9, 4, 15, 14, 2, 1, 7, 5,
7, 7, 8, 8, 8, 6, 7, 17, 16, 13, 3, 7, 9.
Map: 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 13, 14, 15, 16, 17.
21
Execution Trace File
22
Dynamic Aspect-Oriented Dependence Graph (DADG)
23
Dynamic Slice
24
Average Runtime
Sl. No. Prg. Size
(# stmts)
Avg.
Runtime(in
sec.)
1 17 0.11
2 43 0.71
3 69 0.89
4 97 1.07
5 123 1.36
6 245 2.46
7 387 3.96
8 562 5.52
25
Conclusion
•Trace file is used for storing the execution history
•Separate vertices are created in the DADG for different
execution of the same statement
•Average run-time is more
26
Future Work
•Modifying the algorithm to avoid the use of trace file
•Handling composite data types
•Handling unstructured programs
•Computing dynamic slices of concurrent AOPs
27
REFERENCES
[1] Binkley D. W. and Gallagher K. B. Program Slicing.
Advances in Computers, 43, 1996. Academic Press, San
Diego, CA.
[2] Agarwal H. and Horgan J. R. Dynamic Program
Slicing. In ACM SIGPLAN Notices, Proceedings of the ACM
SIGPLAN 1990 Conference on Programming Language Design
and Implementation PLDI'90, volume 25 of 6, pages 246-256,
June 1990.
[3] Zhao J. Dynamic Slicing of Object-Oriented Programs.
Technical report, Information Processing Society of Japan,
May 1998.
28
REFERENCES (Cont.)
[4] Horowitz S., Reps T., and Binkley D. Inter-Procedural
Slicing Using Dependence Graphs. ACM
Transactions on Programming Languages and Systems,
12(1):26-60, January 1990.
[5] Kiczales G., Irwin J., Lamping J., Loingtier J. M., Lopes C.
V., Maeda C., and Mendhekar Anurag. Aspect-Oriented
Programming. In Proceedings of the European
Conference on Object-Oriented Programming (ECOOP),
Finland, June 1997. Springer-Verlag.
[6] Zhao J. Slicing Aspect-Oriented Software. In Proceedings
of 10th International Workshop on Program
Comprehension, pages 251-260, June 2002.
29
REFERENCES (Cont.)
[7] Zhao J. and Rinard M. System Dependence Graph
Construction for Aspect-Oriented Programs. Technical
report, Laboratory for Computer Science, Massachusetts
Institute of Technology, USA, March 2003.
[8] Braak T. T. Extending program slicing in aspect-oriented
programming with inter-type declarations. 5th TSCon IT
Program, June 2006.
[9] Korel B. and Laski J. Dynamic Program Slicing.
Information Processing Letters, 29(3):155-163, 1988.
[10] Mohapatra D. P. Dynamic Slicing of Object-Oriented
Programs. PhD thesis, Indian Institute of Technology,
Kharagpur, May 2005.
30
REFERENCES (Cont.)
[11] Tip F. A Survey of Program Slicing Techniques. Journal of
Programming Languages, 3(3):121-189, 1995.
[12] Mohapatra D. P., Mall R., and Kumar R. Dynamic Slicing of
Concurrent Object-Oriented Programs. In Proceedings of
International Conference on Information Technology:
Progresses and Challenges (ITPC), pages 283-290.
Kathamandu, May 2003.
[13] Ishio T., Kusumoto S., and Inoue K. Application of Aspect-
Oriented Programming to Calculation of Program Slice.
Technical report, ICSE, 2003.
[14] AspectJ. www.eclipse.org/aspectj.
[15] Aspect-Oriented Programming. www.wikipedia.org.
31
www.carrertime.in
www.facebook.com/carrertime.in

More Related Content

What's hot

Chitra_BE_ECE_2015_74AGG
Chitra_BE_ECE_2015_74AGGChitra_BE_ECE_2015_74AGG
Chitra_BE_ECE_2015_74AGGCHAITRA NAGANUR
 
Practical List COMPILER DESIGN
Practical List COMPILER DESIGNPractical List COMPILER DESIGN
Practical List COMPILER DESIGNShraddha Patel
 
Impact Analysis of Granularity Levels on Feature Location Technique
Impact Analysis of Granularity Levels on Feature Location TechniqueImpact Analysis of Granularity Levels on Feature Location Technique
Impact Analysis of Granularity Levels on Feature Location TechniqueChakkrit (Kla) Tantithamthavorn
 
Automated Program Repair Keynote talk
Automated Program Repair Keynote talkAutomated Program Repair Keynote talk
Automated Program Repair Keynote talkAbhik Roychoudhury
 
QVT Traceability: What does it really mean?
QVT Traceability: What does it really mean?QVT Traceability: What does it really mean?
QVT Traceability: What does it really mean?Edward Willink
 
Data analysis with R and Julia
Data analysis with R and JuliaData analysis with R and Julia
Data analysis with R and JuliaMark Tabladillo
 
Probe Debugging
Probe DebuggingProbe Debugging
Probe DebuggingESUG
 
halstead software science measures
halstead software science measureshalstead software science measures
halstead software science measuresDeepti Pillai
 
A Survey on Automatic Software Evolution Techniques
A Survey on Automatic Software Evolution TechniquesA Survey on Automatic Software Evolution Techniques
A Survey on Automatic Software Evolution TechniquesSung Kim
 
1 R Tutorial Introduction
1 R Tutorial Introduction1 R Tutorial Introduction
1 R Tutorial IntroductionSakthi Dasans
 
DeepAM: Migrate APIs with Multi-modal Sequence to Sequence Learning
DeepAM: Migrate APIs with Multi-modal Sequence to Sequence LearningDeepAM: Migrate APIs with Multi-modal Sequence to Sequence Learning
DeepAM: Migrate APIs with Multi-modal Sequence to Sequence LearningSung Kim
 
Semantic scaffolds for pseudocode to-code generation (2020)
Semantic scaffolds for pseudocode to-code generation (2020)Semantic scaffolds for pseudocode to-code generation (2020)
Semantic scaffolds for pseudocode to-code generation (2020)Minhazul Arefin
 
Static analysis works for mission-critical systems, why not yours?
Static analysis works for mission-critical systems, why not yours? Static analysis works for mission-critical systems, why not yours?
Static analysis works for mission-critical systems, why not yours? Rogue Wave Software
 
A Conceptual Framework for the Comparison of Fully Automated GUI Testing Tech...
A Conceptual Framework for the Comparison of Fully Automated GUI Testing Tech...A Conceptual Framework for the Comparison of Fully Automated GUI Testing Tech...
A Conceptual Framework for the Comparison of Fully Automated GUI Testing Tech...REvERSE University of Naples Federico II
 
Summer Research Project. Final Presentation 2013
Summer Research Project. Final Presentation 2013Summer Research Project. Final Presentation 2013
Summer Research Project. Final Presentation 2013Ojaswa Anand
 
The road ahead for scientific computing with Python
The road ahead for scientific computing with PythonThe road ahead for scientific computing with Python
The road ahead for scientific computing with PythonRalf Gommers
 
R programming presentation
R programming presentationR programming presentation
R programming presentationAkshat Sharma
 

What's hot (20)

Chitra_BE_ECE_2015_74AGG
Chitra_BE_ECE_2015_74AGGChitra_BE_ECE_2015_74AGG
Chitra_BE_ECE_2015_74AGG
 
Practical List COMPILER DESIGN
Practical List COMPILER DESIGNPractical List COMPILER DESIGN
Practical List COMPILER DESIGN
 
Impact Analysis of Granularity Levels on Feature Location Technique
Impact Analysis of Granularity Levels on Feature Location TechniqueImpact Analysis of Granularity Levels on Feature Location Technique
Impact Analysis of Granularity Levels on Feature Location Technique
 
Automated Program Repair Keynote talk
Automated Program Repair Keynote talkAutomated Program Repair Keynote talk
Automated Program Repair Keynote talk
 
QVT Traceability: What does it really mean?
QVT Traceability: What does it really mean?QVT Traceability: What does it really mean?
QVT Traceability: What does it really mean?
 
Have you met Julia?
Have you met Julia?Have you met Julia?
Have you met Julia?
 
Data analysis with R and Julia
Data analysis with R and JuliaData analysis with R and Julia
Data analysis with R and Julia
 
Probe Debugging
Probe DebuggingProbe Debugging
Probe Debugging
 
halstead software science measures
halstead software science measureshalstead software science measures
halstead software science measures
 
A Survey on Automatic Software Evolution Techniques
A Survey on Automatic Software Evolution TechniquesA Survey on Automatic Software Evolution Techniques
A Survey on Automatic Software Evolution Techniques
 
1 R Tutorial Introduction
1 R Tutorial Introduction1 R Tutorial Introduction
1 R Tutorial Introduction
 
DeepAM: Migrate APIs with Multi-modal Sequence to Sequence Learning
DeepAM: Migrate APIs with Multi-modal Sequence to Sequence LearningDeepAM: Migrate APIs with Multi-modal Sequence to Sequence Learning
DeepAM: Migrate APIs with Multi-modal Sequence to Sequence Learning
 
Semantic scaffolds for pseudocode to-code generation (2020)
Semantic scaffolds for pseudocode to-code generation (2020)Semantic scaffolds for pseudocode to-code generation (2020)
Semantic scaffolds for pseudocode to-code generation (2020)
 
Static analysis works for mission-critical systems, why not yours?
Static analysis works for mission-critical systems, why not yours? Static analysis works for mission-critical systems, why not yours?
Static analysis works for mission-critical systems, why not yours?
 
A Conceptual Framework for the Comparison of Fully Automated GUI Testing Tech...
A Conceptual Framework for the Comparison of Fully Automated GUI Testing Tech...A Conceptual Framework for the Comparison of Fully Automated GUI Testing Tech...
A Conceptual Framework for the Comparison of Fully Automated GUI Testing Tech...
 
Summer Research Project. Final Presentation 2013
Summer Research Project. Final Presentation 2013Summer Research Project. Final Presentation 2013
Summer Research Project. Final Presentation 2013
 
R programming
R programmingR programming
R programming
 
The road ahead for scientific computing with Python
The road ahead for scientific computing with PythonThe road ahead for scientific computing with Python
The road ahead for scientific computing with Python
 
Class ppt intro to r
Class ppt intro to rClass ppt intro to r
Class ppt intro to r
 
R programming presentation
R programming presentationR programming presentation
R programming presentation
 

Viewers also liked

Verification, Slicing and Visualization of Programs with Contracts
Verification, Slicing and Visualization of Programs with ContractsVerification, Slicing and Visualization of Programs with Contracts
Verification, Slicing and Visualization of Programs with Contractspinker
 
Slicing of Object-Oriented Programs
Slicing of Object-Oriented ProgramsSlicing of Object-Oriented Programs
Slicing of Object-Oriented ProgramsPraveen Penumathsa
 
Programing Slicing and Its applications
Programing Slicing and Its applicationsPrograming Slicing and Its applications
Programing Slicing and Its applicationsAnkur Jain
 
Verification Conditions for Single-Assignment Programs
Verification Conditions for Single-Assignment ProgramsVerification Conditions for Single-Assignment Programs
Verification Conditions for Single-Assignment Programspinker
 
What's Next in Growth? 2016
What's Next in Growth? 2016What's Next in Growth? 2016
What's Next in Growth? 2016Andrew Chen
 
32 Ways a Digital Marketing Consultant Can Help Grow Your Business
32 Ways a Digital Marketing Consultant Can Help Grow Your Business32 Ways a Digital Marketing Consultant Can Help Grow Your Business
32 Ways a Digital Marketing Consultant Can Help Grow Your BusinessBarry Feldman
 

Viewers also liked (7)

Verification, Slicing and Visualization of Programs with Contracts
Verification, Slicing and Visualization of Programs with ContractsVerification, Slicing and Visualization of Programs with Contracts
Verification, Slicing and Visualization of Programs with Contracts
 
presentacion
presentacionpresentacion
presentacion
 
Slicing of Object-Oriented Programs
Slicing of Object-Oriented ProgramsSlicing of Object-Oriented Programs
Slicing of Object-Oriented Programs
 
Programing Slicing and Its applications
Programing Slicing and Its applicationsPrograming Slicing and Its applications
Programing Slicing and Its applications
 
Verification Conditions for Single-Assignment Programs
Verification Conditions for Single-Assignment ProgramsVerification Conditions for Single-Assignment Programs
Verification Conditions for Single-Assignment Programs
 
What's Next in Growth? 2016
What's Next in Growth? 2016What's Next in Growth? 2016
What's Next in Growth? 2016
 
32 Ways a Digital Marketing Consultant Can Help Grow Your Business
32 Ways a Digital Marketing Consultant Can Help Grow Your Business32 Ways a Digital Marketing Consultant Can Help Grow Your Business
32 Ways a Digital Marketing Consultant Can Help Grow Your Business
 

Similar to DYNAMIC SLICING OF ASPECT-ORIENTED PROGRAMS

Static Slicing Technique with Algorithmic Approach
Static Slicing Technique with Algorithmic ApproachStatic Slicing Technique with Algorithmic Approach
Static Slicing Technique with Algorithmic ApproachIOSR Journals
 
PCCF UNIT 1.pptx
PCCF UNIT 1.pptxPCCF UNIT 1.pptx
PCCF UNIT 1.pptxDivyaKS12
 
A Performance Comparison Of C# 2013, Delphi Xe6, And Python 3.4 Languages
A Performance Comparison Of C# 2013, Delphi Xe6, And Python 3.4 LanguagesA Performance Comparison Of C# 2013, Delphi Xe6, And Python 3.4 Languages
A Performance Comparison Of C# 2013, Delphi Xe6, And Python 3.4 Languagesijpla
 
OpenPOWER Webinar from University of Delaware - Title :OpenMP (offloading) o...
OpenPOWER Webinar from University of Delaware  - Title :OpenMP (offloading) o...OpenPOWER Webinar from University of Delaware  - Title :OpenMP (offloading) o...
OpenPOWER Webinar from University of Delaware - Title :OpenMP (offloading) o...Ganesan Narayanasamy
 
Mapping and visualization of source code a survey
Mapping and visualization of source code a surveyMapping and visualization of source code a survey
Mapping and visualization of source code a surveyNakul Sharma
 
International Journal of Engineering and Science Invention (IJESI)
International Journal of Engineering and Science Invention (IJESI)International Journal of Engineering and Science Invention (IJESI)
International Journal of Engineering and Science Invention (IJESI)inventionjournals
 
reverse engineering.ppt
reverse engineering.pptreverse engineering.ppt
reverse engineering.pptNaglaaFathy42
 
Recent Trends in Translation of Programming Languages using NLP Approaches
Recent Trends in Translation of Programming Languages using NLP ApproachesRecent Trends in Translation of Programming Languages using NLP Approaches
Recent Trends in Translation of Programming Languages using NLP ApproachesIRJET Journal
 
Algorithm,Pseudocode,Flowchart.pptx
Algorithm,Pseudocode,Flowchart.pptxAlgorithm,Pseudocode,Flowchart.pptx
Algorithm,Pseudocode,Flowchart.pptxDrThenmozhiKarunanit
 
Software Birthmark for Theft Detection of JavaScript Programs: A Survey
Software Birthmark for Theft Detection of JavaScript Programs: A Survey Software Birthmark for Theft Detection of JavaScript Programs: A Survey
Software Birthmark for Theft Detection of JavaScript Programs: A Survey Swati Patel
 
The Past, Present, and Future of OpenACC
The Past, Present, and Future of OpenACCThe Past, Present, and Future of OpenACC
The Past, Present, and Future of OpenACCinside-BigData.com
 
Weather and Climate Visualization software
Weather and Climate Visualization softwareWeather and Climate Visualization software
Weather and Climate Visualization softwareRahul Gupta
 
Compiler Design Using Context-Free Grammar
Compiler Design Using Context-Free GrammarCompiler Design Using Context-Free Grammar
Compiler Design Using Context-Free GrammarIRJET Journal
 
Monitoring and Instrumentation Strategies: Tips and Best Practices - AppSphere16
Monitoring and Instrumentation Strategies: Tips and Best Practices - AppSphere16Monitoring and Instrumentation Strategies: Tips and Best Practices - AppSphere16
Monitoring and Instrumentation Strategies: Tips and Best Practices - AppSphere16AppDynamics
 
Slicing of Object-Oriented Programs
Slicing of Object-Oriented ProgramsSlicing of Object-Oriented Programs
Slicing of Object-Oriented ProgramsPraveen Penumathsa
 
Software system design sample
Software system design sampleSoftware system design sample
Software system design sampleNorman K Ma
 
(Costless) Software Abstractions for Parallel Architectures
(Costless) Software Abstractions for Parallel Architectures(Costless) Software Abstractions for Parallel Architectures
(Costless) Software Abstractions for Parallel ArchitecturesJoel Falcou
 

Similar to DYNAMIC SLICING OF ASPECT-ORIENTED PROGRAMS (20)

Static Slicing Technique with Algorithmic Approach
Static Slicing Technique with Algorithmic ApproachStatic Slicing Technique with Algorithmic Approach
Static Slicing Technique with Algorithmic Approach
 
PCCF UNIT 1.pptx
PCCF UNIT 1.pptxPCCF UNIT 1.pptx
PCCF UNIT 1.pptx
 
A Performance Comparison Of C# 2013, Delphi Xe6, And Python 3.4 Languages
A Performance Comparison Of C# 2013, Delphi Xe6, And Python 3.4 LanguagesA Performance Comparison Of C# 2013, Delphi Xe6, And Python 3.4 Languages
A Performance Comparison Of C# 2013, Delphi Xe6, And Python 3.4 Languages
 
Vedic Calculator
Vedic CalculatorVedic Calculator
Vedic Calculator
 
OpenPOWER Webinar from University of Delaware - Title :OpenMP (offloading) o...
OpenPOWER Webinar from University of Delaware  - Title :OpenMP (offloading) o...OpenPOWER Webinar from University of Delaware  - Title :OpenMP (offloading) o...
OpenPOWER Webinar from University of Delaware - Title :OpenMP (offloading) o...
 
Mapping and visualization of source code a survey
Mapping and visualization of source code a surveyMapping and visualization of source code a survey
Mapping and visualization of source code a survey
 
International Journal of Engineering and Science Invention (IJESI)
International Journal of Engineering and Science Invention (IJESI)International Journal of Engineering and Science Invention (IJESI)
International Journal of Engineering and Science Invention (IJESI)
 
reverse engineering.ppt
reverse engineering.pptreverse engineering.ppt
reverse engineering.ppt
 
Recent Trends in Translation of Programming Languages using NLP Approaches
Recent Trends in Translation of Programming Languages using NLP ApproachesRecent Trends in Translation of Programming Languages using NLP Approaches
Recent Trends in Translation of Programming Languages using NLP Approaches
 
Algorithm,Pseudocode,Flowchart.pptx
Algorithm,Pseudocode,Flowchart.pptxAlgorithm,Pseudocode,Flowchart.pptx
Algorithm,Pseudocode,Flowchart.pptx
 
Software Birthmark for Theft Detection of JavaScript Programs: A Survey
Software Birthmark for Theft Detection of JavaScript Programs: A Survey Software Birthmark for Theft Detection of JavaScript Programs: A Survey
Software Birthmark for Theft Detection of JavaScript Programs: A Survey
 
The Past, Present, and Future of OpenACC
The Past, Present, and Future of OpenACCThe Past, Present, and Future of OpenACC
The Past, Present, and Future of OpenACC
 
Weather and Climate Visualization software
Weather and Climate Visualization softwareWeather and Climate Visualization software
Weather and Climate Visualization software
 
Compiler Design Using Context-Free Grammar
Compiler Design Using Context-Free GrammarCompiler Design Using Context-Free Grammar
Compiler Design Using Context-Free Grammar
 
Monitoring and Instrumentation Strategies: Tips and Best Practices - AppSphere16
Monitoring and Instrumentation Strategies: Tips and Best Practices - AppSphere16Monitoring and Instrumentation Strategies: Tips and Best Practices - AppSphere16
Monitoring and Instrumentation Strategies: Tips and Best Practices - AppSphere16
 
SE.pdf
SE.pdfSE.pdf
SE.pdf
 
Rseminarp
RseminarpRseminarp
Rseminarp
 
Slicing of Object-Oriented Programs
Slicing of Object-Oriented ProgramsSlicing of Object-Oriented Programs
Slicing of Object-Oriented Programs
 
Software system design sample
Software system design sampleSoftware system design sample
Software system design sample
 
(Costless) Software Abstractions for Parallel Architectures
(Costless) Software Abstractions for Parallel Architectures(Costless) Software Abstractions for Parallel Architectures
(Costless) Software Abstractions for Parallel Architectures
 

More from Praveen Penumathsa

DYNAMIC SLICING OF ASPECT-ORIENTED PROGRAMS
DYNAMIC SLICING OF ASPECT-ORIENTED PROGRAMSDYNAMIC SLICING OF ASPECT-ORIENTED PROGRAMS
DYNAMIC SLICING OF ASPECT-ORIENTED PROGRAMSPraveen Penumathsa
 
Generating test cases using UML Communication Diagram
Generating test cases using UML Communication Diagram Generating test cases using UML Communication Diagram
Generating test cases using UML Communication Diagram Praveen Penumathsa
 
Testing of Object-Oriented Software
Testing of Object-Oriented SoftwareTesting of Object-Oriented Software
Testing of Object-Oriented SoftwarePraveen Penumathsa
 

More from Praveen Penumathsa (7)

DYNAMIC SLICING OF ASPECT-ORIENTED PROGRAMS
DYNAMIC SLICING OF ASPECT-ORIENTED PROGRAMSDYNAMIC SLICING OF ASPECT-ORIENTED PROGRAMS
DYNAMIC SLICING OF ASPECT-ORIENTED PROGRAMS
 
Generating test cases using UML Communication Diagram
Generating test cases using UML Communication Diagram Generating test cases using UML Communication Diagram
Generating test cases using UML Communication Diagram
 
Testing of Object-Oriented Software
Testing of Object-Oriented SoftwareTesting of Object-Oriented Software
Testing of Object-Oriented Software
 
Distributed System
Distributed SystemDistributed System
Distributed System
 
Real-Time Operating Systems
Real-Time Operating SystemsReal-Time Operating Systems
Real-Time Operating Systems
 
Praveen varma fresher_resume
Praveen varma fresher_resumePraveen varma fresher_resume
Praveen varma fresher_resume
 
Untitled Presentation
Untitled PresentationUntitled Presentation
Untitled Presentation
 

DYNAMIC SLICING OF ASPECT-ORIENTED PROGRAMS

  • 1. 1 DYNAMIC SLICING OF ASPECT- ORIENTED PROGRAMS BY www.carrertime.in www.facebook.com/carrertime.in
  • 2. 2 OUTLINE • Introduction • Introduction to AspectJ - An AOP Language • Slicing of AOP • Motivation of Research • Objective of Research • Work Done • Conclusion • Future Work • References
  • 3. 3 Introduction •Finding all statements in a program that directly or indirectly affect the value of a variable occurrence is referred to as Program Slicing. •The pair <s,v> is known as Slicing Criterion where s is a program point of interest and v is a variable used or defined at s.
  • 4. 4 Categories of Slice •Backward Slice: All statements that might have affected the value of a variable at a program point •Forward Slice: All statements that might be affected by the value of a variable at a program point •Static Slice: All statements that may affect the value of a variable at a program point for all possible executions •Dynamic Slice: All statements that actually affect the value of a variable at a program point for a particular execution •Intra-Procedural Slice: Slice within a single procedure •Inter-Procedural Slice: Slice within multiple procedure
  • 5. 5 EXAMPLE 1 main( ) 2 { 3 int i, sum; 4 sum = 0; 5 i = 1; 6 while(i <= 10) 7 { 8 sum = sum + 1; 9 ++ i; 10 } 11 printf(“%d”, sum); 12 printf(“%d”, i); 13 } An Example program and its slice w.r.t. <12,i>
  • 6. 6 APPLICATIONS OF PROGRAM SLICING Debugging Testing Software Maintenance Differencing Reverse Engineering
  • 7. 7 Approaches to Slicing •Control Flow Graph (CFG) Based Data flow equations are solved •Dependence Graph Based Dependence graph is used as the intermediate program representation Slice is computed as the graph reachability problem Program Dependence Graph (PDG) Used for intra-procedural slicing Nodes represent statements Edges represent data/control dependencies System Dependence Graph (SDG) Used for inter-procedural slicing Same as PDG except that it includes vertices and edges for call statements, parameter passing and transitive dependences due to calls.
  • 8. 8 Aspect-Oriented Programming •Gregor Kiczales and his team at Xerox PARC originated the concept of Aspect Oriented Programming (AOP). •Aspect-oriented programming is a new programming technique proposed for cleanly modularizing the cross-cutting structure of concerns such as exception handling, synchronization and resource sharing. •An "aspect" is an "area of concern" that cuts across the structure of a program. •The main idea behind aspect-oriented programming (AOP) is to allow a program to be constructed by describing each concern separately.
  • 9. 9 Fundamental goal of AOP •Allow for the separation of concerns as appropriate for a host language. •Provide a mechanism for the description of concerns that crosscut other components.
  • 10. 10 AOP Vs. OOP •Similarities- AOP utilizes advantages of OOP AOP and OOP both use objects Objects combine the behavior and data of a concern into a single physical entity •Differences- handling of cross-cutting concerns OOP tries to push the scattered code for these concerns up in the inheritance tree This is often not possible and results in tangled code AOP collects scattered concerns into a single class structure
  • 11. 11 Benefits of AOP •It improves performance because the operations are more succinct •It allows programmer to spend less time rewriting the same code •Separation of Concerns AOP makes it possible to encapsulate cross-cutting concerns
  • 12. 12 Benefits of AOP (Cont.) •Simpler System Evolution Join points allow changes to programs to be incorporated simply with aspects •Reuse Aspects can often be reused in other programs with only slight modifications
  • 13. 13 AspectJ: An AOP Language •An aspect-oriented extension to the JAVA programming language •Created at Xerox PARC by Chris Maeda. •Compatible with current JAVA platform. •Compatibility includes upward compatibility platform compatibility tool compatibility programmer compatibility
  • 14. 14 Features of AspectJ •Join Points •Pointcut •Advice •Introduction/Inter-type declaration •Aspect
  • 15. 15 Motivation •Slicing techniques need to be efficient because of its use in debugging and testing •Reports on slicing of AOPs are scarce •This demands the development of efficient slicing algorithm for AOPs
  • 16. 16 Objectives •An appropriate frame-work for computing slices •Suitable intermediate representation of Aspect-oriented program •Development of suitable dynamic slicing technique
  • 18. 18 Algorithm: Trace file Based algorithm 1. Creation of execution trace file: To create an execution trace file, do the following: a) For a given input, execute the program and store each statement s in the order of execution in a file after it has been executed. b) If the program contains loops, then store each statement s inside the loop in the trace file after each time it has been executed. 2. Construction of DADG: To Construct the DADG of the aspect- oriented program P with respect to the trace file, do the following: a) For each statement s in the trace file, create a vertex in the DADG. b) For each occurrence of a statement s in the trace file, create a separate vertex.
  • 19. 19 Algorithm: Trace file Based algorithm (Cont.) c) Add all control dependence edges, data dependence edges and weaving edges to these vertices. 1. Computation of dynamic slice: To compute the dynamic slice over the DADG, do the following: a) Perform the breadth-first or depth-first graph traversal over the DADG taking any vertex corresponding to the statement of interest as the starting point of traversal. 3. Mapping of the slice: To obtain the dynamic slice of the aspect-oriented program P, do the following: a) Define a mapping function f : DSG(p, q, e, n) → P . b) Map the resulting slice obtained in step 3(a) over the DADG to the source code P using f since the slice may contain multiple occurrences of the same vertex.
  • 20. 20 Working of the Algorithm Input data: argv[0]=4. Executed statements in order: 1, 2, 3, 13, 14, 15, 4, 5, 6, 7, 8, 9, 7, 8, 9, 7, 8, 9, 7, 8, 9, 7, 16, 17, 11. Slicing criterion: < 11, p >. Breadth-first search algorithm: 11, 17, 8, 16, 7, 8, 9, 7, 13, 5, 9, 7, 8, 9, 9, 3, 2, 4, 7, 8, 9, 1, 15, 7, 6, 14. Depth-first search algorithm: 11, 8, 9, 9, 9, 4, 15, 14, 2, 1, 7, 5, 7, 7, 8, 8, 8, 6, 7, 17, 16, 13, 3, 7, 9. Map: 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 13, 14, 15, 16, 17.
  • 24. 24 Average Runtime Sl. No. Prg. Size (# stmts) Avg. Runtime(in sec.) 1 17 0.11 2 43 0.71 3 69 0.89 4 97 1.07 5 123 1.36 6 245 2.46 7 387 3.96 8 562 5.52
  • 25. 25 Conclusion •Trace file is used for storing the execution history •Separate vertices are created in the DADG for different execution of the same statement •Average run-time is more
  • 26. 26 Future Work •Modifying the algorithm to avoid the use of trace file •Handling composite data types •Handling unstructured programs •Computing dynamic slices of concurrent AOPs
  • 27. 27 REFERENCES [1] Binkley D. W. and Gallagher K. B. Program Slicing. Advances in Computers, 43, 1996. Academic Press, San Diego, CA. [2] Agarwal H. and Horgan J. R. Dynamic Program Slicing. In ACM SIGPLAN Notices, Proceedings of the ACM SIGPLAN 1990 Conference on Programming Language Design and Implementation PLDI'90, volume 25 of 6, pages 246-256, June 1990. [3] Zhao J. Dynamic Slicing of Object-Oriented Programs. Technical report, Information Processing Society of Japan, May 1998.
  • 28. 28 REFERENCES (Cont.) [4] Horowitz S., Reps T., and Binkley D. Inter-Procedural Slicing Using Dependence Graphs. ACM Transactions on Programming Languages and Systems, 12(1):26-60, January 1990. [5] Kiczales G., Irwin J., Lamping J., Loingtier J. M., Lopes C. V., Maeda C., and Mendhekar Anurag. Aspect-Oriented Programming. In Proceedings of the European Conference on Object-Oriented Programming (ECOOP), Finland, June 1997. Springer-Verlag. [6] Zhao J. Slicing Aspect-Oriented Software. In Proceedings of 10th International Workshop on Program Comprehension, pages 251-260, June 2002.
  • 29. 29 REFERENCES (Cont.) [7] Zhao J. and Rinard M. System Dependence Graph Construction for Aspect-Oriented Programs. Technical report, Laboratory for Computer Science, Massachusetts Institute of Technology, USA, March 2003. [8] Braak T. T. Extending program slicing in aspect-oriented programming with inter-type declarations. 5th TSCon IT Program, June 2006. [9] Korel B. and Laski J. Dynamic Program Slicing. Information Processing Letters, 29(3):155-163, 1988. [10] Mohapatra D. P. Dynamic Slicing of Object-Oriented Programs. PhD thesis, Indian Institute of Technology, Kharagpur, May 2005.
  • 30. 30 REFERENCES (Cont.) [11] Tip F. A Survey of Program Slicing Techniques. Journal of Programming Languages, 3(3):121-189, 1995. [12] Mohapatra D. P., Mall R., and Kumar R. Dynamic Slicing of Concurrent Object-Oriented Programs. In Proceedings of International Conference on Information Technology: Progresses and Challenges (ITPC), pages 283-290. Kathamandu, May 2003. [13] Ishio T., Kusumoto S., and Inoue K. Application of Aspect- Oriented Programming to Calculation of Program Slice. Technical report, ICSE, 2003. [14] AspectJ. www.eclipse.org/aspectj. [15] Aspect-Oriented Programming. www.wikipedia.org.