Towards the better software metrics tool motivation and the first experiences Gordana Rakić Zoran Budimac.

Slides:



Advertisements
Similar presentations
ANTLR in SSP Xingzhong Xu Hong Man Aug Outline ANTLR Abstract Syntax Tree Code Equivalence (Code Re-hosting) Future Work.
Advertisements

Translator Architecture Code Generator ParserTokenizer string of characters (source code) string of tokens abstract program string of integers (object.
Compilers and Language Translation
1 Pass Compiler 1. 1.Introduction 1.1 Types of compilers 2.Stages of 1 Pass Compiler 2.1 Lexical analysis 2.2. syntactical analyzer 2.3. Code generation.
Semantic analysis Parsing only verifies that the program consists of tokens arranged in a syntactically-valid combination, we now move on to semantic analysis,
CPSC Compiler Tutorial 9 Review of Compiler.
On a Literature/Tool Review on Software Metrics Tools Gordana Rakic.
SableCC SableCC is developed by professors and graduate students at McGill University and is open source (licensed under the Apache License, Version 2.0)‏
10/22/2002© 2002 Hal Perkins & UW CSEG-1 CSE 582 – Compilers Intermediate Representations Hal Perkins Autumn 2002.
1 Semantic Processing. 2 Contents Introduction Introduction A Simple Compiler A Simple Compiler Scanning – Theory and Practice Scanning – Theory and Practice.
Abstract Syntax Trees Compiler Baojian Hua
SMIILE Finaly COBOL! and what else is new Gordana Rakić, Zoran Budimac.
1.3 Executing Programs. How is Computer Code Transformed into an Executable? Interpreters Compilers Hybrid systems.
USING SOFTWARE METRICS IN EDUCATIONAL ENVIRONMENT Ivan Pribela, Zoran Budimac, Gordana Rakić.
ANTLR with ASTs. Abstract Syntax Trees ANTLR can be instructed to produce ASTs for the output of the parser ANTLR uses a prefix notation for representing.
ANTLR.
Invitation to Computer Science 5th Edition
2.2 A Simple Syntax-Directed Translator Syntax-Directed Translation 2.4 Parsing 2.5 A Translator for Simple Expressions 2.6 Lexical Analysis.
CPSC 388 – Compiler Design and Construction Parsers – Context Free Grammars.
Getting Started with ANTLR Chapter 1. Domain Specific Languages DSLs are high-level languages designed for specific tasks DSLs include data formats, configuration.
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
Chapter 10: Compilers and Language Translation Invitation to Computer Science, Java Version, Third Edition.
CSC 338: Compiler design and implementation
Compiler Construction1 COMP Compiler Construction Lecturer: Dr. Arthur Cater Teaching Assistant:
Compiler course 1. Introduction. Outline Scope of the course Disciplines involved in it Abstract view for a compiler Front-end and back-end tasks Modules.
Concordia University Department of Computer Science and Software Engineering Click to edit Master title style COMPILER DESIGN Review Joey Paquet,
Chapter 6 Programming Languages (2) Introduction to CS 1 st Semester, 2015 Sanghyun Park.
Joey Paquet, Lecture 12 Review. Joey Paquet, Course Review Compiler architecture –Lexical analysis, syntactic analysis, semantic.
Unit-1 Introduction Prepared by: Prof. Harish I Rathod
1.5 Analysis and Synthesis of Compiler There are two parts to compilation: analysis and synthesis. The analysis part breaks up the source program into.
Parsing Lecture 5 Fri, Jan 28, Syntax Analysis The syntax of a language is described by a context-free grammar. Each grammar rule has the form A.
COP 4620 / 5625 Programming Language Translation / Compiler Writing Fall 2003 Lecture 1, 08/28/03 Prof. Roy Levow.
Abstract Syntax Trees Compiler Baojian Hua
Compiler design Lecture 1: Compiler Overview Sulaimany University 2 Oct
Chapter 1 Introduction. Chapter 1 - Introduction 2 The Goal of Chapter 1 Introduce different forms of language translators Give a high level overview.
1. 2 Preface In the time since the 1986 edition of this book, the world of compiler design has changed significantly 3.
CS 460/660 Compiler Construction. Class 01 2 Why Study Compilers? Compilers are important – –Responsible for many aspects of system performance Compilers.
Comp 311 Principles of Programming Languages Lecture 3 Parsing Corky Cartwright August 28, 2009.
Overview of Previous Lesson(s) Over View  A program must be translated into a form in which it can be executed by a computer.  The software systems.
1 Compiler Design (40-414)  Main Text Book: Compilers: Principles, Techniques & Tools, 2 nd ed., Aho, Lam, Sethi, and Ullman, 2007  Evaluation:  Midterm.
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,
. n COMPILERS n n AND n n INTERPRETERS. -Compilers nA compiler is a program thatt reads a program written in one language - the source language- and translates.
Gordana Rakić, Zoran Budimac
Compiler Design Introduction 1. 2 Course Outline Introduction to Compiling Lexical Analysis Syntax Analysis –Context Free Grammars –Top-Down Parsing –Bottom-Up.
INTRODUCTION TO COMPILERS(cond….) Prepared By: Mayank Varshney(04CS3019)
Compiler Introduction 1 Kavita Patel. Outlines 2  1.1 What Do Compilers Do?  1.2 The Structure of a Compiler  1.3 Compilation Process  1.4 Phases.
Compiler Construction By: Muhammad Nadeem Edited By: M. Bilal Qureshi.
SSQSA present and future Gordana Rakić, Zoran Budimac Department of Mathematics and Informatics Faculty of Sciences University of Novi Sad
1 Compiler & its Phases Krishan Kumar Asstt. Prof. (CSE) BPRCE, Gohana.
What am I? while b != 0 if a > b a := a − b else b := b − a return a AST == Abstract Syntax Tree.
PZ03BX Programming Language design and Implementation -4th Edition Copyright©Prentice Hall, PZ03BX –Recursive descent parsing Programming Language.
C H A P T E R T W O Linking Syntax And Semantics Programming Languages – Principles and Paradigms by Allen Tucker, Robert Noonan.
A Framework for Developing Compiler-like Components Jackline Ssanyu ( Software Engineering and Technology Group) Eindhoven University of Technology Supervisors:
Dr. Mohamed Ramadan Saady 314ALL CH1.1 Chapter 1: Introduction to Compiling.
CSC 4181 Compiler Construction
LECTURE 3 Compiler Phases. COMPILER PHASES Compilation of a program proceeds through a fixed series of phases.  Each phase uses an (intermediate) form.
ICS312 Introduction to Compilers Set 23. What is a Compiler? A compiler is software (a program) that translates a high-level programming language to machine.
MiniJava Compiler A multi-back-end JIT compiler of Java.
Comp 411 Principles of Programming Languages Lecture 3 Parsing
Compiler Design (40-414) Main Text Book:
PRINCIPLES OF COMPILER DESIGN
Introduction to Compiler Construction
A Simple Syntax-Directed Translator
Constructing Precedence Table
PROGRAMMING LANGUAGES
-by Nisarg Vasavada (Compiled*)
Compiler Lecture 1 CS510.
Intermediate Representations Hal Perkins Autumn 2005
Chapter 10: Compilers and Language Translation
Presentation transcript:

Towards the better software metrics tool motivation and the first experiences Gordana Rakić Zoran Budimac

Contents Motivation Objective Starting ideas for gain the objective Preparation phase Future work

Motivation Systematic application of software metrics techniques can significantly improve the quality of a software product Although software metrics seems to be well-understood area of research and application, there are still a lot of open problems

Motivation The most important weaknesses of current techniques and tools:  Many techniques and tools are appropriate for only one programming language or one type of programming languages  Support of object-oriented metrics is still weak  Many techniques/tools compute numerical results with no real interpretation of their meanings  There also no hints and advices what typical actions should be taken in order to improve the software  The technique/tool should discourage cheating  Current techniques/tools are not sensitive to the existence of additional code  Sometimes is not clear which specific software metric have to be applied to accomplish the specific goal.

Contents Motivation Objective Starting ideas for gain the objective Preparation phase Future work

Objective To produce software metrics tool which  Will be applicable to “any” programming language  Will be able to count “any” metric (even OO) or even combine metrics in order to gain higher measure quality  Will interpret the meaning of computed numerical results  Will also provide suggestion what typical actions should be taken in order to improve the software quality  Will discourage cheating  Will be sensitive to the existence of additional code

Contents Motivation Objective Starting ideas for gain the objective Preparation phase Future work

Starting ideas for gain the objective

Goal gaining strategy(1) Determine appropriate tree form  great field for research  Idea is to Investigate by comparable analysis of  application of different metrics on one language  application of one metric on different languages Join all results and construct suitable tree structure

Goal gaining strategy(2) Generate appropriate tree structure  External tool should generate XML representation of tree (and source code, too)  In XML manipulation it may be needed to enrich tree possibly by passing again through source code

Goal gaining strategy(3) Apply different algorithms…  Another great field for research containing Software metrics and their combinations Cheating and additional code recognizer Heuristics …to generated tree structure in intention to  Gain as precise measure as possible  Provide useful information to user

External tool example – ANTLR(1) “a sophisticated parser generator you can use to implement language interpreters, compilers, and other translators” [1] Tool input: (language) grammar Tool output: (language) lexer and parser Interpreter interprets corresponding source code

External tool example – ANTLR(2) The lexical analyzer (lexer) breaks up the input stream into tokens. The parser feeds off this token stream and tries to recognize the sentence structure Abstract Syntax Tree (AST) is intermediate structure

ANTLR and tree structures Parse Tree (Concrete Syntax Tree) - represents the sequence of rule invocations used to match an input stream (Abstract) Abstract Syntax Tree - represents language in abstract form (Concrete) Abstract Syntax Tree - represents concrete source code  contains only those nodes associated with input symbols and are, therefore, not parse trees

Parse Tree ws. (Concrete) AST

Contents Motivation Objective Starting ideas for gain the objective Preparation phase Future work

Preparation phase We are here now  Investigation of alternative external tools This includes comparable analysis of the so generated trees and their representation  Investigation of appropriate tree structure This includes a prior investigation of algorithms

Contents Motivation Objective Starting ideas for gain the objective Preparation phase Future work

Future work Investigation of alternative external tools Investigation of appropriate tree structure Real job