SE 3S03 - Tutorial 10. Helen Brown. Week of Mar 23, 2015
|
|
- Dwayne Curtis
- 6 years ago
- Views:
Transcription
1 SE 3S03 - Tutorial 10 Department of Computing and Software McMaster University Week of Mar 23, 2015 : Acknowledgments: The material of these slides is based on [1] 1/34
2 Outline Edge : Path : 2/34
3 Recall that means using the information about the internal structure of the software to determine test cases. It may also be called unit structural testing This tutorial will demonstrate white box testing on the Assignment 2 code given on the course website. : 3/34
4 Recall the statement coverage criterion from class: a test set T such that, by executing P for each d in T, each elementary statement of P is executed at least once. P behaves as a function d is an element in the domain D of P elementary statements are usually assignment statements, I/O statements and procedure calls Generally means execute every line of source code at least once Can you think of any weakness in just fulfilling this criterion? : 4/34
5 Recall the statement coverage criterion from class: a test set T such that, by executing P for each d in T, each elementary statement of P is executed at least once. P behaves as a function d is an element in the domain D of P elementary statements are usually assignment statements, I/O statements and procedure calls Generally means execute every line of source code at least once Can you think of any weakness in just fulfilling this criterion? It fails to measure if statements with a false decision outcome. : 4/34
6 Simple example: if (x < 6) { x += 1; } How many test cases do we need to make all lines of code execute? : 5/34
7 Simple example: if (x < 6) { x += 1; } How many test cases do we need to make all lines of code execute? Only 1 case, for example: <x = 4> : 5/34
8 Simple example: if (x < 6) { x += 1; } How many test cases do we need to make all lines of code execute? Only 1 case, for example: <x = 4> Note that the case where x 6 does not get checked using this criterion. : 5/34
9 Consider the following change to the example: while (x < 6) { x += 1; } Using the same value of x = 4, does this code have the false condition left unchecked? : 6/34
10 Consider the following change to the example: while (x < 6) { x += 1; } Using the same value of x = 4, does this code have the false condition left unchecked? No! The false condition executing is the only way the while loop will terminate. : 6/34
11 Example using If we look at the main() function within the RecordProcessor class, we know that the highlighted conditional statements determine whether or not the body code is executed. : 7/34
12 Our goal is to ensure every line of code is executed, so we simply have to create test cases that satisfy the different conditions. However, remember we want to try and keep our test set minimal for this testing technique. So, wherever we see nested conditional statements, we just need to have one test that satisfies all to meet the criterion. : 8/34
13 So we begin by defining a test with inputs inputvalid = false && count = 0 For the exception to run, we need the inputvalid = false (to enter the while loop) and count 4 so let s pick inputvalid = false && count = 4 So to complete statement coverage testing on the above, we only need 2 test cases. : 9/34
14 Continuing on to the process() function, we follow the same procedure: A test to enter the conditional loop and test the body code needs linenum RecordReader.MAX LINE NUM and endreached = false so let s pick linenum = 8, RecordReader.MAX LINE NUM = 50 and endreached = false : 10/34
15 To satisfy these three for loops and the if statement, linenum > 0, fieldchars.length > 0, chars.length > 1, and have at least one occcurence of fieldchars[j] == chars[k]. Keeping in mind we want to keep test cases minimal, let s pick linenum = 8, fieldchars = { A, D, W }, chars = { A, D, W }, : 11/34
16 With our previous test using linenum = 8, we are sure to enter the while loop and the for loop to print the first half of the line. In addition, the same test will allow us to enter the second half of the line when i = 1 and execute the for block since chars.length would equal 3. : 12/34
17 The code defaults the condition (i + SUBSECTION LENGTH linenum) to this else-block, and we currently do not have a set of inputs to test this. To enter the while-block, linenum must be at least 2. Since ( ) let s pick linenum = 2 : 13/34
18 An example to satisfy these conditions could include, i = 5 and chars.length = 3. In context of testing, we need a test case to have at least 5 lines, and we do - with linenum = 8 and chars as previously defined. : 14/34
19 Here we need an i such that ((i+1) % (2*6)!= 6), so we can choose i = 1 for that case. Our test condition with linenum = 8 will execute this code. : 15/34
20 As a quick overview of what we just defined, Looking at each test case and bearing in mind the initial conditions, we can minimize the tests: : 16/34
21 If we look at the conditions we need for each case, we can see that some tests must be executed together (i.e. in order to test process() we must execute the branch of main() that calls it). So we continue to minimize... Leaving us with a final count of 3 test cases to invoke all the statements within the code: : 17/34
22 Edge Recall the edge coverage criterion from class: a test set T such that, by executing P for each d in T, each edge of P s control flow graph is traversed at least once. P is a program fragment d is an element in the domain D of P Can you think of any weakness in just fulfilling this criterion? : 18/34
23 Edge Recall the edge coverage criterion from class: a test set T such that, by executing P for each d in T, each edge of P s control flow graph is traversed at least once. P is a program fragment d is an element in the domain D of P Can you think of any weakness in just fulfilling this criterion? Compound boolean expressions (c 1 c 2 ) used in branching clauses can end up having unchecked constituents that may cause errors later on. : 18/34
24 Edge Simple example: if (x > 3 y = true) { x += 1; } How many test cases do we need to make sure the if-block is executed, and also that it is skipped? : 19/34
25 Edge Simple example: if (x > 3 y = true) { x += 1; } How many test cases do we need to make sure the if-block is executed, and also that it is skipped? 2 cases: one where the if-condition is met, and another where it is not. for example: < x = 4, y = true>, <x = 4, y = false> : 19/34
26 Edge Simple example: if (x > 3 y = true) { x += 1; } How many test cases do we need to make sure the if-block is executed, and also that it is skipped? 2 cases: one where the if-condition is met, and another where it is not. for example: < x = 4, y = true>, <x = 4, y = false> : Note that 2 cases are not covered: one where x 3 and y = false, and another where x 3 and y = false. 19/34
27 Edge Back to our example Our statement coverage has executed all edges of the control flow graph that have a line of code explicitly written. To ensure edge coverage, we need to go back through the program, and analyze which conditional statements we do not satisfy so we can make sure our tests also take the path where they skip the conditional block of code. : 20/34
28 Edge Looking at the main function again, we have: Our while loop is always guaranteed to execute the path where the condition is not met- that s how it terminates. Our only worry is the if-statement block here, in which both outcomes have been covered already by our test cases. : 21/34
29 Edge Let s consider our process function again: Again, this is a while loop, so we re fine. : 22/34
30 Edge Process function consideration cont d: Our only change we must make is ensure we have a test case in which the character in the third field is not one of the characters we re looking for. Instead of making a new test case, let s just alter the ones we have. : 23/34
31 Edge Our modified test cases now include the case where the if-condition is not met: : 24/34
32 Edge Our only concern is making sure a test case doesn t meet the condition- (i + SUBSECTION LENGTH < linenum)... : 25/34
33 Edge... which we already covered to meet the else condition: : 26/34
34 Edge The same goes for the next if-else condition, since we needed to execute both blocks of code to meet the statement coverage criterion. : The if (k < chars.length - 1) block does not execute at the end of each printed line, which covers the case when printing **** is skipped. 27/34
35 Edge Which brings us to the end of our edge coverage consideration, and we finish with the following test cases: : 28/34
36 Recall the condition coverage criterion from class: a test set T such that, by executing P for each element in T, each edge of P s control flow graph is traversed, and all possible values of the constituents of compound conditions are exercised at least once. Notice that this criterion strengthens the edge coverage criterion. Can you think of any weakness in just fulfilling this criterion? : 29/34
37 Recall the condition coverage criterion from class: a test set T such that, by executing P for each element in T, each edge of P s control flow graph is traversed, and all possible values of the constituents of compound conditions are exercised at least once. Notice that this criterion strengthens the edge coverage criterion. Can you think of any weakness in just fulfilling this criterion? We may traverse through all edges of the flow graph and possible constituent values, but this does not protect us from errors like division by 0. : 29/34
38 Simple example: if (x % 2 = 0 y % 2 = 0) { z = x/y; } How many test cases do we need to cover the condition coverage criterion? : 30/34
39 Simple example: if (x % 2 = 0 y % 2 = 0) { z = x/y; } How many test cases do we need to cover the condition coverage criterion? 4 cases: test each constituent in the compound boolean expression <x is even, y is even>,<x is odd, y is even>,<x is even, y is odd>,<x is odd, y is odd>: for example: < x = 4, y = 6>, <x = 5, y = 6> < x = 4, y = 5>, <x = 5, y = 5> : 30/34
40 Simple example: if (x % 2 = 0 y % 2 = 0) { z = x/y; } How many test cases do we need to cover the condition coverage criterion? 4 cases: test each constituent in the compound boolean expression <x is even, y is even>,<x is odd, y is even>,<x is even, y is odd>,<x is odd, y is odd>: for example: < x = 4, y = 6>, <x = 5, y = 6> < x = 4, y = 5>, <x = 5, y = 5> : Note that even covering every case here does not protect us from cases like division by 0. 30/34
41 Path Recall the path coverage criterion from class: a test set T such that, by executing P for each d in T, all paths leading from the initial to the final node of P s control flow graph are traversed. Note that path coverage criterion edge coverage criterion. Can you think of any weakness in just fulfilling this criterion? : 31/34
42 Path Recall the path coverage criterion from class: a test set T such that, by executing P for each d in T, all paths leading from the initial to the final node of P s control flow graph are traversed. Note that path coverage criterion edge coverage criterion. Can you think of any weakness in just fulfilling this criterion? Generally, this criterion is impractical as in the general case the number of execution paths is very large. This makes traversing through all control paths infeasible. : 31/34
43 Path Simple example: if (x % 2 = 0 y % 2 = 0) { z = x/y; } How many test cases do we need to cover the condition coverage criterion? : 32/34
44 Path Simple example: if (x % 2 = 0 y % 2 = 0) { z = x/y; } How many test cases do we need to cover the condition coverage criterion? Many, many cases- we would need to test every possible value of x and y that could make it s way into the program. We could catch the division by 0 error from before. : 32/34
45 Path Simple example: if (x % 2 = 0 y % 2 = 0) { z = x/y; } How many test cases do we need to cover the condition coverage criterion? Many, many cases- we would need to test every possible value of x and y that could make it s way into the program. We could catch the division by 0 error from before. : Note that this testing could end up taking a very long time as programs grow and become more complex- it s simply infeasible in most cases. 32/34
46 We covered a brief overview of statement coverage criterion, edge coverage criterion, conditional coverage criterion, and path coverage criterion and noted issues with each. We can see the value in testing programs with multiple techniques. If code is missing some sort of implementation, white box testing won t find it, but black box testing will! : 33/34
47 References I Appendix References C. Ghezzi, M.Jazayeri, D.Mandrioli; Fundamentals of Software Engineering Prentice Hall PTR, /34
SE 3S03. Zahra Ali. Week of Feb 22, 2016
SE 3S03 Department of Computing and Software McMaster University Week of Feb 22, 2016 Coverage Coverage 1/34 Outline Coverage Coverage Coverage Coverage 2/34 Recall that means using the information about
More informationFachgebiet 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 informationINTRODUCTION 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 informationSFWR 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 informationSubject 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 informationTesting 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 informationSoftware 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 informationProblem Solving through Programming In C Prof. Anupam Basu Department of Computer Science & Engineering Indian Institute of Technology, Kharagpur
Problem Solving through Programming In C Prof. Anupam Basu Department of Computer Science & Engineering Indian Institute of Technology, Kharagpur Lecture 15 Branching : IF ELSE Statement We are looking
More information1 Black Box Test Data Generation Techniques
1 Black Box Test Data Generation Techniques 1.1 Equivalence Partitioning Introduction Equivalence partitioning is based on the premise that the inputs and outputs of a component can be partitioned into
More informationAn 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 informationAbout this exam review
Final Exam Review About this exam review I ve prepared an outline of the material covered in class May not be totally complete! Exam may ask about things that were covered in class but not in this review
More informationConditional Expressions and Decision Statements
Conditional Expressions and Decision Statements June 1, 2015 Brian A. Malloy Slide 1 of 23 1. We have introduced 5 operators for addition, subtraction, multiplication, division, and exponentiation: +,
More informationDECISION STRUCTURES: USING IF STATEMENTS IN JAVA
DECISION STRUCTURES: USING IF STATEMENTS IN JAVA S o far all the programs we have created run straight through from start to finish, without making any decisions along the way. Many times, however, you
More informationWhite-Box Testing Techniques III
White-Box Testing Techniques III Software Testing and Verification Lecture 9 Prepared by Stephen M. Thebaut, Ph.D. University of Florida White-Box Testing Topics Logic coverage (lecture I) Dataflow coverage
More informationShared Variables and Interference
Illinois Institute of Technology Lecture 24 Shared Variables and Interference CS 536: Science of Programming, Spring 2018 A. Why Parallel programs can coordinate their work using shared variables, but
More informationChapter 4 The If Then Statement
The If Then Statement Conditional control structure, also called a decision structure Executes a set of statements when a condition is true The condition is a Boolean expression For example, the statement
More informationExcel Basics Rice Digital Media Commons Guide Written for Microsoft Excel 2010 Windows Edition by Eric Miller
Excel Basics Rice Digital Media Commons Guide Written for Microsoft Excel 2010 Windows Edition by Eric Miller Table of Contents Introduction!... 1 Part 1: Entering Data!... 2 1.a: Typing!... 2 1.b: Editing
More informationVerification 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 informationFlow of Control. Flow of control The order in which statements are executed. Transfer of control
1 Programming in C Flow of Control Flow of control The order in which statements are executed Transfer of control When the next statement executed is not the next one in sequence 2 Flow of Control Control
More informationV2 2/4/ Ch Programming in C. Flow of Control. Flow of Control. Flow of control The order in which statements are executed
Programming in C 1 Flow of Control Flow of control The order in which statements are executed Transfer of control When the next statement executed is not the next one in sequence 2 Flow of Control Control
More informationSelection Statement ( if )
Islamic University Of Gaza Faculty of Engineering Computer Engineering Department Lab 4 Selection Statement ( if ) Eng. Ibraheem Lubbad October 10, 2016 In this lab we will constructs program that allow
More informationModule 3: New types of data
Module 3: New types of data Readings: Sections 4 and 5 of HtDP. A Racket program applies functions to values to compute new values. These new values may in turn be supplied as arguments to other functions.
More informationObjectives. Chapter 4: Control Structures I (Selection) Objectives (cont d.) Control Structures. Control Structures (cont d.) Relational Operators
Objectives Chapter 4: Control Structures I (Selection) In this chapter, you will: Learn about control structures Examine relational and logical operators Explore how to form and evaluate logical (Boolean)
More informationChapter 3: Dynamic Testing Techniques
Chapter 3: Dynamic Testing Techniques " The system was not fully tested to a satisfactory level of quality and resilience before full implementation on 26 October 1992." Extract from the main conclusions
More informationShared Variables and Interference
Solved Shared Variables and Interference CS 536: Science of Programming, Fall 2018 A. Why Parallel programs can coordinate their work using shared variables, but it s important for threads to not interfere
More informationChapter 4: Control Structures I (Selection) Objectives. Objectives (cont d.) Control Structures. Control Structures (cont d.
Chapter 4: Control Structures I (Selection) In this chapter, you will: Objectives Learn about control structures Examine relational and logical operators Explore how to form and evaluate logical (Boolean)
More informationCSE 1223: Introduction to Computer Programming in Java Chapter 3 Branching
CSE 1223: Introduction to Computer Programming in Java Chapter 3 Branching 1 Flow of Control The order in which statements in a program are executed is called the flow of control So far we have only seen
More informationSimple Java Programming Constructs 4
Simple Java Programming Constructs 4 Course Map In this module you will learn the basic Java programming constructs, the if and while statements. Introduction Computer Principles and Components Software
More informationStructural 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 informationLab1. Introduction to Python. Lab 4: Selection Statement. Eng. Mai Z. Alyazji
Islamic University of Gaza Faculty of Engineering Computer Engineering Dept. Introduction to Computers Lab (ENGG 1003) Lab1 Introduction to Python Lab 4: Selection Statement Eng. Mai Z. Alyazji In this
More informationPython for Informatics
Python for Informatics Exploring Information Version 0.0.6 Charles Severance Chapter 3 Conditional execution 3.1 Boolean expressions A boolean expression is an expression that is either true or false.
More informationWhite-Box Testing Techniques
T-76.5613 Software Testing and Quality Assurance Lecture 3, 18.9.2006 White-Box Testing Techniques SoberIT Content What are white-box testing techniques Control flow testing Statement coverage Branch coverage
More informationHere is a sample IDLE window illustrating the use of these two functions:
1 A SLIGHT DETOUR: RANDOM WALKS One way you can do interesting things with a program is to introduce some randomness into the mix. Python, and most programming languages, typically provide a library for
More informationForward Assignment; Strongest Postconditions
3/1 new version Forward Assignment; Strongest Postconditions CS 536: Science of Programming, Spring 2018 A. Why? At times, a forward version of the assignment rule is more appropriate than the backward
More informationVerification Black-box Testing & Testing in the Large
1 / 18 Verification & Miaoqing Huang University of Arkansas Spring 2010 2 / 18 Outline 1 2 Testing Boundary Conditions 3 Module Testing Integration Testing 3 / 18 Outline 1 2 Testing Boundary Conditions
More informationStructural 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 informationTesting. Jessica Young Schmidt, Northeastern University College of Computer and Information Science
Testing Jessica Young Schmidt, 2012 Northeastern University College of Computer and Information Science Why Test? Validation: Are we building the right product? - Increase confidence that software works
More informationMTAT : 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 informationCase by Case. Chapter 3
Chapter 3 Case by Case In the previous chapter, we used the conditional expression if... then... else to define functions whose results depend on their arguments. For some of them we had to nest the conditional
More information! A data structure representing a list. ! A series of nodes chained together in sequence. ! A separate pointer (the head) points to the first
Ch. 17: Linked Lists 17.1 Introduction to Linked Lists! A data structure representing a list! A series of nodes chained together in sequence CS 2308 Spring 2013 Jill Seaman - Each node points to one other
More information18-642: Unit Testing 1/31/ Philip Koopman
18-642: Unit Testing 1/31/2018 2017-2018 Philip Koopman YOU ARE HERE Product Requirements SPECIFY PRODUCT SPECIFY SOFTWARE Software Requirements TRACEABILITY & VALIDATION Test Plan & Test Results Test
More informationAlgorithms and Conditionals
Algorithms and Conditionals CSC 1051 Data Structures and Algorithms I Dr. Mary-Angela Papalaskari Department of Computing Sciences Villanova University Course website: www.csc.villanova.edu/~map/1051/
More informationUsing 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 informationWhile Loops CHAPTER 5: LOOP STRUCTURES. While Loops. While Loops 2/7/2013
While Loops A loop performs an iteration or repetition A while loop is the simplest form of a loop Occurs when a condition is true CHAPTER 5: LOOP STRUCTURES Introduction to Computer Science Using Ruby
More informationPath 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 informationAnnouncements. 1. Forms to return today after class:
Announcements Handouts (3) to pick up 1. Forms to return today after class: Pretest (take during class later) Laptop information form (fill out during class later) Academic honesty form (must sign) 2.
More informationModule 2: Choice and Iteration
Module 2: Choice and Iteration Ron K. Cytron * Department of Computer Science and Engineering * Washington University in Saint Louis Thanks to Alan Waldman for comments that improved these slides Prepared
More informationCS1 Lecture 5 Jan. 26, 2018
CS1 Lecture 5 Jan. 26, 2018 HW1 due Monday, 9:00am. Notes: Do not write all the code at once (for Q1 and 2) before starting to test. Take tiny steps. Write a few lines test... add a line or two test...
More informationSelec%on and Decision Structures in Java: If Statements and Switch Statements CSC 121 Spring 2016 Howard Rosenthal
Selec%on and Decision Structures in Java: If Statements and Switch Statements CSC 121 Spring 2016 Howard Rosenthal Lesson Goals Understand Control Structures Understand how to control the flow of a program
More informationWeek 9 Implementation
Week 9 Implementation Dr. Eliane l. Bodanese What is more important From a software engineering perspective: Good Gui? does what customer wants maintainable, extensible, reusable Commented Code? how is
More informationTesting & Continuous Integration. Kenneth M. Anderson University of Colorado, Boulder CSCI 5828 Lecture 20 03/19/2010
esting & Continuous Integration Kenneth M. Anderson University of Colorado, Boulder CSCI 5828 Lecture 20 03/1/20 University of Colorado, 20 1 Goals 2 Review material from Chapter of Pilone & Miles esting
More informationCS100: CPADS. Decisions. David Babcock / Don Hake Department of Physical Sciences York College of Pennsylvania
CS100: CPADS Decisions David Babcock / Don Hake Department of Physical Sciences York College of Pennsylvania James Moscola Decisions Just like a human, programs need to make decisions - Should turtle turn
More informationCS159. Nathan Sprague. September 30, 2015
CS159 Nathan Sprague September 30, 2015 Testing Happens at Multiple Levels Unit Testing - Test individual classes in isolation. Focus is on making sure that each method works according to specification.
More informationGlobal Optimization. Lecture Outline. Global flow analysis. Global constant propagation. Liveness analysis. Local Optimization. Global Optimization
Lecture Outline Global Optimization Global flow analysis Global constant propagation Liveness analysis Compiler Design I (2011) 2 Local Optimization Recall the simple basic-block optimizations Constant
More informationAerospace 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 informationInformation Science 1
Information Science 1 Fundamental Programming Constructs (1) Week 11 College of Information Science and Engineering Ritsumeikan University Topics covered l Terms and concepts from Week 10 l Flow of control
More informationSTRUCTURAL 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 informationFundamentals. Fundamentals. Fundamentals. We build up instructions from three types of materials
Fundamentals We build up instructions from three types of materials Constants Expressions Fundamentals Constants are just that, they are values that don t change as our macros are executing Fundamentals
More informationFlow of Control. 2.1 The if Statement
Flow of Control 2 In almost any computer program written for a scientific computing application, we need to allow the computer to execute a collection of statements if and only if some criterion is met.
More informationDesign and Analysis of Algorithms Prof. Madhavan Mukund Chennai Mathematical Institute. Week 02 Module 06 Lecture - 14 Merge Sort: Analysis
Design and Analysis of Algorithms Prof. Madhavan Mukund Chennai Mathematical Institute Week 02 Module 06 Lecture - 14 Merge Sort: Analysis So, we have seen how to use a divide and conquer strategy, we
More informationCS1 Lecture 5 Jan. 25, 2019
CS1 Lecture 5 Jan. 25, 2019 HW1 due Monday, 9:00am. Notes: Do not write all the code at once before starting to test. Take tiny steps. Write a few lines test... add a line or two test... add another line
More informationOverview: Programming Concepts. Programming Concepts. Names, Values, And Variables
Chapter 18: Get With the Program: Fundamental Concepts Expressed in JavaScript Fluency with Information Technology Third Edition by Lawrence Snyder Overview: Programming Concepts Programming: Act of formulating
More informationOverview: Programming Concepts. Programming Concepts. Chapter 18: Get With the Program: Fundamental Concepts Expressed in JavaScript
Chapter 18: Get With the Program: Fundamental Concepts Expressed in JavaScript Fluency with Information Technology Third Edition by Lawrence Snyder Overview: Programming Concepts Programming: Act of formulating
More informationCS 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 informationIntroduction 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 informationLecture 5 Tao Wang 1
Lecture 5 Tao Wang 1 Objectives In this chapter, you will learn about: Selection criteria Relational operators Logical operators The if-else statement Nested if statements C++ for Engineers and Scientists,
More informationc. Typically results in an intractably large set of test cases even for small programs
Multiple-Choice Questions: 1. True or false? Generally, in practice, developers exhaustively test software. a. True b. False 2. True or false? All real software contains bugs. a. True b. False 3. Which
More informationCS115 - Module 3 - Booleans, Conditionals, and Symbols
Fall 2017 Reminder: if you have not already, ensure you: Read How to Design Programs, sections 4-5 Booleans (Bool) , and = are new functions, each of which produces a boolean value (Bool). (< 4 6)
More informationWhite 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 informationINTRODUCTION TO LABVIEW
INTRODUCTION TO LABVIEW 2nd Year Microprocessors Laboratory 2012-2013 INTRODUCTION For the first afternoon in the lab you will learn to program using LabVIEW. This handout is designed to give you an introduction
More informationModule 4: Decision-making and forming loops
1 Module 4: Decision-making and forming loops 1. Introduction 2. Decision making 2.1. Simple if statement 2.2. The if else Statement 2.3. Nested if Statement 3. The switch case 4. Forming loops 4.1. The
More informationIntroduction. C provides two styles of flow control:
Introduction C provides two styles of flow control: Branching Looping Branching is deciding what actions to take and looping is deciding how many times to take a certain action. Branching constructs: if
More informationIntro. Speed V Growth
Intro Good code is two things. It's elegant, and it's fast. In other words, we got a need for speed. We want to find out what's fast, what's slow, and what we can optimize. First, we'll take a tour of
More informationProgramming with Java
Programming with Java String & Making Decision Lecture 05 First stage Software Engineering Dep. Saman M. Omer 2017-2018 Objectives By the end of this lecture you should be able to : Understand another
More informationProgramming and Data Structures Prof. N.S. Narayanaswamy Department of Computer Science and Engineering Indian Institute of Technology, Madras
Programming and Data Structures Prof. N.S. Narayanaswamy Department of Computer Science and Engineering Indian Institute of Technology, Madras Lecture - 13 Merging using Queue ADT and Queue types In the
More informationObject-Oriented Design Lecture 5 CSU 370 Fall 2008 (Pucella) Friday, Sep 26, 2008
Object-Oriented Design Lecture 5 CSU 370 Fall 2008 (Pucella) Friday, Sep 26, 2008 Software Testing Testing techniques can be classified along several orthogonal dimensions. White Box (or Glass Box) Versus
More informationWeb 2.0 Text logo. Preview: Gimper Sun, 09/02/ :22
Web 2.0 Text logo Gimper Sun, 09/02/2007-17:22 Preview: This web 2.0 text logo tutorial was made for beginners as well as intermediate users, ill be doing it step by step and try not to skip anything so
More informationObjectives for this class meeting. 1. Conduct review of core concepts concerning contracts and pre/post conditions
CSE1720 Click to edit Master Week text 01, styles Lecture 02 Second level Third level Fourth level Fifth level Winter 2015! Thursday, Jan 8, 2015 1 Objectives for this class meeting 1. Conduct review of
More informationProgram 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 informationStructural 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 informationMTAT : 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 informationSelec%on and Decision Structures in Java: If Statements and Switch Statements CSC 121 Fall 2016 Howard Rosenthal
Selec%on and Decision Structures in Java: If Statements and Switch Statements CSC 121 Fall 2016 Howard Rosenthal Lesson Goals Understand Control Structures Understand how to control the flow of a program
More informationLOOPS. Repetition using the while statement
1 LOOPS Loops are an extremely useful feature in any programming language. They allow you to direct the computer to execute certain statements more than once. In Python, there are two kinds of loops: while
More informationEXAMINING 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 informationProgramming for Experimental Research. Flow Control
Programming for Experimental Research Flow Control FLOW CONTROL In a simple program, the commands are executed one after the other in the order they are typed. Many situations require more sophisticated
More informationDecision Making -Branching. Class Incharge: S. Sasirekha
Decision Making -Branching Class Incharge: S. Sasirekha Branching The C language programs presented until now follows a sequential form of execution of statements. Many times it is required to alter the
More informationObjectives. Chapter 4: Control Structures I (Selection) Objectives (cont d.) Control Structures
Objectives Chapter 4: Control Structures I (Selection) In this chapter, you will: Learn about control structures Examine relational and logical operators Explore how to form and evaluate logical (Boolean)
More informationFlow Control. CSC215 Lecture
Flow Control CSC215 Lecture Outline Blocks and compound statements Conditional statements if - statement if-else - statement switch - statement? : opertator Nested conditional statements Repetitive statements
More informationLecture Programming in C++ PART 1. By Assistant Professor Dr. Ali Kattan
Lecture 08-1 Programming in C++ PART 1 By Assistant Professor Dr. Ali Kattan 1 The Conditional Operator The conditional operator is similar to the if..else statement but has a shorter format. This is useful
More informationC++ Programming: From Problem Analysis to Program Design, Third Edition
C++ Programming: From Problem Analysis to Program Design, Third Edition Chapter 4: Control Structures I (Selection) Control Structures A computer can proceed: In sequence Selectively (branch) - making
More informationCOMP 208 Computers in Engineering
COMP 208 Computers in Engineering Lecture 14 Jun Wang School of Computer Science McGill University Fall 2007 COMP 208 - Lecture 14 1 Review: basics of C C is case sensitive 2 types of comments: /* */,
More informationLoops and Conditionals. HORT Lecture 11 Instructor: Kranthi Varala
Loops and Conditionals HORT 59000 Lecture 11 Instructor: Kranthi Varala Relational Operators These operators compare the value of two expressions and returns a Boolean value. Beware of comparing across
More information5. Selection: If and Switch Controls
Computer Science I CS 135 5. Selection: If and Switch Controls René Doursat Department of Computer Science & Engineering University of Nevada, Reno Fall 2005 Computer Science I CS 135 0. Course Presentation
More informationDECISION MAKING STATEMENTS
DECISION MAKING STATEMENTS If, else if, switch case These statements allow the execution of selective statements based on certain decision criteria. C language provides the following statements: if statement
More informationBRANCHING if-else statements
BRANCHING if-else statements Conditional Statements A conditional statement lets us choose which statement t t will be executed next Therefore they are sometimes called selection statements Conditional
More informationIntroduction 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 informationIntroduction to Programming Using Java (98-388)
Introduction to Programming Using Java (98-388) Understand Java fundamentals Describe the use of main in a Java application Signature of main, why it is static; how to consume an instance of your own class;
More informationCS 270 Algorithms. Oliver Kullmann. Binary search. Lists. Background: Pointers. Trees. Implementing rooted trees. Tutorial
Week 7 General remarks Arrays, lists, pointers and 1 2 3 We conclude elementary data structures by discussing and implementing arrays, lists, and trees. Background information on pointers is provided (for
More informationLists. Readings: HtDP, sections 9 and 10. Avoid 10.3 (uses draw.ss). CS 135 Winter : Lists 1
Lists Readings: HtDP, sections 9 and 10. Avoid 10.3 (uses draw.ss). CS 135 Winter 2018 05: Lists 1 Introducing lists Structures are useful for representing a fixed amount of data. But there are many circumstances
More informationLecture 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