PESIT Bangalore South Campus SOLUTION

Size: px
Start display at page:

Download "PESIT Bangalore South Campus SOLUTION"

Transcription

1 USN 1 P E PESIT Bangalore South Campus Hosur road, 1km before Electronic City, Bengaluru -100 Department of Information Science & Engineering INTERNAL ASSESSMENT TEST 2 Date : 02/04/2018 Max Marks: 40 Subject & Code: Software Testing / 15IS63 Section: 6 th A & B Name of faculty: Prof. Animesh Giri Time: 11:30 AM 1:00 PM SOLUTION Note: ANSWER FIVE QUESTIONS, CHOOSING ONE QUESTION FROM EACH PART Problem definitions have been discussed during Theory Classes & Lab Sessions. PART - I 1. a) Explain the steps involved to determine Basis Paths by applying McCabe s Algorithm, then do the following i) Find the Cyclomatic Complexity for the program graph given below. ii) Identify a set of Basis Paths for the program graph (5 Marks) Program Graph Answer: Mc Cabes s Algorithm: The method begins with the selection of a baseline path, which should correspond to a normal execution of a program (from start node to end node, and has as many decisions as possible).

2 The algorithm proceeds by retracing the paths visited and flipping the conditions one at a time. The process repeats up to the point all flips have been considered. i) Cyclomatic Complexity: V(G)=e-n+2p From the given program graph e=9,n=7 & p=1 Therefore,V(G)=9-7+2(1) ii) Basis Paths P1: P2: P3: P4:1-7 Answer: =2+2 = 4 b) Illustrate with a neat program graphs the Violations of Structured Programming Constructs such as i) Branching into a loop ii) Branching out of a decision (3 Marks)

3 Answer: 2. Explain Condensation with respect to the Structured Programming Constructs until the final try and illustrate Essential Complexity of Structured Program is 1 for the DD-Path Graph drawn by considering the Pseudo-Code for triangle program. (8 Marks) The basic idea is to look for a structured programming construct and to collapse it into a single node, and repeat it until no more programming construct can be found. This process is followed in the graphs above of a triangle program to final arrive at the graph with "e" as the final node.

4 The if-then-else construct involving nodes A,B,C,D is condensed into node a, and then the three if-then constructs are condensed onto nodes b, c and d. The remaining if-then-else construct is condensed into node e, resulting in a condensed graph with cyclomatic complexity V(G)=1. 3. PART II Define the following test coverage metrics: a. Statement (C 0 ) Coverage b. Decision (DD Path C 1 ) Coverage c. Condition Testing (C 1p ) Coverage d. Multiple Compound Condition (C MCC ) Coverage Apply these coverage techniques on the program graph shown and mention the path traversed for each test case input identified. Program Graph i) Statement Coverage (C0) Let T be a test suite for a Program P, then T satisfies the statement criterion for P, iff, for each statement S of P, there exists at least one test case in T that causes the execution of S. In terms of Flow graph model of program P, it is the same as visiting each single node on some execution path exercised by a test case in T C0: path: ace T1: A=2, B=0, X=3 ii) Decision (DD Path C 1 ) Coverage

5 Test suite T for a program P satisfies the decision adequacy criterion for P, iff, for each branch B (or predicate P), there exists at least test case in T that causes execution of B. This is the same as stating that every edge in the flow graph model of program P belongs to some execution path exercised by a test case in T C1: path1: acd and path2: abe iii) Condition Testing (C 1p ) Coverage T1: A=3, B=0, X=1 T2: A=2, B=1, X=1 A test suite T for a program P covers all C1P iff for each atomic condition in P, it has at least two test cases in T : one forcing P to have true out come and the other one forcing P to have a false outcome Four conditions: A>1, B=0, and A=2, X>1 1) A>1, and A<=1 2) B=0, and B<> 0 3) A=2, and A<> 2 4) X>1, and X<=1 Test cases: T1: A=2, B=0, X=4 ( True Path) T2: A=1, B=1, X=1 ( False Path) iv) Multiple Compound Condition (C MCC ) Coverage CMCC, A more complete extension that includes both the criteria basic condition and branch adequacy CMCC requires a test case T for each possible evaluation of compound conditions

6 1)A>1,B=0 2)A>1,B< >0 3)A<=1,B=0 4)A<=1,B< >0 5)A=2,X>1 6)A=2,X<=1 7)A< >2,X>1 8)A< >2,X<=1 Test Cases with input values: A=2, B=0,X=4 covers 1, 5 A=2, B=1, X=1 Covers 2,6 A=1, B=0,X=2 Covers 3,7 A=1,B=1,X=1 Covers 4,8 4. Illustrate the significance of DU- Paths and DC- Paths with the help of code fragments & the program graph of Commission problem. (8 Marks) i) Considering three variables, show few selected DU- Paths and ii) Mention whether those DU- Paths are Definition-Clear or not Answer: 1 int main() 2 { 3 int locks, stocks, barrels, tlocks, tstocks, tbarrels; 4 float lprice,sprice,bprice,sales; 5 lprice=45.0; 6 sprice=30.0; 7 bprice=25.0; 8 tlocks=0;

7 9 tstocks=0; 10 tbarrels=0; 11 printf("\nenter the number of locks and to exit the loop enter -1 for locks\n");scanf("%d", &locks); 12 while(locks!=-1) { 13printf("enter the number of stocks and barrels\n");scanf("%d%d",&stocks,&barrels); 14 tlocks=tlocks+locks; 15 tstocks=tstocks+stocks; 16 tbarrels=btarrels+barrels; 17 printf("\nenter the number of locks and to exit the loop enter -1 for locks\n");scanf("%d",&locks); } 18 printf("\ntotal locks = %d\,tlocks); 19 printf( total stocks =%d\n,tstocks); 20 printf( total barrels =%d\n",tbarrels); 21sales= lprice*tlocks + sprice*tstocks + bprice*tbarrels; 22 printf("\nthe total sales=%f\n",sales); }

8 Variable name Description Variable path(begining,end nodes) Du-paths Definiti on clear? lprice DEF(lprice,5) and USE(lprice 21) (5,21) < > sprice DEF(sprice,6) and USE(sprice,21) (6,21) < > Yes Yes bprice DEF(bprice,7) and USE(bprice,21) (7,21) < > Yes tlocks DEF((tlocks,8) and DEF(tlocks,14)) and USE(tlocks,14),(tlocks,18) and USE(tlocks,21) (8,14) < > Yes (8,18) < > (8,21) < > No No (14,14) <14-14> Yes (14,18) < > No (14,21) < > No tstocks DEF((tstocks,9) and DEF(tstocks,15)) and USE(tstocks,15),USE(tstocks,19), USE(tstocks,21), (9,15) < > Yes (9,19) < > No (9,21) < > No locks DEF((locks,11) and DEF(locks,17)) and USE(locks,12),USE(locks,17) (15,15) <15-15> Yes (15,19) < > No (15,21) < > No (11,12) <11-12> Yes (11,14) < > Yes (17,12) < > Yes

9 stocks DEF(stocks,13) and USE(stocks,15) (17,17) <17-17> Yes (13,15) < > Yes sales DEF(sales,21) and USE(sales,22) (21,22) <21-22> Yes Answer: PART - III 5. Explain with purpose of Scaffolding in test execution by defining the role of Test Drivers, Test Stubs & Test Harness. (8 Marks) Code produced to support development activities (especially testing) Not part of the product as seen by the end user May be temporary (like scaffolding in construction of buildings Includes Test harnesses, drivers, and stubs In complex systems science, "scaffolding" are those structures necessary to move from an initial state to an emerged form. For example, when recapturing an area of land and bringing it back to its natural state (e.g. prairie), you will find that certain birds and plants have to be present during the transition time in order for the old form to re-emerge. Once the new state has emerged, the scaffolding comes down... BUT, without the scaffolding, no change would have occurred. Test driver A main program for running a test May be produced before a real main program Provides more control than the real main program To driver program under test through test cases Test stubs Substitute for called functions/methods/objects Test harness Substitutes for other parts of the deployed environment Ex: Software simulation of hardware devices Example: Interactive Systems developed by MVC Pattern Controllability & Observability

10 6. What are Test Oracles? Explain with neat diagrams, Comparison-Based Oracle and Self- Checking Code Oracle (8 Marks) Answer:

11 PART - IV

12 7. Why Loop Testing is important? Mention the strategy to the Nested Loops, Concatenated Loops and the Knotted Loops (Unstructured Loop). (8 Marks) Answer: Loop testing has been studied extensively, and with good reason loops are a highly fault-prone portion of source code. To start an amusing taxonomy of loops occurs: concatenated, nested, and horrible, shown in Figure- 3.6 Concatenated loops are simply a sequence of disjoint loops. Nested loops are such that one loop is contained inside another. Knotted loops cannot occur when the structured programming percepts are followed, but they can occur in languages like Java with try/catch. When it is possible to branch into (or out from) the middle of a loop, and these branches are internal to other loops, the result is Beizer s knotted loop. The simple view of loop testing is that every loop involves a decision, and we need to test both outcomes of the decision: one is to traverse the loop, and the other is to exit (or not enter) the loop. We can also take a modified boundary value approach, where the loop index is given its minimum, nominal, and maximum values. We can push this further to full boundary value testing and even robustness testing. Once a loop has been tested, the rest condenses it into a single node.

13 If loops are nested, this process is repeated starting with the innermost loop and working around outward. These results in the same multiplicity of test cases we found with boundary value analysis, which makes sense, because each loop index variable acts like an input variable. If loops are knotted, it will be necessary to carefully analyze them in terms of the dataflow methods. Answer: 8. Explain Mutation Analysis & Testing; illustrate with the help of code-snippet some of the mutation operator to produce a mutant program. (8 Marks) Mutation testing is done by selecting a set of mutation operators and then applying them to the source program one at a time for each applicable piece of the source code. The result of applying one mutation operator to the program is called a mutant. If the test suite is able to detect the change (i.e. one of the tests fails), then the mutant is said to be killed. For example, consider the following C++ code fragment: if (a && b) { c = 1; } else { c = 0; } The condition mutation operator would replace&&with and produce the following mutant: if (a b) { c = 1; } else { c = 0; } Now, for the test to kill this mutant, the following condition should be met: Test input data should cause different program states for the mutant and the original program. For example, a test with a = 1and b = 0would do this. The value of 'c' should be propagated to the program's output and checked by the test. Mutation testing A mutant is a copy of a program with a mutation A mutation is a syntactic change (a seeded bug) Example: change (i < 0) to (i <= 0) Run test suite on all the mutant programs A mutant is killed if it fails on at least one test case If many mutants are killed, infer that the test suite is also effective at finding real bugs

14 Mutation Operators Syntactic change from legal program to legal program So: Specific to each programming language. C++ mutations don t work for Java, Java mutations don t work for Python Examples: crp: constant for constant replacement for instance: from (x < 5) to (x < 12) select from constants found somewhere in program text ror: relational operator replacement for instance: from (x <= 5) to (x < 5) vie: variable initialization elimination change int x =5; to int x; A variety of mutation operators were explored by researchers. Here are some examples of mutation operators for imperative languages: Statement deletion. Replace each Boolean sub expression with true and false. Replace each arithmetic operation with another one, e.g. + with *, - and /. Replace each Boolean relation with another one, e.g.>with>=,==and<=. Replace each variable with another variable declared in the same scope (variable types should be the same). PART - V 9. Using the Mc-Cabe s Strongly Connected Graph, Write all the Path traversal. (8 Marks) Answer: It is a directed graph that we might take to be the program graph (or the DD-Path graph) of some program. McCabe based his view of testing on a major result from graph theory, which states that the cyclomatic number of a strongly connected graph is the number of linearly independent circuits in the graph. (We can always create a strongly connected graph by adding an edge from the (every) sink node to the (every) source node.) Some sources give the formula for cyclomatic complexity as V(G) = e n + p, while others use the formula V(G) = e n + 2p, where e is the number of edges. n is the number of nodes, and p is the number of connected regions.

15 The cyclomatic complexity of the strongly connected graph if Figure is %; thus, there are five linearly independent circuits. If we now delete the added edge from node G to node A, these five circuits become five linearly independent paths from node A to node G. p1: A, B, C, G p2: A, B, C, B, C, GG p3: A, B, E, F, G p4: A, D, E, F, G p5: A, D, F, G The algorithm is straightforward: The method begins with the selection of a baseline path, which should correspond to some normal case program execution. This can be somewhat arbitrary; McCabe advises choosing a path with as many decisions nodes as possible. Next the baseline path is retraced, and in turn each decision is flipped ; that is, when a node of outdegree 2 is reached, a different edge must be taken. The process repeats up to the point all flips have been considered.

16 Here we follow McCabe s example, in which he first postulates the path through nodes A, B, C, B, E, F, G as the baseline. The first decision node (outdegree 2) in this path is node A; so for the next basis path we traverse edge 2 instead of edge 1. We get the path A, D, E, F, G, where we retrace nodes E, F, G in path 1 to be as minimally different as possible. For the next path, we can follow the second path, and take the other decision outcome of node D, which gives us the path A, D, F, G. Now only decision nodes B and C have not been flipped; doing so yields the last two basis paths, A, B, E, F, G and A, B, C, G. 10. What is Fault based Testing? Distinguish between: i) Competent Programmer hypothesis and Coupling effect hypothesis ii) Distinguished mutant and Equivalent mutant (8 Marks) Answer: If the program under test has an actual fault, we hypothesize that it differs from the another, corrected program by only a small textual change. If so, then we merely distinguish the program from all such small variants to ensure detection of all such faults. This is known as competent programmer hypothesis, an assumption that the program under test is "close to" a correct program. Sometimes an error of logic will result in much more complex difference in program text. This may not invalidate fault-based testing with a simpler fault model, provided test cases sufficient for detecting the simpler faults are sufficient also detecting the more complex faults. This is known as coupling effect. Coupling effect hypothesis: A complex change is equivalent to several smaller changes in program text. If the effect of one of these small changes is not masked by the effect of others, then a test case that differentiates a variant based on a single change may also serve to detect the more complex error. The mutant can be distinguished from the original program,but the test suite under consideration is not adequate with respect to the mutant. If the mutant could have been killed, but was not, it indicates a weakness in the test suite. A mutant may be equivalent to the original program. Maybe changing (x < 0) to (x <= 0) didn t change the output at all! The seeded fault is not really a fault. Determining whether a mutant is equivalent maybe easy or hard; in the worst case it is undecideable. For eg, int index = 0; while ( ) { ; index++; if (index == 10)

17 { break; } } Boolean relation mutation operator will replace == with >= and produce the following mutant: int index = 0; while ( ) { ; index++; if (index >= 10) { break; } }

SOFTWARE TESTING LABORATORY

SOFTWARE TESTING LABORATORY oratory M.I.T VI ISE SOFTWARE TESTING LABORATORY Subject Code: 10ISL68 I.A. Marks : 25 Hours/Week : 03 Exam Hours: 03 Total Hours : 42 Exam Marks: 50 1. Design and develop a program in a language of your

More information

Question Bank. Unit 1: Perspective on Testing, Examples. Chapter 1 & 2 from Dr. Paul C. Jorgensen

Question Bank. Unit 1: Perspective on Testing, Examples. Chapter 1 & 2 from Dr. Paul C. Jorgensen Unit 1: Perspective on Testing, Examples Chapter 1 & 2 from Dr. Paul C. Jorgensen Sl no Question Description 1. Make a Venn Diagram that reflects a part of the following statement: we have left undone

More information

MTAT : Software Testing

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

More information

PESIT Bangalore South Campus

PESIT Bangalore South Campus USN 1 P E PESIT Bangalore South Campus Hosur road, 1km before Electronic City, Bengaluru -100 Department of Information Science & Engineering INTERNAL ASSESSMENT TEST 1 Date : 23/02/2016 Max Marks: 50

More information

Path Testing + Coverage. Chapter 8

Path Testing + Coverage. Chapter 8 Path Testing + Coverage Chapter 8 Structural Testing n Also known as glass/white/open box testing n A software testing technique whereby explicit knowledge of the internal workings of the item being tested

More information

What is Structural Testing?

What is Structural Testing? Structural Testing What is Structural Testing? Based on Source Code Examine the internal structure of the program Test cases are derived from an examination of program s logic Do not pay any attention

More information

PES INSTITUTE OF TECHNOLOGY- BANGALORE SOUTH CAMPUS

PES INSTITUTE OF TECHNOLOGY- BANGALORE SOUTH CAMPUS Sixth Semester B.E. IA Test I, Feb, 2015 USN 1 P E I S PES INSTITUTE OF TECHNOLOGY- BANGALORE SOUTH CAMPUS (Hosur Road, Electronic City, Bangalore-560 100) Date & Time: 25-02-2015, 8:30 AM - 11:00 AM Max

More information

Software Testing. 1. Testing is the process of demonstrating that errors are not present.

Software Testing. 1. Testing is the process of demonstrating that errors are not present. What is Testing? Software Testing Many people understand many definitions of testing :. Testing is the process of demonstrating that errors are not present.. The purpose of testing is to show that a program

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

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

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

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

Aerospace Software Engineering

Aerospace Software Engineering 16.35 Aerospace Software Engineering Verification & Validation Prof. Kristina Lundqvist Dept. of Aero/Astro, MIT Would You...... trust a completely-automated nuclear power plant?... trust a completely-automated

More information

Software Testing Fundamentals. Software Testing Techniques. Information Flow in Testing. Testing Objectives

Software Testing Fundamentals. Software Testing Techniques. Information Flow in Testing. Testing Objectives Software Testing Fundamentals Software Testing Techniques Peter Lo Software Testing is a critical element of software quality assurance and represents the ultimate review of specification, design and coding.

More information

Lecture 26: Testing. Software Engineering ITCS 3155 Fall Dr. Jamie Payton

Lecture 26: Testing. Software Engineering ITCS 3155 Fall Dr. Jamie Payton Lecture 26: Testing Software Engineering ITCS 3155 Fall 2008 Dr. Jamie Payton Department of Computer Science University of North Carolina at Charlotte Dec. 9, 2008 Verification vs validation Verification:

More information

MTAT : Software Testing

MTAT : Software Testing MTAT.03.159: Software Testing Lecture 04: White-Box Testing (advanced) Part1 Dietmar Pfahl Spring 2018 email: dietmar.pfahl@ut.ee White-Box Testing Techniques Control-Flow Testing Data-Flow Testing Mutation

More information

What is Mutation Testing? Mutation Testing. Test Case Adequacy. Mutation Testing. Mutant Programs. Example Mutation

What is Mutation Testing? Mutation Testing. Test Case Adequacy. Mutation Testing. Mutant Programs. Example Mutation What is Mutation Testing? Mutation Testing Breaking the application to test it n Mutation Testing is a testing technique that focuses on measuring the adequacy of test cases n Mutation Testing is NOT a

More information

Introduction to Dynamic Analysis

Introduction to Dynamic Analysis Introduction to Dynamic Analysis Reading assignment Gary T. Leavens, Yoonsik Cheon, "Design by Contract with JML," draft paper, http://www.eecs.ucf.edu/~leavens/jml//jmldbc.pdf G. Kudrjavets, N. Nagappan,

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

Software Quality Assurance. David Janzen

Software Quality Assurance. David Janzen Software Quality Assurance David Janzen What is quality? Crosby: Conformance to requirements Issues: who establishes requirements? implicit requirements Juran: Fitness for intended use Issues: Who defines

More information

Test Oracles and Mutation Testing. CSCE Lecture 23-11/18/2015

Test Oracles and Mutation Testing. CSCE Lecture 23-11/18/2015 Test Oracles and Mutation Testing CSCE 740 - Lecture 23-11/18/2015 Software Testing - Back to the Basics Tests are sequences of stimuli and observations. We care about input and output. (I 1 O 1 ) (I 2

More information

Darshan Institute of Engineering & Technology for Diploma Studies

Darshan Institute of Engineering & Technology for Diploma Studies CODING Good software development organizations normally require their programmers to follow some welldefined and standard style of coding called coding standards. Most software development organizations

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

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

Program-based Mutation Testing

Program-based Mutation Testing Program-based Mutation Testing CS 4501 / 6501 Software Testing [Ammann and Offutt, Introduction to Software Testing, Ch. 9.2] 1 Applying Syntax-Based Testing to Programs Test requirements are derived from

More information

CMPSCI 521/621 Homework 2 Solutions

CMPSCI 521/621 Homework 2 Solutions CMPSCI 521/621 Homework 2 Solutions Problem 1 Direct data dependencies: 3 is directly data dependent on 1 and 5 5 is directly data dependent on 1,3, and 5 7 is directly data dependent on 1,3, and 5 Note,

More information

Introduction to Software Testing Chapter 5.1 Syntax-based Testing

Introduction to Software Testing Chapter 5.1 Syntax-based Testing Introduction to Software Testing Chapter 5.1 Syntax-based Testing Paul Ammann & Jeff Offutt http://www.cs.gmu.edu/~offutt/ softwaretest/ Ch. 5 : Syntax Coverage Four Structures for Modeling Software Graphs

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

Software Testing TEST CASE SELECTION AND ADEQUECY TEST EXECUTION

Software Testing TEST CASE SELECTION AND ADEQUECY TEST EXECUTION Software Testing TEST CASE SELECTION AND ADEQUECY TEST EXECUTION Overview, Test specification and cases, Adequacy criteria, comparing criteria, Overview of test execution, From test case specification

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

Introduction to Software Engineering

Introduction to Software Engineering Introduction to Software Engineering (CS350) Lecture 17 Jongmoon Baik Testing Conventional Applications 2 Testability Operability it operates cleanly Observability the results of each test case are readily

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

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

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

What is Mutation Testing?

What is Mutation Testing? What is Mutation Testing? The premise in mutation testing is that small changes are made in a module and then the original and mutant modules are compared. Similar idea to error seeding: introduce defects

More information

Facts About Testing. Cost/benefit. Reveal faults. Bottom-up. Testing takes more than 50% of the total cost of software development

Facts About Testing. Cost/benefit. Reveal faults. Bottom-up. Testing takes more than 50% of the total cost of software development Reveal faults Goals of testing Correctness Reliability Usability Robustness Performance Top-down/Bottom-up Bottom-up Lowest level modules tested first Don t depend on any other modules Driver Auxiliary

More information

Testing! Prof. Leon Osterweil! CS 520/620! Spring 2013!

Testing! Prof. Leon Osterweil! CS 520/620! Spring 2013! Testing Prof. Leon Osterweil CS 520/620 Spring 2013 Relations and Analysis A software product consists of A collection of (types of) artifacts Related to each other by myriad Relations The relations are

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

Fault-based testing. Automated testing and verification. J.P. Galeotti - Alessandra Gorla. slides by Gordon Fraser. Thursday, January 17, 13

Fault-based testing. Automated testing and verification. J.P. Galeotti - Alessandra Gorla. slides by Gordon Fraser. Thursday, January 17, 13 Fault-based testing Automated testing and verification J.P. Galeotti - Alessandra Gorla slides by Gordon Fraser How good are my tests? How good are my tests? Path testing Boundary interior testing LCSAJ

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

Testing Theory. Agenda - What will you learn today? A Software Life-cycle Model Which part will we talk about today? Theory Lecture Plan

Testing Theory. Agenda - What will you learn today? A Software Life-cycle Model Which part will we talk about today? Theory Lecture Plan heory Lecture Plan 2 esting heory Lecture 8 Software Engineering DDC88/DDC93 autumn 28 Department of Computer and Information Science Linköping University, Sweden L - Course Introduction and Overview L2

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

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

Lecture 17: Testing Strategies. Developer Testing

Lecture 17: Testing Strategies. Developer Testing Lecture 17: Testing Strategies Structural Coverage Strategies (White box testing): Statement Coverage Branch Coverage Condition Coverage Data Path Coverage Function Coverage Strategies (Black box testing):

More information

6. Test-Adequacy. Assessment Using Control Flow and Data Flow. Andrea Polini

6. Test-Adequacy. Assessment Using Control Flow and Data Flow. Andrea Polini 6. Test-Adequacy Assessment Using Control Flow and Data Flow Andrea Polini Software Engineering II Software Testing MSc in Computer Science University of Camerino (Software Engineering II Software Testing)

More information

PESIT Bangalore South Campus Hosur road, 1km before Electronic City, Bengaluru -100 Department of Electronics and Communication

PESIT Bangalore South Campus Hosur road, 1km before Electronic City, Bengaluru -100 Department of Electronics and Communication USN 1 P E PESIT Bangalore South Campus Hosur road, 1km before Electronic City, Bengaluru -0 Department of Electronics and Communication INTERNAL ASSESSMENT TEST 2 Date : 4//2017 Marks: 50 Subject & Code

More information

LECTURE 11 TEST DESIGN TECHNIQUES IV

LECTURE 11 TEST DESIGN TECHNIQUES IV Code Coverage Testing 1. Statement coverage testing 2. Branch coverage testing 3. Conditional coverage testing LECTURE 11 TEST DESIGN TECHNIQUES IV Code Complexity Testing 1. Cyclomatic Complexity s V

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

White Box Testing III

White Box Testing III White Box Testing III Outline Today we continue our look at white box testing methods, with mutation testing We will look at : definition and role of mutation testing what is a mutation? how is mutation

More information

Measuring Complexity

Measuring Complexity Measuring Complexity outline why should we measure the complexity of a software system? what might we want to measure? complexity of the source code within a code module between code modules complexity

More information

EXAMINING THE CODE. 1. Examining the Design and Code 2. Formal Review: 3. Coding Standards and Guidelines: 4. Generic Code Review Checklist:

EXAMINING THE CODE. 1. Examining the Design and Code 2. Formal Review: 3. Coding Standards and Guidelines: 4. Generic Code Review Checklist: EXAMINING THE CODE CONTENTS I. Static White Box Testing II. 1. Examining the Design and Code 2. Formal Review: 3. Coding Standards and Guidelines: 4. Generic Code Review Checklist: Dynamic White Box Testing

More information

Lecture 18: Structure-based Testing

Lecture 18: Structure-based Testing Test Case First Strategy White box testing: Statement Coverage Branch Coverage Condition Coverage Data Path Coverage Lecture 18: Structure-based Testing Testing with good and bad data Testing Object Oriented

More information

STRUCTURAL TESTING. AKA White Box Testing. Thanks go to Andreas Zeller for allowing incorporation of his materials. F. Tip and M.

STRUCTURAL TESTING. AKA White Box Testing. Thanks go to Andreas Zeller for allowing incorporation of his materials. F. Tip and M. F. Tip and M. Weintraub STRUCTURAL TESTING AKA White Box Testing Thanks go to Andreas Zeller for allowing incorporation of his materials STRUCTURAL TESTING Testing based on the structure of the code Test

More information

Chapter 14 Testing Tactics

Chapter 14 Testing Tactics Chapter 14 Testing Tactics Moonzoo Kim CS Division of EECS Dept. KAIST moonzoo@cs.kaist.ac.kr http://pswlab.kaist.ac.kr/courses/cs550-07 Spring 2007 1 Overview of Ch14. Testing Tactics 14.1 Software Testing

More information

Overview. State-of-the-Art. Relative cost of error correction. CS 619 Introduction to OO Design and Development. Testing.

Overview. State-of-the-Art. Relative cost of error correction. CS 619 Introduction to OO Design and Development. Testing. Overview CS 619 Introduction to OO Design and Development ing! Preliminaries! All sorts of test techniques! Comparison of test techniques! Software reliability Fall 2012! Main issues: There are a great

More information

LECTURE 18. Control Flow

LECTURE 18. Control Flow LECTURE 18 Control Flow CONTROL FLOW Sequencing: the execution of statements and evaluation of expressions is usually in the order in which they appear in a program text. Selection (or alternation): a

More information

Structural Testing. Testing Tactics. Why Structural? Structural white box. Functional black box. Structural white box. Functional black box

Structural Testing. Testing Tactics. Why Structural? Structural white box. Functional black box. Structural white box. Functional black box From Pressman, Software Engineering a practitioner s approach, Chapter 14 and Pezze + Young, Software Testing and Analysis, Chapters 12-13 Structural Testing Software Engineering Andreas Zeller Saarland

More information

PESIT Bangalore South Campus Hosur road, 1km before Electronic City, Bengaluru -100 Department of Electronics and Communication

PESIT Bangalore South Campus Hosur road, 1km before Electronic City, Bengaluru -100 Department of Electronics and Communication USN 1 P E PESIT Bangalore South Campus Hosur road, 1km before Electronic City, Bengaluru -0 Department of Electronics and Communication INTERNAL ASSESSMENT TEST 1 Date : 30/8/2017 Marks: 0 Subject & Code

More information

Dataflow-based Coverage Criteria

Dataflow-based Coverage Criteria Dataflow-based Coverage Criteria W. Eric Wong Department of Computer Science The University of Texas at Dallas ewong@utdallas.edu http://www.utdallas.edu/~ewong Dataflow-based Coverage Criteria ( 2012

More information

Importance of Predicatebased. Predicate-based Testing. Terms Defined. Terms Defined (2) Terms Defined (3) Assumptions. Thorough testing of C used to

Importance of Predicatebased. Predicate-based Testing. Terms Defined. Terms Defined (2) Terms Defined (3) Assumptions. Thorough testing of C used to Predicate-based Testing Predicates are conditions Divides the input domain into partitions Define the paths of the program Program P Input X; Predicate C If outcome of C is incorrect, Either C is incorrect,

More information

Software Quality Assurance Dynamic Test

Software Quality Assurance Dynamic Test Software Quality Assurance Dynamic Test Contents Properties and goals Structural testing Control flow testing Data flow testing Functional test Diversified test 2 Properties and Goals Properties of dynamic

More information

STRUCTURAL TESTING. AKA White Box Testing. Thanks go to Andreas Zeller for allowing incorporation of his materials. F. Tip and M.

STRUCTURAL TESTING. AKA White Box Testing. Thanks go to Andreas Zeller for allowing incorporation of his materials. F. Tip and M. F. Tip and M. Weintraub STRUCTURAL TESTING AKA White Box Testing Thanks go to Andreas Zeller for allowing incorporation of his materials STRUCTURAL TESTING Testing based on the structure of the code Test

More information

Lecture 2: SML Basics

Lecture 2: SML Basics 15-150 Lecture 2: SML Basics Lecture by Dan Licata January 19, 2012 I d like to start off by talking about someone named Alfred North Whitehead. With someone named Bertrand Russell, Whitehead wrote Principia

More information

Software Testing Laboratory Lab Assignments

Software Testing Laboratory Lab Assignments Problem Statement 01 (Week 01) Software Testing Laboratory Lab Assignments Consider an automated banking application. The user can dial the bank from a personal computer, provide a six-digit password,

More information

IV Year I SEMESTER. Software Testing Lab

IV Year I SEMESTER. Software Testing Lab IV Year I SEMESTER Software Testing Lab T P C 0 3 2 Lab Assignments Problem Statement 01 Consider an automated banking application. The user can dial the bank from a personal computer, provide a six-digit

More information

Software Testing. Minsoo Ryu. Hanyang University. Real-Time Computing and Communications Lab., Hanyang University

Software Testing. Minsoo Ryu. Hanyang University. Real-Time Computing and Communications Lab., Hanyang University Software Testing Minsoo Ryu Hanyang University Topics covered 1. Testing Goals and Principles 2. Testing Process 3. Testing Strategies Component testing Integration testing Validation/system testing 4.

More information

Programming Embedded Systems

Programming Embedded Systems Programming Embedded Systems Lecture 8 Overview of software testing Wednesday Feb 8, 2012 Philipp Rümmer Uppsala University Philipp.Ruemmer@it.uu.se 1/53 Lecture outline Testing in general Unit testing

More information

Subject: PROBLEM SOLVING THROUGH C Time: 3 Hours Max. Marks: 100

Subject: PROBLEM SOLVING THROUGH C Time: 3 Hours Max. Marks: 100 Code: DC-05 Subject: PROBLEM SOLVING THROUGH C Time: 3 Hours Max. Marks: 100 NOTE: There are 11 Questions in all. Question 1 is compulsory and carries 16 marks. Answer to Q. 1. must be written in the space

More information

Quality Assurance in Software Development

Quality Assurance in Software Development Quality Assurance in Software Development Qualitätssicherung in der Softwareentwicklung A.o.Univ.-Prof. Dipl.-Ing. Dr. Bernhard Aichernig Graz University of Technology Austria Summer Term 2017 1 / 47 Agenda

More information

Test Case Specifications and Test adequacy. Research Methods - Barbara Russo SwSE - Software and Systems Engineering

Test Case Specifications and Test adequacy. Research Methods - Barbara Russo SwSE - Software and Systems Engineering Test Case Specifications and Test adequacy Research Methods - Barbara Russo SwSE - Software and Systems Engineering 1 Test Case Selection How do we create tests? Test are defined in terms of their adequacy

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

Testing Tactics. Structural Testing. Why Structural? Why Structural? Functional black box. Structural white box. Functional black box

Testing Tactics. Structural Testing. Why Structural? Why Structural? Functional black box. Structural white box. Functional black box ing Tactics Structural ing Functional black box Structural white box Software Engineering Andreas Zeller Saarland University s based on spec covers as much specified behavior as possible s based on code

More information

CS 112 Introduction to Computing II. Wayne Snyder Computer Science Department Boston University

CS 112 Introduction to Computing II. Wayne Snyder Computer Science Department Boston University CS 112 Introduction to Computing II Wayne Snyder Department Boston University Today: Java expressions and operators concluded Java Statements: Conditionals: if/then, if/then/else Loops: while, for Next

More information

https://www.lri.fr/ linaye/gl.html

https://www.lri.fr/ linaye/gl.html Software Engineering https://www.lri.fr/ linaye/gl.html lina.ye@centralesupelec.fr Sequence 3, 2017-2018 1/61 Software Engineering Plan 1 2 3 4 5 2/61 Software Engineering Software Testing 3/61 Software

More information

Semantics via Syntax. f (4) = if define f (x) =2 x + 55.

Semantics via Syntax. f (4) = if define f (x) =2 x + 55. 1 Semantics via Syntax The specification of a programming language starts with its syntax. As every programmer knows, the syntax of a language comes in the shape of a variant of a BNF (Backus-Naur Form)

More information

Object Oriented Mutation Applied in Java Application programming Interface and C++ Classes

Object Oriented Mutation Applied in Java Application programming Interface and C++ Classes Object Oriented Mutation Applied in Java Application programming Interface and C++ Classes Titu Singh Arora 1, Ravindra Gupta 2 M.Tech Scholar, Department of Computer Science, SSSIST Sehore, India 1 Professor

More information

EXERCISES (Software Engineering)

EXERCISES (Software Engineering) Chapter 1 1. What is Software Engineering? 2. What is Requirement Engineering? EXERCISES (Software Engineering) 3. What are the Different types of Architectures in Software Engineering? 4. How many subdisciplines

More information

Class 17. Discussion. Mutation analysis and testing. Problem Set 7 discuss Readings

Class 17. Discussion. Mutation analysis and testing. Problem Set 7 discuss Readings Class 17 Questions/comments Graders for Problem Set 6 (4); Graders for Problem set 7 (2-3) (solutions for all); will be posted on T-square Regression testing, Instrumentation Final project presentations:

More information

Introduction to Computer Science and Business

Introduction to Computer Science and Business Introduction to Computer Science and Business The Database Programming with PL/SQL course introduces students to the procedural language used to extend SQL in a programatic manner. This course outline

More information

Verification and Validation. Assuring that a software system meets a user s needs. Verification vs Validation. The V & V Process

Verification and Validation. Assuring that a software system meets a user s needs. Verification vs Validation. The V & V Process Verification and Validation Assuring that a software system meets a user s needs Ian Sommerville 1995/2000 (Modified by Spiros Mancoridis 1999) Software Engineering, 6th edition. Chapters 19,20 Slide 1

More information

PROCEDURAL DATABASE PROGRAMMING ( PL/SQL AND T-SQL)

PROCEDURAL DATABASE PROGRAMMING ( PL/SQL AND T-SQL) Technology & Information Management Instructor: Michael Kremer, Ph.D. Class 3 Database Programming PROCEDURAL DATABASE PROGRAMMING ( PL/SQL AND T-SQL) AGENDA 3. Declaring Variables/Constants 4. Flow Control

More information

Unit 6 - Software Design and Development LESSON 4 DATA TYPES

Unit 6 - Software Design and Development LESSON 4 DATA TYPES Unit 6 - Software Design and Development LESSON 4 DATA TYPES Previously Paradigms Choice of languages Key features of programming languages sequence; selection eg case, if then else; iteration eg repeat

More information

Measuring internal product attributes: structure. Basel Dudin

Measuring internal product attributes: structure. Basel Dudin Measuring internal product attributes: structure Basel Dudin dudinbk@mcmaster.ca outline Representing Structure and Complexity Control Flow Graphs (CFG): Representation of Structure Examples of CFG Cyclomatic

More information

Structural Testing. Testing Tactics. Why Structural? Structural white box. Functional black box. Structural white box. Functional black box

Structural Testing. Testing Tactics. Why Structural? Structural white box. Functional black box. Structural white box. Functional black box From Pressman, Software Engineering a practitioner s approach, Chapter 14 and Pezze + Young, Software Testing and Analysis, Chapters 12-13 Structural Testing Software Engineering Andreas Zeller Saarland

More information

Testing Objectives. Successful testing: discovers previously unknown errors

Testing Objectives. Successful testing: discovers previously unknown errors Testing Objectives Informal view: Testing: a process of executing software with the intent of finding errors Good testing: a high probability of finding as-yetundiscovered errors Successful testing: discovers

More information

Advanced Software Testing Understanding Code Coverage

Advanced Software Testing Understanding Code Coverage Advanced Software Testing Understanding Code Coverage Advanced Software Testing A series of webinars, this one excerpted from Advanced Software Testing: V3, a book for technical test analysts, programmers,

More information

CS 4387/5387 SOFTWARE V&V LECTURE 4 BLACK-BOX TESTING

CS 4387/5387 SOFTWARE V&V LECTURE 4 BLACK-BOX TESTING 1 CS 4387/5387 SOFTWARE V&V LECTURE 4 BLACK-BOX TESTING Outline 2 Quiz Black-Box Testing Equivalence Class Testing (Equivalence Partitioning) Boundary value analysis Decision Table Testing 1 3 Quiz - 1

More information

Computer Science and Software Engineering University of Wisconsin - Platteville 9-Software Testing, Verification and Validation

Computer Science and Software Engineering University of Wisconsin - Platteville 9-Software Testing, Verification and Validation Computer Science and Software Engineering University of Wisconsin - Platteville 9-Software Testing, Verification and Validation Yan Shi SE 2730 Lecture Notes Verification and Validation Verification: Are

More information

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

Software Testing Prof. Rajib Mall Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur Software Testing Prof. Rajib Mall Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur Lecture - 07 Special Value Testing Welcome to this session. So far we had looked

More information

Summer Final Exam Review Session August 5, 2009

Summer Final Exam Review Session August 5, 2009 15-111 Summer 2 2009 Final Exam Review Session August 5, 2009 Exam Notes The exam is from 10:30 to 1:30 PM in Wean Hall 5419A. The exam will be primarily conceptual. The major emphasis is on understanding

More information

SE Notes Mr. D. K. Bhawnani, Lect (CSE) BIT

SE Notes Mr. D. K. Bhawnani, Lect (CSE) BIT 1 Unit 4 Software Testing Introduction Once the source code has been developed, testing is required to uncover the errors before it is implemented. In order to perform software testing a series of test

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

Testing: (A Little) Logic Coverage

Testing: (A Little) Logic Coverage Testing: (A Little) Logic Coverage Testing, Quality Assurance, and Maintenance Winter 2018 Prof. Arie Gurfinkel Why Logic Coverage? MC/DC (Modified condition/decision coverage) MC/DC is required by the

More information

SFWR ENG 3S03: Software Testing

SFWR ENG 3S03: Software Testing (Slide 1 of 52) Dr. Ridha Khedri Department of Computing and Software, McMaster University Canada L8S 4L7, Hamilton, Ontario Acknowledgments: Material based on [?] Techniques (Slide 2 of 52) 1 2 3 4 Empirical

More information

Basics of Java: Expressions & Statements. Nathaniel Osgood CMPT 858 February 15, 2011

Basics of Java: Expressions & Statements. Nathaniel Osgood CMPT 858 February 15, 2011 Basics of Java: Expressions & Statements Nathaniel Osgood CMPT 858 February 15, 2011 Java as a Formal Language Java supports many constructs that serve different functions Class & Interface declarations

More information

Code Coverage Metrics And How to Use (and Misuse) Them

Code Coverage Metrics And How to Use (and Misuse) Them Code Coverage Metrics And How to Use (and Misuse) Them #include main() { int i, n, pp, p, c; printf("enter element count: "); scanf("%d", &n); if (n < 0) { printf("no %d series!\n", n); n = -1;

More information

Exam in Testing. Justin Pearson. Dec Cover Sheet. Problem no. Solution provided Max Your points Total: 59

Exam in Testing. Justin Pearson. Dec Cover Sheet. Problem no. Solution provided Max Your points Total: 59 Exam in Testing Justin Pearson Dec. 2011 Cover Sheet Problem no. Solution provided Max Your points 1 10 2 7 3 12 4 8 5 10 6 12 Total: 59 Anonymous Exam Code. :... 1 Exam Rubric All answers to be written

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

C Language Part 2 Digital Computer Concept and Practice Copyright 2012 by Jaejin Lee

C Language Part 2 Digital Computer Concept and Practice Copyright 2012 by Jaejin Lee C Language Part 2 (Minor modifications by the instructor) 1 Scope Rules A variable declared inside a function is a local variable Each local variable in a function comes into existence when the function

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