No Source Code. EEC 521: Software Engineering. Specification-Based Testing. Advantages

Similar documents
Black Box Testing. EEC 521: Software Engineering. Specification-Based Testing. No Source Code. Software Testing

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

Lecture 15 Software Testing

Chapter 10. Testing and Quality Assurance

Levels of Testing Testing Methods Test Driven Development JUnit. Testing. ENGI 5895: Software Design. Andrew Vardy

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

Levels of Testing Testing Methods Test Driven Development JUnit. Testing. ENGI 5895: Software Design. Andrew Vardy

Software Testing. Lecturer: Sebastian Coope Ashton Building, Room G.18

Ingegneria del Software Corso di Laurea in Informatica per il Management

10. Software Testing Fundamental Concepts

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

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

Topics in Software Testing

Why testing and analysis. Software Testing. A framework for software testing. Outline. Software Qualities. Dependability Properties

Testing. ECE/CS 5780/6780: Embedded System Design. Why is testing so hard? Why do testing?

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

Testing. CMSC 433 Programming Language Technologies and Paradigms Spring A Real Testing Example. Example (Black Box)?

Analysis of the Test Driven Development by Example

Coding and Unit Testing! The Coding Phase! Coding vs. Code! Coding! Overall Coding Language Trends!

Unit Testing and JUnit

Testing. Prof. Clarkson Fall Today s music: Wrecking Ball by Miley Cyrus

Verification and Validation. Ian Sommerville 2004 Software Engineering, 7th edition. Chapter 22 Slide 1

Three General Principles of QA. COMP 4004 Fall Notes Adapted from Dr. A. Williams

Object Oriented Software Design - I

Chapter 8 Software Testing. Chapter 8 Software testing

Software Testing. Software Testing. in the textbook. Chapter 8. Verification and Validation. Verification Techniques

Part 5. Verification and Validation

Software Testing CS 408

F. Tip and M. Weintraub FUNCTIONAL TESTING

Aerospace Software Engineering

Software Testing. Software Testing

Software Engineering

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

Software Testing. Software Testing. in the textbook. Chapter 8. Verification and Validation. Verification and Validation: Goals

Software Testing Interview Question and Answer

Darshan Institute of Engineering & Technology for Diploma Studies

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

CSE 403: Software Engineering, Fall courses.cs.washington.edu/courses/cse403/16au/ Unit Testing. Emina Torlak

LECTURE 8 TEST DESIGN TECHNIQUES - I

Quote by Bruce Sterling, from: A Software Testing Primer, Nick Jenkins

Introduction to Software Testing Chapter 2.4 Graph Coverage for Design Elements Paul Ammann & Jeff Offutt

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

Outline. software testing: search bugs black-box and white-box testing static and dynamic testing

Modern Methods in Software Engineering. Testing.

Computational Systems COMP1209

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

Software Engineering Theory. Lena Buffoni (slides by Kristian Sandahl/Mariam Kamkar) Department of Computer and Information Science

Software Engineering and Scientific Computing

Test suites Obviously you have to test your code to get it working in the first place You can do ad hoc testing (testing whatever occurs to you at

Software Testing. Testing: Our Experiences

CS18000: Programming I

QUIZ #5 - Solutions (5pts each)

An Introduction to Systematic Software Testing. Robert France CSU

Chapter 9. Software Testing

Unit Testing with JUnit and CppUnit

Regression testing. Whenever you find a bug. Why is this a good idea?

Unit Testing and Test Driven Design

International Journal of Computer Engineering and Applications, Volume XII, Special Issue, September 18, ISSN SOFTWARE TESTING

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

Software Engineering Testing and Debugging Testing

Design and Synthesis for Test

Chapter 11, Testing. Using UML, Patterns, and Java. Object-Oriented Software Engineering

Software Engineering

XVIII. Software Testing. Laurea Triennale in Informatica Corso di Ingegneria del Software I A.A. 2006/2007 Andrea Polini

Testing. Christopher Simpkins Chris Simpkins (Georgia Tech) CS 2340 Objects and Design CS / 13

Testing! The material for this lecture is drawn, in part, from! The Practice of Programming (Kernighan & Pike) Chapter 6!

Software Test. Levels of test. Types of test. Regression test The JUnit tool for unit testing Java programs. System test Integration test Unit test

Programming Embedded Systems

Test Case Generation Based on Sequence Diagrams

Verification and Validation. Verification and validation

UNIT-4 Black Box & White Box Testing

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

Black-box Testing Techniques

BDD and Testing. User requirements and testing are tightly coupled

CS 424 Software Quality Assurance & Testing LECTURE 3 BASIC CONCEPTS OF SOFTWARE TESTING - I

International Journal of Computer Engineering and Applications, Volume XII, Special Issue, April- ICITDA 18,

People tell me that testing is

Agile Software Development. Lecture 7: Software Testing

CSE 374 Programming Concepts & Tools. Hal Perkins Fall 2015 Lecture 15 Testing

Want Better Software? TEST it! (and thenwrite it) Tame defects before they appear You Rise/Bugs Fall

Lecture 20: SW Testing Presented by: Mohammad El-Ramly, PhD

UNIT-4 Black Box & White Box Testing

Shree.Datta Polytechnic College,Dattanagar, Shirol. Class Test- I

Program Correctness and Efficiency. Chapter 2

Testing & Debugging TB-1

The testing process. Component testing. System testing

Software processes, quality, and standards White-box testing

Topics. Software Testing Test Driven Development Black Box Testing Unit Testing White Box Testing Coverage Testing Software Debugging

Manuel Oriol, CHCRC-C, Software Testing ABB

Software Quality Assurance. David Janzen

Test Automation. Fundamentals. Mikó Szilárd

(See related materials in textbook.) CSE 435: Software Engineering (slides adapted from Ghezzi et al & Stirewalt

PES INSTITUTE OF TECHNOLOGY- BANGALORE SOUTH CAMPUS

What's that? Why? Is one "better" than the other? Terminology. Comparison. Loop testing. Some experts (e.g. Pezze & Young) call it structural testing

1 Visible deviation from the specification or expected behavior for end-user is called: a) an error b) a fault c) a failure d) a defect e) a mistake

Integration Unit Testing on SAP NetWeaver Application Server

Violations of the contract are exceptions, and are usually handled by special language constructs. Design by contract

Software Engineering I (02161)

Quality Assurance in Software Development

Final Exam CISC 475/675 Fall 2004

Transcription:

No Source Code : Software Testing Black-Box Testing Test-Driven Development No access to source code So test cases don t worry about structure Emphasis is only on ensuring that the contract is met Specification-Based Testing Advantages Specification Operation op Pre: X Post: Y Specification- Based Test Case Design Test Case 1 Input: x1 (sat. X) Exp. Output: y2 Test Case 2 Input: x2 (sat. X) Exp. Output: y2 Scalable; not dependent on size of code Testing needs no knowledge of implementation Tester and developer can be truly independent of each other Tests are done with requirements in mind Does not pardon inconsistencies in the spec Test cases can be developed in parallel with code

Disadvantages Test size will have to be small Specs must be clear, concise, and correct May leave many program paths untested Weighting of program paths is not possible Lot more research on white-box testing Equivalence Partitioning Input data for a program unit usually falls into a number of partitions e.g. all negative integers, zero, all positive numbers Each partition of input data makes the program behave in a similar way Two test cases based on members from the same partition is likely to reveal the same bugs By identifying and testing one member of each partition we gain 'good' coverage with 'small' number of test cases Testing one member of a partition should be as good as testing any member of the partition Test Case Design Examine pre-condition, and identify equivalence classes Enumerate possible inputs such that all classes are covered Apply the specification to input to write down expected output Equivalence Partitioning Example: for binary search the following partitions exist Inputs that conform to pre-conditions Inputs where the precondition is false Inputs where the key element is a member of the array Inputs where the key element is not a member of the array Pick specific conditions of the array The array has a single value Array length is even Array length is odd

Boundary Value Analysis Arises from the fact that most program fail at input boundaries Suppose system asks for a number between 100 and 999 inclusive The boundaries are 100 and 999 We therefore test for values 99 100 101 998 999 1000 Generating Test Cases for a Complete System Simple brute force generation of test cases is sub-optimal How do you know you have enough? How do you know if you re doing too much? Lower boundary upper boundary Example Test case 1: // Sequence public void Add(int pos, int item) /* Requires 0 <= pos <= self Ensures there exists a, b: String : #Self = a*b and a = pos and Self = a * <item> * b */ Input: s = <1, 1, 2, 5>, pos = 3, item = 3 Satisfies precondition: 0 <= pos <= s Expected output: s = <1, 1, 2, 3, 5> A Systematic Approach Modeling approach can vary Test case generation can be automated in some cases

Independently Testable Features Different test cases for different features Simplifies test generation Simplifies fault location Here s where modular design specs really help But the lines of modularity will be different Will generally include several units Test Case Spec Generation Suitably combining values for all inputs of the functional unit under test Cartesian product of enumerated values Combining properties of formal models Brute force ain t gonna work Five inputs, six values each 6 5 = 7776 Modeling and/or Representative Values If the spec is model-based, this is a trivial step Use equivalence partitioning in identifying representative values Two extremes Directly enumerating rep values based on informal spec Formal model that describes rep values based on properties xunit: Unit Testing Frameworks Several tools exist for behavioral testing Junit is one such - for unit testing Java programs Automatically generates stubs for methods you want to test Tester can then write test cases, and execute them

Test-Driven Development Keep the Bar Green! Test first strategy Test cases are written by the programmer Test cases are written as executable Java-code Test cases can be invoked by a single command All test cases should be 100% OK, before a change can be considered done The concept has been implemented in many languages Test cases from different sources can be combined TDD with xunit Keep the Bar Green!

Advantages of TDD Take small steps when writing software Producing test cases on-the-fly Produce documentation on the fly Writing test cases early forces loosely-coupled design The act of writing a unit test is more an act of design than of verification. It is also more an act of documentation than of verification. The act of writing a unit test closes a remarkable number of feedback loops, the least of which is the one pertaining to verification of function [Martin, Newkirk, and Koss, 2003] TDD: Code and Test in Either Order Analysis Design Code Tests Verification Analysis Design Code Tests Verification TDD: Test, Early, Often, and Automated TDD and XP Defects Testing TDD is an integral part of Extreme Programming XP requires the creation of Test Plan along with code Main form of documentation Ten-Minute Build Continuous Integration