Strategies to relate the program and problem domains using code instrumentation Mario Marcelo Berón University of Minho Pedro Rangel Henriques University.

Slides:



Advertisements
Similar presentations
CROSSmeeting UM, Fev T5: Slicing Techniques Applied to OSS Pedro Rangel Henriques Daniela da Cruz Dep. de Informática/CCTC, Universidade do Minho,
Advertisements

Verification and Validation
Search in Source Code Based on Identifying Popular Fragments Eduard Kuric and Mária Bieliková Faculty of Informatics and Information.
Programming Paradigms and languages
1 Program Slicing Purvi Patel. 2 Contents Introduction What is program slicing? Principle of dependences Variants of program slicing Slicing classifications.
Automated creation of verification models for C-programs Yury Yusupov Saint-Petersburg State Polytechnic University The Second Spring Young Researchers.
L4-1-S1 UML Overview © M.E. Fayad SJSU -- CmpE Software Architectures Dr. M.E. Fayad, Professor Computer Engineering Department, Room #283I.
Software Metrics II Speaker: Jerry Gao Ph.D. San Jose State University URL: Sept., 2001.
Chapter3: Language Translation issues
Reasons to study concepts of PL
©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. slide 1 CS 125 Introduction to Computers and Object- Oriented Programming.
Programming Languages Structure
CASE Tools CIS 376 Bruce R. Maxim UM-Dearborn. Prerequisites to Software Tool Use Collection of useful tools that help in every step of building a product.
Basic Definitions Data Structures: Data Structures: A data structure is a systematic way of organizing and accessing data. Or, It’s the logical relationship.
© 2006 Pearson Addison-Wesley. All rights reserved2-1 Chapter 2 Principles of Programming & Software Engineering.
© 2004 Soar Technology, Inc.  July 14, 2015  Slide 1 Thinking… …inside the box Randolph M. Jones Commercializing Soar: Software Engineering Perspective.
Object-oriented design CS 345 September 20,2002. Unavoidable Complexity Many software systems are very complex: –Many developers –Ongoing lifespan –Large.
Chapter 2- Visual Basic Schneider1 Chapter 2 Problem Solving.
C++ fundamentals.
1CMSC 345, Version 4/04 Verification and Validation Reference: Software Engineering, Ian Sommerville, 6th edition, Chapter 19.
Basic Concepts The Unified Modeling Language (UML) SYSC System Analysis and Design.
Software Development Concepts ITEC Software Development Software Development refers to all that is involved between the conception of the desired.
Appendix 2 Automated Tools for Systems Development © 2006 ITT Educational Services Inc. SE350 System Analysis for Software Engineers: Unit 2 Slide 1.
Systems Analysis – Analyzing Requirements.  Analyzing requirement stage identifies user information needs and new systems requirements  IS dev team.
Katanosh Morovat.   This concept is a formal approach for identifying the rules that encapsulate the structure, constraint, and control of the operation.
IMPROVING PROGRAM COMPREHENSION TOOLS FOR DOMAIN-SPECIFIC LANGUAGES Supervisors: Professor Pedro Rangel Henriques Professora Maria João Varanda Pereira.
Zhonghua Qu and Ovidiu Daescu December 24, 2009 University of Texas at Dallas.
C++ Code Analysis: an Open Architecture for the Verification of Coding Rules Paolo Tonella ITC-irst, Centro per la Ricerca Scientifica e Tecnologica
TOPIC R Software Maintenance, Evolution, Program Comprehension, and Reverse Engineering SEG4110 Advanced Software Design and Reengineering.
Chapter 1 Introduction Dr. Frank Lee. 1.1 Why Study Compiler? To write more efficient code in a high-level language To provide solid foundation in parsing.
Parser-Driven Games Tool programming © Allan C. Milne Abertay University v
Hyper/J and Concern Manipulation Environment. The need for AOSD tools and development environment AOSD requires a variety of tools Life cycle – support.
Software Development Cycle What is Software? Instructions (computer programs) that when executed provide desired function and performance Data structures.
Systems Analysis and Design in a Changing World, 3rd Edition
Unit-1 Introduction Prepared by: Prof. Harish I Rathod
N from what language did C++ originate? n what’s input, output device? n what’s main memory, memory location, memory address? n what’s a program, data?
L6-S1 UML Overview 2003 SJSU -- CmpE Advanced Object-Oriented Analysis & Design Dr. M.E. Fayad, Professor Computer Engineering Department, Room #283I College.
Hassen Grati, Houari Sahraoui, Pierre Poulin DIRO, Université de Montréal Extracting Sequence Diagrams from Execution Traces using Interactive Visualization.
Computing and SE II Chapter 9: Design Methods and Design Models Er-Yu Ding Software Institute, NJU.
1. 2 Preface In the time since the 1986 edition of this book, the world of compiler design has changed significantly 3.
1 CSCD 326 Data Structures I Software Design. 2 The Software Life Cycle 1. Specification 2. Design 3. Risk Analysis 4. Verification 5. Coding 6. Testing.
Weaving a Debugging Aspect into Domain-Specific Language Grammars SAC ’05 PSC Track Santa Fe, New Mexico USA March 17, 2005 Hui Wu, Jeff Gray, Marjan Mernik,
An approach for Framework Construction and Instantiation Using Pattern Languages Rosana Teresinha Vaccare Braga Paulo Cesar Masiero ICMC-USP: Institute.
Chapter 5: Software Re-Engineering Omar Meqdadi SE 3860 Lecture 5 Department of Computer Science and Software Engineering University of Wisconsin-Platteville.
Understanding the Behavior of Java Programs Tarja Systa Software Systems Lab. Tampere Univ. Sookmyung Women’s Univ. PSLAB Choi, yoon jeong.
Gogul Balakrishnan, Radu Gruian and Thomas Reps Computer Science Dept., Univ. of Wisconsin GrammaTech, Inc. April, 2005 CodeSurfer / x86 A Platform for.
© 2006 Pearson Addison-Wesley. All rights reserved2-1 Chapter 2 Principles of Programming & Software Engineering.
© 2006 Pearson Addison-Wesley. All rights reserved 2-1 Chapter 2 Principles of Programming & Software Engineering.
1 Bogor – Software Model Checking Framework Presented by: Arpita Gandhi.
 Programming - the process of creating computer programs.
Program Comprehension for Domain-Specific Languages Maria João Varanda 1, Marjan Mernik 2, Daniela da Cruz 3, Pedro Henriques 3 1 Polytechnic Institute.
CSI 1340 Introduction to Computer Science II Chapter 1 Software Engineering Principles.
Concepts and Realization of a Diagram Editor Generator Based on Hypergraph Transformation Author: Mark Minas Presenter: Song Gu.
Design-Directed Programming Martin Rinard Daniel Jackson MIT Laboratory for Computer Science.
Lecture 21: Component-Based Software Engineering
1 The Software Development Process ► Systems analysis ► Systems design ► Implementation ► Testing ► Documentation ► Evaluation ► Maintenance.
21/1/ Analysis - Model of real-world situation - What ? System Design - Overall architecture (sub-systems) Object Design - Refinement of Design.
Object Oriented Programming and Data Abstraction Earl Huff Rowan University.
Maikel Leemans Wil M.P. van der Aalst. Process Mining in Software Systems 2 System under Study (SUS) Functional perspective Focus: User requests Functional.
Review A program is… a set of instructions that tell a computer what to do. Programs can also be called… software. Hardware refers to… the physical components.
A Single Intermediate Language That Supports Multiple Implemtntation of Exceptions Delvin Defoe Washington University in Saint Louis Department of Computer.
Principles of Programming & Software Engineering
Advanced Computer Systems
Agenda Preliminaries Motivation and Research questions Exploring GLL
Software Testing.
C++ Plus Data Structures
Software Tools and Environments
An Introduction to Visual Basic .NET and Program Design
Assembler, Compiler, Interpreter
Assembler, Compiler, Interpreter
Presentation transcript:

Strategies to relate the program and problem domains using code instrumentation Mario Marcelo Berón University of Minho Pedro Rangel Henriques University of Minho Maria João Varanda Pereira Polytechnic Institute of Bragança Roberto Uzal University of San Luis MICEI Braga – Portugal MICEI-University of Minho

Motivation In the context of PCVIA, we want to explore and implement code inspection approaches and tools for Program Comprehension activities. We will give special attention to approaches that support the mapping between behavioral and operational views of programs. We will present a code instrumentation based strategy. MICEI-University of Minho

Topics Program Comprehension: concepts and tools Program Comprehension Approach Strategy to relate different views Case Study: EAR (Un Evaluador de Algoritmos de Ruteo) Conclusion Future Work MICEI-University of Minho

Program Comprehension Software Engineering discipline which aims at understanding computer code written in a high-level programming language. Program Comprehension is useful for reuse, maintenance, reverse engineering and many other activities in the context of Software Engineering. MICEI-University of Minho Program Comprehension Concept and tools

Program Comprehension Tool A program that aims at making the understanding of a software application easier, through the presentation of different perspectives (views) of the overall system or its components. MICEI-University of Minho

A PC Tool has modules to: Extract information by parsing the source code Store and handle the information extracted Visualize all the retrieved information MICEI-University of Minho Program Comprehension Concept and tools

General purpose Eclipse SDK Visual Studio. Net Domain specific SHriMP Creole Jeliot 3 Imagix 4D Codesurfer MICEI-University of Minho Program Comprehension Concepts and tools

MICEI-University of Minho Program Comprehension Concepts and tools Views: System representations that help the user to understand the systems under analysis Interesting Views Machine (ex. Byte Code, Assembly Code) Program (ex. C code, Java code) Functions and data used in runtime Function Graph Module Graph Effect on the problem domain (behavioral)

MICEI-University of Minho Program Comprehension Concepts and tools

Topics Program Comprehension: concepts and tools Program Comprehension Approach Strategy to relate different views Case Study: EAR (Un Evaluador de Algoritmos de Ruteo) Conclusion Future Work MICEI-University of Minho

Code Inspection by Instrumentation Consists in the insertion of useful statements into the source code to get runtime (dynamic) information that allows us to follow program execution. MICEI-University of Minho

Instrumentation: Inspector Function: inserted at check points (begin and end of functions). Iteration Control Statements: inserted before inside and after cyclic statements. MICEI-University of Minho Code Inspection by Instrumentation

MICEI-University of Minho Code Inspection by Instrumentation Function Handling int f (int x, int y) { float z,k; /* more declarations*/ INPUT_INSPECTOR( “ f ” ); ……… /* actions */ OUTPUT_INSPECTOR( “ f ” ); return value; } int f (int x, int y) { float z,k; /* more declarations*/ ……… /* actions */ return value; }

MICEI-University of Minho Code Inspection by Instrumentation Function Handling for(initialization, condition, action) actions; { 1 for (initialization; condition; action) { actions; 2 } 3 } 1.push(s,numberOfTimes) 2.v=pop(s); v=v-1; push(s,v) 3.pop(s)

MICEI-University of Minho Code Inspection by Instrumentation Data Handling int a; int f (int x, int y) { float z,k; /* more declarations*/ INPUT_INSPECTOR( “ f ”,data ); ……… /* actions */ OUTPUT_INSPECTOR( “ f ”,data ); return value; } data

MICEI-University of Minho Code Inspection by Instrumentation Data Handling long int (*f([][])(int, int (float *[],int []);

Topics Program Comprehension: concept and tools Program Comprehension Approach Strategy to relate different views Case Study: EAR (Un Evaluador de Algoritmos de Ruteo) Conclusion Future Work MICEI-University of Minho

Relationship between Views MICEI-University of Minho The relationship between different levels of the architecture can be made using the information available in the information repository. The problem appear when we want to relate the Operational and Behavioral views. In this case we can use BORS.

BORS Behavioral-Operational Relation Strategy Program Output Used Functions to build the output Behavioral View Operational View ? The used functions to build the output are known but: What about each object in the problem domain? Is it possible to recover the functions used to build each object? MICEI-University of Minho

Program Output Used Functions to build the output Behavioral View Operational View ! Objects + Interface Nodes Node Functions Arcs Arc Functions Function execution tree MICEI-University of Minho BORS Behavioral-Operational Relation Strategy

1.Detect the functions related with each Problem Domain Object. 2.Build an fe-tree (Functions Execution Tree) with the used functions in runtime. 3.Explain the functions found in step 1 using the tree built in step 2. MICEI-University of Minho BORS Procedure

BORS: Step 1 Detecting the functions related with the domain objects The Grep technique allow us to get all the functions related (by name) with an object (syntactic matching). The programmer must analyze if the recovered functions are semantically related with the object under consideration. Important: This process would be easier if the system under study was implemented using Abstract Data Types. MICEI-University of Minho

BORS: Step 2 Build a fe-Tree The functions used at runtime to build the output can be obtained through source code instrumentation. Our annotation scheme inserts “inspector functions” at the beginning and at the end of each functions present in the source code. With these information we can build a tree denominated fe-Tree. MICEI-University of Minho

BORS: Step 3 Explain the functions using the fe-tree MICEI-University of Minho

Topics Program Comprehension: concept and tools Program Comprehension Approach Strategy to relate different views Case Study: EAR (Un Evaluador de Algoritmos de Ruteo) Conclusion Future Work MICEI-University of Minho

Program Comprehension Concepts and tools EAR: Integrated Environment

MICEI-University of Minho Program Comprehension Concepts and tools Function Graph of EAR

MICEI-University of Minho Program Comprehension Concepts and tools Module Graph of EAR System

MICEI-University of Minho Program Comprehension Concepts and tools Function Graph of Morelia Module

Case Study EAR: Module Graph MICEI-University of Minho

Case Study EAR: Function Graph by Module with different abstraction levels

MICEI-University of Minho Case Study EAR:BORS applied to plannar graph

Topics Program Comprehension: concept and tools Program Comprehension Approach Strategy to relate different views Case Study: EAR (Un Evaluador de Algoritmos de Ruteo) Conclusion Future Work MICEI-University of Minho

Conclusions MICEI-University of Minho The use of inspector functions (IF), weaved into the source code, allows us to capture the actual flow of the functions during execution. To control the size of the output list of functions generated by the inpection, we adopted a suitable strategy based on the weaving of iteration control statements (ICS). Both IF and ICS were inserted into the source code in a systematic instrumentation strategy that could be done automatically.

Conclusions MICEI-University of Minho With our approach we can obtain many different views of EAR, very useful to study and understand the system. Statcis: Assembly code Source code Function graph Module graph Dynamics: Runtime functions Trace to module level Trace to function level

MICEI-University of Minho Conclusions BORS is useful to relate the behavioral and operational views and to create a true aid for Program Comprehension. BORS can be totally automatized if the programming paradigm is object oriented.

Topics Program Comprehension: concept and tools Program Comprehension Approach Strategy to relate different views Case Study: EAR (Un Evaluador de Algoritmos de Ruteo) Conclusion Future Work MICEI-University of Minho

Future Work MICEI-University of Minho It is necessary to develop a more robust data structure to handle the recovered information from our instrumentation scheme. To develop strategies to decorate the algorithms output. In other words to show the behavioral-operational relation explicitly. To implement metrics to help the programmer to select the input for BORS.

MICEI-University of Minho Future Work To identify the domain objects. To assess our tool, collecting experimental indicators about its use for program understanding.

Thanks you for your attention Mario M. Berón Pedro Rangel Santos Henriques Maria João Varanda Pereira Roberto Uzal MICEI-University of Minho