Well-defined coverage metrics for the glass box test

Size: px
Start display at page:

Download "Well-defined coverage metrics for the glass box test"

Transcription

1 Well-defined coverage metrics for the glass box test Rainer Schmidberger ISTE (Institute for Software Technology), University of Stuttgart se

2 Well-defined coverage metrics for the glass box test Agenda: Background and motivation Overview of today s glass box test A closer look at the underlying models and metrics Requirements for a GBT model My approach: A new and precise model for the GBT The Reduced Program Representation (RPR) RPR execution semantics using Petri nets RPR based metric definition The tool CodeCover Overview Test case selective GBT GBT tool support for test case development Conclusion se Well-defined coverage metrics for the glass box test Slide 2 / 22

3 Glass box test (1) The glass box test (GBT), also known as white box test or structural test, shows which parts of the program under test have, or have not, been executed. This degree of execution is called coverage. green: executed at least by one of the test cases red: not executed yellow: partly executed GBT-results can be used as test completion criterion or as an input for developing test cases. se Well-defined coverage metrics for the glass box test Slide 3 / 22

4 Glass box test (2) Tools are required, and many GBT tools are available for almost any programming language. Coverage Report: Empirical studies clearly indicate that higher GBT coverage correlates with lower post-release defect density. Standards for safety critical-software require a very high, or even complete coverage (e.g. IEC 61508, DO-178B). So at first glance, the GBT seems to be a wellestablished and mature testing technique se Well-defined coverage metrics for the glass box test Slide 4 / 22

5 A closer look at the underlying models.. Typically the control flow graph (CFG) is used to build an abstraction model of the original program code. Most popular GBT metrics are defined with respect to the CFG. But the transformation of the real programs into the CFG is ambiguous: Program code void foo() { if(a) { stmt1; while(b) { stmt2; } } } stmt1 while(b) stmt2 Entry if(a) se Well-defined coverage metrics for the glass box test Slide 5 / 22 Exit CFG Are the entry and exit nodes part of the CFG? Does the while statement have a distinct end node? Does the if statement have a distinct end node?

6 and metrics And even more severe are the missing representation for exception handling, conditional expressions and the short circuit operations of Boolean expressions. GBT tools show different coverage results for the same execution of a given 45-statement reference Java program CodeCover Version: Clover Version: Emma Version: v EclEmma Version: ecobertura Version: CodePro Version: Rational Application Developer V ,8 % 58,5 % Statementcoverage Branch-/Blockcoverage Branch: 50,0 % Block: 52,2 % Line: 62,0 % Block: 54,0 % Instruction: 56,7 % Line: 63,6 % Instruction: 57,7 % Line: 58,5 % Block: 50,0 % 64,3 % Branch: 50,0 % Line: 67,0 % Block: 60,6 % A (new) reference model for the GBT is required! se Well-defined coverage metrics for the glass box test Slide 6 / 22

7 Requirements for a new model for the GBT The model forms the basis on which the popular control-flow based metrics as well as the logic and conditional expression based metrics can be defined. The model supports exception handling. There is an easy and precise transformation rule to transform real programs into the model. The model does not depend on any particular programming language. An algorithm implemented in different programming languages should have the same model representation. The model specifies how to place the probes in the program under test that count the execution of the relevant GBT items. se Well-defined coverage metrics for the glass box test Slide 7 / 22

8 A new and precise model for the GBT 1. Definition of a primitive language RPR(Reduced Program Representation) which abstracts the GBTrelevant aspects of the real programming languages. 2. Definition of the execution semantics using Petri nets. The nets will also include the execution counters that measure the execution of a particular item. 3. On this basis: Precise definition of the popular GBT-metrics. Statement = PrimitiveStatement IfStatement IfStatement = "if" "(" BoolExpression ")" "then" StatementBlock "else" StatementBlock. BoolExpression = Condition CompoundExpression. A exestmts (P, T) t T : exe(a, t) exestmts(p, T) stmtcov(p, T) = stmts(p) se Well-defined coverage metrics for the glass box test Slide 8 / 22 t Normal s CN s CIn t ENormal s N s In t In s E t EAbrupt Exit area Entry area Execution area t Abrupt s CA s A exe(a, t) M(s CN ) > 0

9 1. The model language RPR Control flow RPR Grammer (control flow) Program = StatementBlock. StatementBlock = ID "{" StatementList "}". StatementList = Statement ( StatementList empty ). Statement = ID ( PrimitiveStatement TerminateStatement WhileStatement IfStatement SwitchStatement TryStatement ) SubExpressions. PrimitiveStatement = "stmt". TerminateStatement = "throw" "return" "break" "continue". IfStatement = "if" "(" BoolExpression ")" "then" StatementBlock "else" StatementBlock. WhileStatement = "while" "(" BoolExpression ")" StatementBlock. Example: Java System.out.print( GBT"); x1 = ((b*(-1) + Math.sqrt(D))/(2*a)); if(n > 20) { n++; return; } while (x > 0) field[x] = x--; RPR S1 stmt [] S2 stmt [] S3 if(... ) then B2 { S4 stmt [] S5 return [] } else B3 { } [] S6 while(... ) B4 { S7 stmt [] } [] The GBT items are attributed with a unique identifier. This ID is necessary to manage coverage information, but is not part of the original code. se Well-defined coverage metrics for the glass box test

10 1. The model language RPR Expressions RPR Grammer (expressions) Expression = BoolExpression ConditionalExpression. BoolExpression = ID ( Condition CompoundExpression ). Condition = "expr" SubExpressions. CompoundExpression = ( "andthen" "orelse" "and" "or" ) "(" BoolExpression "," BoolExpression ")". ConditionalExpression = ID BoolExpression "?" SubExpressions ":" SubExpressions. SubExpressions = "[" ExpressionList "]". Example: Java A && B f(a B) A = B? 7 : 42; RPR E1 andthen( E2 expr [], E3 expr [] ) E1 expr [ E2 or( E3 expr [], E4 expr []); ] S1 stmt [ E1 E2 expr []? [] : []; ] ExpressionList = Expression ";" ExpressionList empty. RPR defines all GBT-relevant aspects of the real programming languages. se Well-defined coverage metrics for the glass box test

11 2. GBT model nets primitive items Primitive GBT items such as a primitive statement or a primitive Boolean expression were described as a place-bordered petri (sub)net called GBT model net. The model nets have exactly one distinct input place and one or more distinct output places for normal and abrupt completion. Places with empty post-set count the GBT items execution. The initial marking is exactly one token in the input place. And there are only final markings with exactly one token in one of the output places. Because all model nets are a place-bordered and token-preserving they can be abstracted into sub nets or super places. s CIn t ENormal t Normal s CN s In s N s N s In t In s E Statement s A t EAbrupt Exit area s S Entry area Execution area t Abrupt s CA s A Statement PrimitiveStatement se Well-defined coverage metrics for the glass box test Slide 11 / 22

12 2. GBT model nets primitive items Primitive GBT items such as a Input place primitive statement or a primitive Boolean expression were described as a place-bordered petri (sub)net called GBT model net. The model nets have exactly one distinct input place and one or more distinct output places for normal and abrupt completion. Places with empty post-set count the GBT items execution. The initial marking is exactly one token in the input place. And there are only final markings with exactly one token in one of s CIn t ENormal t Normal s CN s In s N s N s In t In s E Statement s A t EAbrupt Exit area s S Entry area Execution area t Abrupt s CA s A Statement PrimitiveStatement the output places. Output places Because all model nets are a place-bordered and token-preserving they can be abstracted into sub nets or super places. se Well-defined coverage metrics for the glass box test Slide 12 / 22

13 2. GBT model nets complex items The complex GBT items such as if statements or compound Boolean expressions contain other GBT items as part of their own structure. They are described as a composition of model nets. RPR provides the composition rules. This embedding technique automatically provides a dominance relationship between the GBT items. The sub net of an Boolean expression BoolExpression StatementBlock [then-block] s In B 1 s N StatementBlock [else-block] s CIn C s CN sa s T s In B 2 s N t Normal s In t In s In s F s N s A s A Entry area t Abrupt Exit area The sub nets of statement blocks Execution area IfStatement s A s CA A = ddom(b) A ddom B the model net of B is (directly ) embedded in the model net of A se Well-defined coverage metrics for the glass box test Slide 13 / 22

14 3. GBT metric definition Statement coverage: P is a RPR program, stmts(p) is the set of all GBT items corresponding to the RPR statement production. T is a set of test cases. A exestmts (P, T) A stmts(p) t T : exe(a, t) stmtcov(p, T) = exstmts(p, T) stmts(p) se Well-defined coverage metrics for the glass box test Slide 14 / 22

15 3. GBT metric definition Statement coverage: P is a RPR program, stmts(p) is the set of all GBT items corresponding Additional to the GBT RPR Metrics: statement production. T is a set of test cases. Branch coverage The degree of executed branches A exestmts Block (P, T) coverage A stmts(p) t T : exe(a, t) The degree of executed statement blocks Decision exstmts(p, coverage T) stmtcov(p, T) = Like Branch stmts(p) coverage, but forking expressions are also taken into account Loop coverage, Term coverage and MC/DC se Well-defined coverage metrics for the glass box test Slide 15 / 22

16 The tool CodeCover CodeCover Perspective Coverage visualization Coverage visualization and coverage report are based on the selected test cases only. Coverage report se Well-defined coverage metrics for the glass box test Slide 16 / 22

17 The tool CodeCover CodeCover Perspective Coverage visualization and coverage report are based on the selected test cases only. CodeCover key features: Has frontends for Java, C and Coverage COBOL visualization Is a reference implementation for the described GBT metrics Is Eclipse integrated and provides Ant interfaces Supports the test case selective GBT Eclipse Public Licence (EPL) Coverage report se Well-defined coverage metrics for the glass box test Slide 17 / 22

18 Test case selective GBT The test case selective GBT provides evaluations not only for the entire test suite but also for a single test case. It can be used for example for selective regression testing or test case development. Test suite PUT with CodeCoverenhancements GBT log-file Test case ID 4711 Name Precondition Action, Inputs Expected Result Print invoice Customer is selected Justus justus.tigris.org JMX- Interface Init Store double gettotal(customer sustomer, double b) { } // normal customer: no discount double discount = 0.0; if(customer.getrevenue() > 2000) { // All major customers get 10% discount discount = 0.1; if(customer.iscommercial()) { // commercial customers have add. 5% discount += 0.05; } } double total = b * (1.0 - discount); return total; Counter values for test case 4711 S1 3 S2 3 B1 1 se Well-defined coverage metrics for the glass box test Slide 18 / 22

19 Developing new test cases basic concept Tool-based support for the tester: Developing new input data for test cases that increase coverage. How can I find input values in order to execute this part of the program? Idea: Use the test cases as starting point that execute the dominator of the test target! double gettotal(customer customer, double b) { } // normal customer: no discount double discount = 0.0; if(customer.getrevenue() > 2000) { // All major customers get 10% discount discount = 0.1; if(customer.iscommercial()) { // commercial customers have add. 5% discount += 0.05; } } double total = b * (1.0 - discount); return total; The dominator of the test target The test target se Well-defined coverage metrics for the glass box test Slide 19 / 22

20 Developing new test cases - definitions P is a RPR program, A P is a GBT item the test target, T is a set of test cases for P, and t T a test case. t testcases(a) t T exe(a, t) Select all GBT items A with testcases(a) = 0 testcases(ddom(a)) > 0 - all not executed GBT items with an executed direct dominator - and put them into a list: GBT item A ddom(a) testcases(ddom(a)) Each entry in this list is called test case recommandation and provides systematical support for the tester to develop new test cases that increases coverage. se Well-defined coverage metrics for the glass box test Slide 20 / 22

21 CodeCovers RecommendationsView se Well-defined coverage metrics for the glass box test Slide 21 / 22

22 Conclusion To date, most GBT metrics are defined either intuitively or based on the CFG. But both definitions have severe shortcomings. In the approach described, the popular GBT metrics are precisely defined by using the following model: A notation (RPR) which is applicable to a large class of programming languages. In RPR control flow, expressions and exception handling are well integrated. Model nets that describe the execution semantics of the GBT items in a mathematical sound way. The model net s counters provide a precise specification for the code instrumentation. The model net also provides a dominance relationship between the GBT items. The tool CodeCover is a reference implementation of the presented metrics, and offers a tool based technique that supports the tester in developing new test cases. se Well-defined coverage metrics for the glass box test Slide 22 / 22

Well-defined Coverage Metrics for the Glass Box Test

Well-defined Coverage Metrics for the Glass Box Test Well-defined Coverage Metrics for the Glass Box Test Rainer Schmidberger ISTE (Institute for Software Technology), Stuttgart University, Germany rainer.schmidberger@informatik.uni-stuttgart.de Abstract.

More information

Glass Box Testing for Test Suite- Optimization

Glass Box Testing for Test Suite- Optimization Testmethoden für Software Von der Forschung in die Prais 2008, Rainer Schmidberger Rainer Schmidberger Universität Stuttgart, Institut für Softwaretechnologie Glass Bo Testing for Test Suite- Optimization

More information

MTAT : Software Testing

MTAT : Software Testing MTAT.03.159: Software Testing Lecture 03: White-Box Testing (Textbook Ch. 5) Dietmar Pfahl Spring 2017 email: dietmar.pfahl@ut.ee Lecture Chapter 5 White-box testing techniques (Lab 3) Structure of Lecture

More information

Testing Methods: White Box Testing II

Testing Methods: White Box Testing II Testing Methods: White Box Testing II Outline Today we continue our look at white box testing with more code coverage methods, and a data coverage method We ll look at : - code coverage testing - decision

More information

Program Testing and Analysis: Manual Testing Prof. Dr. Michael Pradel Software Lab, TU Darmstadt

Program Testing and Analysis: Manual Testing Prof. Dr. Michael Pradel Software Lab, TU Darmstadt Program Testing and Analysis: Manual Testing Prof. Dr. Michael Pradel Software Lab, TU Darmstadt Partly based on slides from Peter Müller, ETH Zurich 1 Warm-up Quiz What does the following code print?

More information

INTRODUCTION TO SOFTWARE ENGINEERING

INTRODUCTION TO SOFTWARE ENGINEERING INTRODUCTION TO SOFTWARE ENGINEERING Structural Testing d_sinnig@cs.concordia.ca Department for Computer Science and Software Engineering Introduction Testing is simple all a tester needs to do is find

More information

6.001 Notes: Section 8.1

6.001 Notes: Section 8.1 6.001 Notes: Section 8.1 Slide 8.1.1 In this lecture we are going to introduce a new data type, specifically to deal with symbols. This may sound a bit odd, but if you step back, you may realize that everything

More information

Lexical Considerations

Lexical Considerations Massachusetts Institute of Technology Department of Electrical Engineering and Computer Science 6.035, Fall 2005 Handout 6 Decaf Language Wednesday, September 7 The project for the course is to write a

More information

MTAT : Software Testing

MTAT : Software Testing MTAT.03.159: Software Testing Lecture 03: White-Box Testing (Textbook Ch. 5) Dietmar Pfahl Spring 2016 email: dietmar.pfahl@ut.ee Lecture Chapter 5 White-box testing techniques (Lab 3) Structure of Lecture

More information

Fachgebiet Softwaretechnik, Heinz Nixdorf Institut, Universität Paderborn. 4. Testing

Fachgebiet Softwaretechnik, Heinz Nixdorf Institut, Universität Paderborn. 4. Testing 4. vs. Model Checking (usually) means checking the correctness of source code Model Checking means verifying the properties of a model given in some formal (not program code) notation Attention: things

More information

MTAT : Software Testing

MTAT : Software Testing MTAT.03.159: Software Testing Lecture 02: Basic Black-Box and White-Box Testing Techniques (Textbook Ch. 4 & 5) Spring 2018 Dietmar Pfahl email: dietmar.pfahl@ut.ee Structure of Lecture 2 Black-Box vs.

More information

MONIKA HEINER.

MONIKA HEINER. LESSON 1 testing, intro 1 / 25 SOFTWARE TESTING - STATE OF THE ART, METHODS, AND LIMITATIONS MONIKA HEINER monika.heiner@b-tu.de http://www.informatik.tu-cottbus.de PRELIMINARIES testing, intro 2 / 25

More information

Defining Program Syntax. Chapter Two Modern Programming Languages, 2nd ed. 1

Defining Program Syntax. Chapter Two Modern Programming Languages, 2nd ed. 1 Defining Program Syntax Chapter Two Modern Programming Languages, 2nd ed. 1 Syntax And Semantics Programming language syntax: how programs look, their form and structure Syntax is defined using a kind

More information

Exercise 1: Balanced Parentheses

Exercise 1: Balanced Parentheses Exercise 1: Balanced Parentheses Show that the following balanced parentheses grammar is ambiguous (by finding two parse trees for some input sequence) and find unambiguous grammar for the same language.

More information

Software Engineering

Software Engineering Software Engineering Lecture 12: Testing and Debugging Debugging Peter Thiemann University of Freiburg, Germany 13.06.2013 Today s Topic Last Lecture Bug tracking Program control Design for Debugging Input

More information

Second assignment came out Monday evening. Find defects in Hnefetafl rules written by your classmates. Topic: Code Inspection and Testing

Second assignment came out Monday evening. Find defects in Hnefetafl rules written by your classmates. Topic: Code Inspection and Testing Announcements Second assignment came out Monday evening Topic: Code Inspection and Testing Find defects in Hnefetafl rules written by your classmates Compare inspection, coverage testing, random testing,

More information

Subject Software Testing Structural Testing

Subject Software Testing Structural Testing Subject Software Testing Structural Testing Objective: 1. Understand Concept of structural testing 2. How structural (code-based or glass-box) testing complements functional (black-box) testing 3. Recognize

More information

1 Lexical Considerations

1 Lexical Considerations Massachusetts Institute of Technology Department of Electrical Engineering and Computer Science 6.035, Spring 2013 Handout Decaf Language Thursday, Feb 7 The project for the course is to write a compiler

More information

Software Engineering

Software Engineering Software Engineering Lecture 16: Testing and Debugging Debugging Peter Thiemann University of Freiburg, Germany SS 2014 Today s Topic This Lecture Execution observation Tracking causes and effects Central

More information

This book is licensed under a Creative Commons Attribution 3.0 License

This book is licensed under a Creative Commons Attribution 3.0 License 6. Syntax Learning objectives: syntax and semantics syntax diagrams and EBNF describe context-free grammars terminal and nonterminal symbols productions definition of EBNF by itself parse tree grammars

More information

Software Testing Prof. Rajib Mall Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur. Lecture 13 Path Testing

Software Testing Prof. Rajib Mall Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur. Lecture 13 Path Testing Software Testing Prof. Rajib Mall Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur Lecture 13 Path Testing Welcome to this session and we will discuss about path

More information

An Introduction to Systematic Software Testing. Robert France CSU

An Introduction to Systematic Software Testing. Robert France CSU An Introduction to Systematic Software Testing Robert France CSU Why do we need to systematically test software? Poor quality products can Inconvenience direct and indirect users Result in severe financial

More information

Stacks Fall 2018 Margaret Reid-Miller

Stacks Fall 2018 Margaret Reid-Miller Stacks 15-121 Fall 2018 Margaret Reid-Miller Today Exam 2 is next Tuesday, October 30 Today: Quiz 5 solutions Recursive add from last week (see SinglyLinkedListR.java) Stacks ADT (Queues on Thursday) ArrayStack

More information

Structural Testing & Mutation

Structural Testing & Mutation Structural Testing & Mutation Filippo Ricca DISI, Università di Genova, Italy ricca@disi.unige.it 1 White vs. Black box testing A white box testing is based upon explicit knowledge of the SUT and its structure

More information

CS 520 Theory and Practice of Software Engineering Fall 2018

CS 520 Theory and Practice of Software Engineering Fall 2018 Today CS 52 Theory and Practice of Software Engineering Fall 218 Software testing October 11, 218 Introduction to software testing Blackbox vs. whitebox testing Unit testing (vs. integration vs. system

More information

Lexical Considerations

Lexical Considerations Massachusetts Institute of Technology Department of Electrical Engineering and Computer Science 6.035, Spring 2010 Handout Decaf Language Tuesday, Feb 2 The project for the course is to write a compiler

More information

Introduction to Denotational Semantics

Introduction to Denotational Semantics Introduction to Denotational Semantics Overview:! Syntax and Semantics! Approaches to Specifying Semantics! Sets, Semantic Domains, Domain Algebra, and Valuation Functions! Semantics of Expressions! Semantics

More information

Formal Approach in Software Testing

Formal Approach in Software Testing Formal Approach in Software Testing #Abhishek Dixit, #Shivani Goel 1 csed, TIET biodatadixit@yahoo.co.in 2 csed, TIET shivani@tiet.ac.in Abstract Testing is an important activity for checking the correctness

More information

Software Testing Prof. Meenakshi D Souza Department of Computer Science and Engineering International Institute of Information Technology, Bangalore

Software Testing Prof. Meenakshi D Souza Department of Computer Science and Engineering International Institute of Information Technology, Bangalore Software Testing Prof. Meenakshi D Souza Department of Computer Science and Engineering International Institute of Information Technology, Bangalore Lecture 04 Software Test Automation: JUnit as an example

More information

Parsing II Top-down parsing. Comp 412

Parsing II Top-down parsing. Comp 412 COMP 412 FALL 2018 Parsing II Top-down parsing Comp 412 source code IR Front End Optimizer Back End IR target code Copyright 2018, Keith D. Cooper & Linda Torczon, all rights reserved. Students enrolled

More information

EECS 481 Software Engineering Exam #1. You have 1 hour and 20 minutes to work on the exam.

EECS 481 Software Engineering Exam #1. You have 1 hour and 20 minutes to work on the exam. EECS 481 Software Engineering Exam #1 Write your name and UM uniqname on the exam. There are ten (10) pages in this exam (including this one) and seven (7) questions, each with multiple parts. Some questions

More information

Data Flow Analysis. Agenda CS738: Advanced Compiler Optimizations. 3-address Code Format. Assumptions

Data Flow Analysis. Agenda CS738: Advanced Compiler Optimizations. 3-address Code Format. Assumptions Agenda CS738: Advanced Compiler Optimizations Data Flow Analysis Amey Karkare karkare@cse.iitk.ac.in http://www.cse.iitk.ac.in/~karkare/cs738 Department of CSE, IIT Kanpur Static analysis and compile-time

More information

Abstract Syntax Tree Generation using Modified Grammar for Source Code Plagiarism Detection

Abstract Syntax Tree Generation using Modified Grammar for Source Code Plagiarism Detection Abstract Syntax Tree Generation using Modified Grammar for Source Code Plagiarism Detection 1 Resmi N.G., 2 Soman K.P. 1 CEN, Amrita Vishwa Vidyapeetham, Coimbatore, Tamilnadu, India 2 CEN, Amrita Vishwa

More information

Static Slicing. Software Maintenance

Static Slicing. Software Maintenance soma@ist.tugraz.at 1 Outline Basics Control flow graphs Slicing Motivation Static slicing with relevant variables table Static slicing with program dependency graphs Summary & Outline 2 Outline Basics

More information

Lecture 21. Regression Testing Path Spectra. EE 382V Spring 2009 Software Evolution - Instructor Miryung Kim

Lecture 21. Regression Testing Path Spectra. EE 382V Spring 2009 Software Evolution - Instructor Miryung Kim Lecture 21 Regression Testing Path Spectra Today s Agenda (1) Regression Test Selection Path Spectra Presentation by David (skeptic) Presentation by Sidd (advocate) Presentation by Srinivas (skeptic) Today

More information

The Future of Code Coverage for Eclipse

The Future of Code Coverage for Eclipse Marc R. Hoffmann EclipseCon 2010 2010-03-25 2010 by Marc R. Hoffmann made available under the EPL v1.0 2010-03-25 Outline Code Coverage EclEmma EMMA JaCoCo Sorry, no robots Code Coverage Legacy Code is

More information

CSE115 / CSE503 Introduction to Computer Science I. Dr. Carl Alphonce 343 Davis Hall Office hours:

CSE115 / CSE503 Introduction to Computer Science I. Dr. Carl Alphonce 343 Davis Hall Office hours: CSE115 / CSE503 Introduction to Computer Science I Dr. Carl Alphonce 343 Davis Hall alphonce@buffalo.edu Office hours: Thursday 12:00 PM 2:00 PM Friday 8:30 AM 10:30 AM OR request appointment via e-mail

More information

Testing & Symbolic Execution

Testing & Symbolic Execution Testing & Symbolic Execution Software Testing The most common way of measuring & ensuring correctness Input 2 Software Testing The most common way of measuring & ensuring correctness Input Observed Behavior

More information

C07: Testing and JUnit

C07: Testing and JUnit CISC 3120 C07: Testing and JUnit Hui Chen Department of Computer & Information Science CUNY Brooklyn College 9/19/2017 CUNY Brooklyn College 1 Outline Recap and issues Grades and feedback Assignments &

More information

Overview Graph Coverage Criteria

Overview Graph Coverage Criteria Overview Graph Coverage Criteria Graph Coverage Four Structures for Modeling Software Graphs Logic Input Space Syntax Applied to Applied to Source FSMs Applied to Specs DNF Source Specs Source Models Design

More information

Introduction to Parsing

Introduction to Parsing Introduction to Parsing The Front End Source code Scanner tokens Parser IR Errors Parser Checks the stream of words and their parts of speech (produced by the scanner) for grammatical correctness Determines

More information

Agile Software Development. Lecture 7: Software Testing

Agile Software Development. Lecture 7: Software Testing Agile Software Development Lecture 7: Software Testing Mahmoud El-Gayyar elgayyar@ci.suez.edu.eg Slides are a modified version of the slides by Prof. Kenneth M. Anderson Outline Testing Terminology Types

More information

Software Engineering Testing and Debugging Debugging

Software Engineering Testing and Debugging Debugging Software Engineering Testing and Debugging Debugging Prof. Dr. Peter Thiemann Universität Freiburg 13.07.2009 Today s Topic Last Lecture Bug tracking Program control Design for Debugging Input simplification

More information

Today s Topic. Software Engineering Testing and Debugging Debugging. Today s Topic. The Main Steps in Systematic Debugging

Today s Topic. Software Engineering Testing and Debugging Debugging. Today s Topic. The Main Steps in Systematic Debugging Today s Topic Software Engineering Testing and Debugging Debugging Prof. Dr. Peter Thiemann Last Lecture Bug tracking Program control Design for Debugging Input simplification Universität Freiburg 22.06.2011

More information

Selections. EECS1021: Object Oriented Programming: from Sensors to Actuators Winter 2019 CHEN-WEI WANG

Selections. EECS1021: Object Oriented Programming: from Sensors to Actuators Winter 2019 CHEN-WEI WANG Selections EECS1021: Object Oriented Programming: from Sensors to Actuators Winter 2019 CHEN-WEI WANG Learning Outcomes The Boolean Data Type if Statement Compound vs. Primitive Statement Common Errors

More information

Summer 2017 Discussion 10: July 25, Introduction. 2 Primitives and Define

Summer 2017 Discussion 10: July 25, Introduction. 2 Primitives and Define CS 6A Scheme Summer 207 Discussion 0: July 25, 207 Introduction In the next part of the course, we will be working with the Scheme programming language. In addition to learning how to write Scheme programs,

More information

Defining syntax using CFGs

Defining syntax using CFGs Defining syntax using CFGs Roadmap Last time Defined context-free grammar This time CFGs for specifying a language s syntax Language membership List grammars Resolving ambiguity CFG Review G = (N,Σ,P,S)

More information

Syntax. A. Bellaachia Page: 1

Syntax. A. Bellaachia Page: 1 Syntax 1. Objectives & Definitions... 2 2. Definitions... 3 3. Lexical Rules... 4 4. BNF: Formal Syntactic rules... 6 5. Syntax Diagrams... 9 6. EBNF: Extended BNF... 10 7. Example:... 11 8. BNF Statement

More information

IPCoreL. Phillip Duane Douglas, Jr. 11/3/2010

IPCoreL. Phillip Duane Douglas, Jr. 11/3/2010 IPCoreL Programming Language Reference Manual Phillip Duane Douglas, Jr. 11/3/2010 The IPCoreL Programming Language Reference Manual provides concise information about the grammar, syntax, semantics, and

More information

Testing, Fuzzing, & Symbolic Execution

Testing, Fuzzing, & Symbolic Execution Testing, Fuzzing, & Symbolic Execution Software Testing The most common way of measuring & ensuring correctness Input 2 Software Testing The most common way of measuring & ensuring correctness Input Observed

More information

CSE 230 Computer Science II (Data Structure) Introduction

CSE 230 Computer Science II (Data Structure) Introduction CSE 230 Computer Science II (Data Structure) Introduction Fall 2017 Stony Brook University Instructor: Shebuti Rayana Basic Terminologies Data types Data structure Phases of S/W development Specification

More information

Introduction. Compiler Design CSE Overview. 2 Syntax-Directed Translation. 3 Phases of Translation

Introduction. Compiler Design CSE Overview. 2 Syntax-Directed Translation. 3 Phases of Translation Introduction Compiler Design CSE 504 1 Overview 2 Syntax-Directed Translation 3 Phases of Translation Last modifled: Mon Jan 25 2016 at 00:15:02 EST Version: 1.5 23:45:54 2013/01/28 Compiled at 12:59 on

More information

Part I: Preliminaries 24

Part I: Preliminaries 24 Contents Preface......................................... 15 Acknowledgements................................... 22 Part I: Preliminaries 24 1. Basics of Software Testing 25 1.1. Humans, errors, and testing.............................

More information

Control Flow Graph Generator

Control Flow Graph Generator Control Flow Graph Generator Documentation Aldi Alimucaj alalimuc@htwg-konstanz.de June/2009 Version 1.0 Table of Contents 1. General information about the Project...3 2. Overview...4 Purpose...4 3. Plugin

More information

Verification Overview Testing Theory and Principles Testing in Practice. Verification. Miaoqing Huang University of Arkansas 1 / 80

Verification Overview Testing Theory and Principles Testing in Practice. Verification. Miaoqing Huang University of Arkansas 1 / 80 1 / 80 Verification Miaoqing Huang University of Arkansas Outline 1 Verification Overview 2 Testing Theory and Principles Theoretical Foundations of Testing Empirical Testing Principles 3 Testing in Practice

More information

Introduction to Parsing Ambiguity and Syntax Errors

Introduction to Parsing Ambiguity and Syntax Errors Introduction to Parsing Ambiguity and Syntax rrors Outline Regular languages revisited Parser overview Context-free grammars (CFG s) Derivations Ambiguity Syntax errors Compiler Design 1 (2011) 2 Languages

More information

Software Verification and Validation. Prof. Lionel Briand Ph.D., IEEE Fellow

Software Verification and Validation. Prof. Lionel Briand Ph.D., IEEE Fellow Software Verification and Validation Prof. Lionel Briand Ph.D., IEEE Fellow 1 White-Box Testing 2 White-Box vs. Black-BoxTesting: Reminder Software Representation (Model) Associated Criteria Test cases

More information

Utilizing Fast Testing to Transform Java Development into an Agile, Quick Release, Low Risk Process

Utilizing Fast Testing to Transform Java Development into an Agile, Quick Release, Low Risk Process Utilizing Fast Testing to Transform Java Development into an Agile, Quick Release, Low Risk Process Introduction System tests, often called slow tests, play a crucial role in nearly every Java development

More information

CSE 307: Principles of Programming Languages

CSE 307: Principles of Programming Languages CSE 307: Principles of Programming Languages Advanced Topics R. Sekar Topics 1 / 14 1. 2 / 14 Section 1 3 / 14 Semantics of Programs Syntax defines what programs are valid. Semantics defines what the valid

More information

Optimizing Finite Automata

Optimizing Finite Automata Optimizing Finite Automata We can improve the DFA created by MakeDeterministic. Sometimes a DFA will have more states than necessary. For every DFA there is a unique smallest equivalent DFA (fewest states

More information

Introduction to Parsing Ambiguity and Syntax Errors

Introduction to Parsing Ambiguity and Syntax Errors Introduction to Parsing Ambiguity and Syntax rrors Outline Regular languages revisited Parser overview Context-free grammars (CFG s) Derivations Ambiguity Syntax errors 2 Languages and Automata Formal

More information

Structural Testing. (c) 2007 Mauro Pezzè & Michal Young Ch 12, slide 1

Structural Testing. (c) 2007 Mauro Pezzè & Michal Young Ch 12, slide 1 Structural Testing (c) 2007 Mauro Pezzè & Michal Young Ch 12, slide 1 Learning objectives Understand rationale for structural testing How structural (code-based or glass-box) testing complements functional

More information

Programming Languages Third Edition. Chapter 9 Control I Expressions and Statements

Programming Languages Third Edition. Chapter 9 Control I Expressions and Statements Programming Languages Third Edition Chapter 9 Control I Expressions and Statements Objectives Understand expressions Understand conditional statements and guards Understand loops and variation on WHILE

More information

Smart Test Case Quantifier Using MC/DC Coverage Criterion

Smart Test Case Quantifier Using MC/DC Coverage Criterion Smart Test Case Quantifier Using MC/DC Coverage Criterion S. Shanmuga Priya 1, Sheba Kezia Malarchelvi 2 Abstract Software testing, an important phase in Software Development Life Cycle (SDLC) is a time

More information

CSCI 1260: Compilers and Program Analysis Steven Reiss Fall Lecture 4: Syntax Analysis I

CSCI 1260: Compilers and Program Analysis Steven Reiss Fall Lecture 4: Syntax Analysis I CSCI 1260: Compilers and Program Analysis Steven Reiss Fall 2015 Lecture 4: Syntax Analysis I I. Syntax Analysis A. Breaking the program into logical units 1. Input: token stream 2. Output: representation

More information

UNIT 3

UNIT 3 UNIT 3 Presentation Outline Sequence control with expressions Conditional Statements, Loops Exception Handling Subprogram definition and activation Simple and Recursive Subprogram Subprogram Environment

More information

FOR0383 Software Quality Assurance

FOR0383 Software Quality Assurance This method seems much, much bigger than all the other methods. FOR0383 Software Quality Assurance Lecture 15 Code metrics "You cannot control what you cannot measure." Tom DeMarco 2/11/2009 Dr Andy Brooks

More information

Compilers. Compiler Construction Tutorial The Front-end

Compilers. Compiler Construction Tutorial The Front-end Compilers Compiler Construction Tutorial The Front-end Salahaddin University College of Engineering Software Engineering Department 2011-2012 Amanj Sherwany http://www.amanj.me/wiki/doku.php?id=teaching:su:compilers

More information

Expressions vs statements

Expressions vs statements Expressions vs statements Every expression results in a value (+side-effects?): 1+2, str.length(), f(x)+1 Imperative prg: Statements have just side-effects, no value: (for, if, break) Assignment is statement/expression

More information

Java Basic Programming Constructs

Java Basic Programming Constructs Java Basic Programming Constructs /* * This is your first java program. */ class HelloWorld{ public static void main(string[] args){ System.out.println( Hello World! ); A Closer Look at HelloWorld 2 This

More information

MTAT : Software Testing

MTAT : Software Testing MTAT.03.159: Software Testing Lecture 02: Basic Black-Box and White-Box Testing Techniques (Textbook Ch. 4 & 5) Spring 2018 Dietmar Pfahl email: dietmar.pfahl@ut.ee Structure of Lecture 2 Black-Box vs.

More information

Motivating Examples (1.1) Selections. Motivating Examples (1.2) Learning Outcomes. EECS1022: Programming for Mobile Computing Winter 2018

Motivating Examples (1.1) Selections. Motivating Examples (1.2) Learning Outcomes. EECS1022: Programming for Mobile Computing Winter 2018 Motivating Examples (1.1) Selections EECS1022: Programming for Mobile Computing Winter 2018 CHEN-WEI WANG 1 import java.util.scanner; 2 public class ComputeArea { 3 public static void main(string[] args)

More information

Certified Automotive Software Tester Sample Exam Paper Syllabus Version 2.0

Certified Automotive Software Tester Sample Exam Paper Syllabus Version 2.0 Surname, Name: Gender: male female Company address: Telephone: Fax: E-mail-address: Invoice address: Training provider: Trainer: Certified Automotive Software Tester Sample Exam Paper Syllabus Version

More information

1DL321: Kompilatorteknik I (Compiler Design 1) Introduction to Programming Language Design and to Compilation

1DL321: Kompilatorteknik I (Compiler Design 1) Introduction to Programming Language Design and to Compilation 1DL321: Kompilatorteknik I (Compiler Design 1) Introduction to Programming Language Design and to Compilation Administrivia Lecturer: Kostis Sagonas (kostis@it.uu.se) Course home page: http://www.it.uu.se/edu/course/homepage/komp/h18

More information

Flow of Control Execution Sequence

Flow of Control Execution Sequence Flow of Control Execution Sequence Sequence sequence Decision tree Repetition graph Language Constructs sequence statements (incl Foc) simple / compound decision (1 /2 / n way) if then [else] case / switch

More information

Bounded Model Checking Of C Programs: CBMC Tool Overview

Bounded Model Checking Of C Programs: CBMC Tool Overview Workshop on Formal Verification and Analysis Tools, CFDVS, IIT-Bombay - Feb 21,2017 Bounded Model Checking Of C Programs: CBMC Tool Overview Prateek Saxena CBMC Developed and Maintained by Dr Daniel Kröning

More information

1DL321: Kompilatorteknik I (Compiler Design 1)

1DL321: Kompilatorteknik I (Compiler Design 1) Administrivia 1DL321: Kompilatorteknik I (Compiler Design 1) Introduction to Programming Language Design and to Compilation Lecturer: Kostis Sagonas (kostis@it.uu.se) Course home page: http://www.it.uu.se/edu/course/homepage/komp/ht16

More information

https://asd-pa.perfplusk12.com/admin/admin_curric_maps_display.aspx?m=5507&c=618&mo=18917&t=191&sy=2012&bl...

https://asd-pa.perfplusk12.com/admin/admin_curric_maps_display.aspx?m=5507&c=618&mo=18917&t=191&sy=2012&bl... Page 1 of 13 Units: - All - Teacher: ProgIIIJavaI, CORE Course: ProgIIIJavaI Year: 2012-13 Intro to Java How is data stored by a computer system? What does a compiler do? What are the advantages of using

More information

Process Modelling using Petri Nets

Process Modelling using Petri Nets Process Modelling using Petri Nets Katalina Grigorova Abstract: This paper discusses the reasons, which impose Petri nets as a conceptual standard for modelling and analysis of workflow. Petri nets notation

More information

Expressions and Statements. Department of CSE, MIT, Manipal

Expressions and Statements. Department of CSE, MIT, Manipal Expressions and Statements Control Control: what gets executed, when, and in what order. Abstraction of control: Expression Statement Exception Handling Procedures and functions Expression vs. Statement

More information

Properties of Regular Expressions and Finite Automata

Properties of Regular Expressions and Finite Automata Properties of Regular Expressions and Finite Automata Some token patterns can t be defined as regular expressions or finite automata. Consider the set of balanced brackets of the form [[[ ]]]. This set

More information

Introduction to Programming Languages and Compilers. CS164 11:00-12:30 TT 10 Evans. UPRM ICOM 4029 (Adapted from: Prof. Necula UCB CS 164)

Introduction to Programming Languages and Compilers. CS164 11:00-12:30 TT 10 Evans. UPRM ICOM 4029 (Adapted from: Prof. Necula UCB CS 164) Introduction to Programming Languages and Compilers CS164 11:00-12:30 TT 10 Evans 1 ICOM 4036 - Outline Prontuario Course Outline Brief History of PLs Programming Language Design Criteria Programming Language

More information

Operational Semantics. One-Slide Summary. Lecture Outline

Operational Semantics. One-Slide Summary. Lecture Outline Operational Semantics #1 One-Slide Summary Operational semantics are a precise way of specifying how to evaluate a program. A formal semantics tells you what each expression means. Meaning depends on context:

More information

Parsing. Note by Baris Aktemur: Our slides are adapted from Cooper and Torczon s slides that they prepared for COMP 412 at Rice.

Parsing. Note by Baris Aktemur: Our slides are adapted from Cooper and Torczon s slides that they prepared for COMP 412 at Rice. Parsing Note by Baris Aktemur: Our slides are adapted from Cooper and Torczon s slides that they prepared for COMP 412 at Rice. Copyright 2010, Keith D. Cooper & Linda Torczon, all rights reserved. Students

More information

Chapter 3. Describing Syntax and Semantics

Chapter 3. Describing Syntax and Semantics Chapter 3 Describing Syntax and Semantics Chapter 3 Topics Introduction The General Problem of Describing Syntax Formal Methods of Describing Syntax Attribute Grammars Describing the Meanings of Programs:

More information

A Simple Syntax-Directed Translator

A Simple Syntax-Directed Translator Chapter 2 A Simple Syntax-Directed Translator 1-1 Introduction The analysis phase of a compiler breaks up a source program into constituent pieces and produces an internal representation for it, called

More information

Chapter 8. Statement-Level Control Structures

Chapter 8. Statement-Level Control Structures Chapter 8 Statement-Level Control Structures Levels of Control Flow Within expressions Among program units Among program statements Copyright 2012 Addison-Wesley. All rights reserved. 1-2 Control Structure

More information

Structural Testing. White Box Testing & Control Flow Analysis

Structural Testing. White Box Testing & Control Flow Analysis Structural Testing White Box Testing & Control Flow Analysis Functional vs. Structural Functional Have I built the right product? Tests derived from the program specification Internal Structure ignored

More information

CS111: PROGRAMMING LANGUAGE II

CS111: PROGRAMMING LANGUAGE II CS111: PROGRAMMING LANGUAGE II Computer Science Department Lecture 1(c): Java Basics (II) Lecture Contents Java basics (part II) Conditions Loops Methods Conditions & Branching Conditional Statements A

More information

7.0 Test Design Techniques & Dynamic Testing

7.0 Test Design Techniques & Dynamic Testing 7.0 Test Design Techniques & Dynamic Testing Test Design Techniques 7.1 The Test Development Process 7.2 Categories of Test Design Techniques 7.3 Specification based or Black Box Techniques 7.4 Structure

More information

Using the code to measure test adequacy (and derive test cases) Structural Testing

Using the code to measure test adequacy (and derive test cases) Structural Testing Using the code to measure test adequacy (and derive test cases) Structural Testing Objectives To describe a second approach to testing which is geared to find program defects To explain the use of program

More information

Decaf Language Reference Manual

Decaf Language Reference Manual Decaf Language Reference Manual C. R. Ramakrishnan Department of Computer Science SUNY at Stony Brook Stony Brook, NY 11794-4400 cram@cs.stonybrook.edu February 12, 2012 Decaf is a small object oriented

More information

Announcements. Testing. Announcements. Announcements

Announcements. Testing. Announcements. Announcements Announcements Testing HW0, HW1, and HW2 are graded Grades and feedback in Submitty Email us at csci2600@cs.lists.rpi.edu Use Submitty discussion board! HW0, HW1, and HW2, Quiz 1 and 2 Grades in Submitty

More information

Testing Process and Methods. CS 490MT/5555, Spring 2017, Yongjie Zheng

Testing Process and Methods. CS 490MT/5555, Spring 2017, Yongjie Zheng Testing Process and Methods CS 490MT/5555, Spring 2017, Yongjie Zheng Context of Software Testing Verification & Validation Verification: checking that the software conforms to its specification. Validation:

More information

SCHEME 8. 1 Introduction. 2 Primitives COMPUTER SCIENCE 61A. March 23, 2017

SCHEME 8. 1 Introduction. 2 Primitives COMPUTER SCIENCE 61A. March 23, 2017 SCHEME 8 COMPUTER SCIENCE 61A March 2, 2017 1 Introduction In the next part of the course, we will be working with the Scheme programming language. In addition to learning how to write Scheme programs,

More information

Software Testing part II (white box) Lecturer: Giuseppe Santucci

Software Testing part II (white box) Lecturer: Giuseppe Santucci Software Testing part II (white box) Lecturer: Giuseppe Santucci 4. White box testing White-box (or Glass-box) testing: general characteristics Statement coverage Decision coverage Condition coverage Decision

More information

DEMO A Language for Practice Implementation Comp 506, Spring 2018

DEMO A Language for Practice Implementation Comp 506, Spring 2018 DEMO A Language for Practice Implementation Comp 506, Spring 2018 1 Purpose This document describes the Demo programming language. Demo was invented for instructional purposes; it has no real use aside

More information

Compiler Design 1. Introduction to Programming Language Design and to Compilation

Compiler Design 1. Introduction to Programming Language Design and to Compilation Compiler Design 1 Introduction to Programming Language Design and to Compilation Administrivia Lecturer: Kostis Sagonas (Hus 1, 352) Course home page: http://user.it.uu.se/~kostis/teaching/kt1-11 If you

More information

Written exam TDDD04 Software Testing

Written exam TDDD04 Software Testing LiTH, Linköpings tekniska högskola IDA, Institutionen för datavetenskap Ola Leifler Written exam TDDD04 Software Testing 2016-10-26 Permissible aids Dictionary (printed, NOT electronic) Teacher on duty

More information

CS 314 Principles of Programming Languages. Lecture 9

CS 314 Principles of Programming Languages. Lecture 9 CS 314 Principles of Programming Languages Lecture 9 Zheng Zhang Department of Computer Science Rutgers University Wednesday 5 th October, 2016 Zheng Zhang 1 CS@Rutgers University Class Information Homework

More information