Unit Testing -Ranjit Shewale Contents  Scope  Owner  Approach  Conventional approach  Object oriented approach  Tips for the.

Slides:



Advertisements
Similar presentations
Test Design and Documentation. Test Design Test design is to ensure that all requirements are met through a series of test procedures, increasing the.
Advertisements

Defect testing Objectives
Chapter 10 Software Testing
SOFTWARE TESTING. Software Testing Principles Types of software tests Test planning Test Development Test Execution and Reporting Test tools and Methods.
DETAILED DESIGN, IMPLEMENTATIONA AND TESTING Instructor: Dr. Hany H. Ammar Dept. of Computer Science and Electrical Engineering, WVU.
Automated Software Testing: Test Execution and Review Amritha Muralidharan (axm16u)
CMSC 345, Version 11/07 SD Vick from S. Mitchell Software Testing.
Software testing.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 23 Slide 1 Software testing.
Software Testing and Quality Assurance
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 23 Slide 1 Software testing.
CS 425/625 Software Engineering Software Testing
Chapter 18 Testing Conventional Applications
Software Testing Prasad G.
Chapter 11: Testing The dynamic verification of the behavior of a program on a finite set of test cases, suitable selected from the usually infinite execution.
Chapter 13 & 14 Software Testing Strategies and Techniques
Test Design Techniques
Software Testing Verification and validation planning Software inspections Software Inspection vs. Testing Automated static analysis Cleanroom software.
Dr. Pedro Mejia Alvarez Software Testing Slide 1 Software Testing: Building Test Cases.
Extreme Programming Software Development Written by Sanjay Kumar.
Categories of Testing.
Database testing Prepared by Saurabh sinha. Database testing mainly focus on: Data integrity test Data integrity test Stored procedures test Stored procedures.
Let us start from the V-Model Verification Phases Requirements analysis System Design Architecture Design Module Design Coding Validation phases Unit.
Software Testing (Part 2)
Introduction Telerik Software Academy Software Quality Assurance.
CMSC 345 Fall 2000 Unit Testing. The testing process.
Software Testing.
CS4311 Spring 2011 Unit Testing Dr. Guoqiang Hu Department of Computer Science UTEP.
1 Phase Testing. \ 2 Overview of Implementation phase Create Class Skeletons Define Implementation Plan (+ determine subphases) Define Coding Standards.
Testing Basics of Testing Presented by: Vijay.C.G – Glister Tech.
Ch6: Software Verification. 1 Decision table based testing  Applicability:  Spec. is described by a decision table.  Tables describe:  How combinations.
Software Testing Testing types Testing strategy Testing principles.
Software Testing. 2 CMSC 345, Version 4/12 Topics The testing process  unit testing  integration and system testing  acceptance testing Test case planning.
System Test Methods TESTTEME The Test Challenge Bottom Up Testing Strategy Integration Test System Test Types of Testing Unit Test = Code-based Testing.
Copyright 2003 Scott/Jones Publishing Standard Version of Starting Out with C++, 4th Edition Chapter 13 Introduction to Classes.
Unit Testing 101 Black Box v. White Box. Definition of V&V Verification - is the product correct Validation - is it the correct product.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 22 Slide 1 Software Verification, Validation and Testing.
Software Testing Reference: Software Engineering, Ian Sommerville, 6 th edition, Chapter 20.
Software Construction Lecture 18 Software Testing.
Software testing techniques Software testing techniques Object-oriented software testing Presentation on the seminar Kaunas University of Technology.
Software Engineering1  Verification: The software should conform to its specification  Validation: The software should do what the user really requires.
Phase Testing: More examples 1. Review: Selecting Glass box test cases  Determine what to test (select types of coverage)  Create a flowchart for code.
Test Case Designing UNIT - 2. Topics Test Requirement Analysis (example) Test Case Designing (sample discussion) Test Data Preparation (example) Test.
CS451 Lecture 10: Software Testing Yugi Lee STB #555 (816)
PROGRAMMING TESTING B MODULE 2: SOFTWARE SYSTEMS 22 NOVEMBER 2013.
Dynamic Testing.
HNDIT23082 Lecture 09:Software Testing. Validations and Verification Validation and verification ( V & V ) is the name given to the checking and analysis.
1 Phase Testing. Janice Regan, For each group of units Overview of Implementation phase Create Class Skeletons Define Implementation Plan (+ determine.
Software Testing Reference: Software Engineering, Ian Sommerville, 6 th edition, Chapter 20.
Dynamic White-Box Testing What is code coverage? What are the different types of code coverage? How to derive test cases from control flows?
MUTACINIS TESTAVIMAS Benediktas Knispelis, IFM-2/2 Mutation testing.
Testing i. explain the importance of system testing and installation planning;
1 Software Testing. 2 What is Software Testing ? Testing is a verification and validation activity that is performed by executing program code.
Introduction to Software Testing (2nd edition) Chapter 5 Criteria-Based Test Design Paul Ammann & Jeff Offutt
Functional testing, Equivalence class testing
Software Testing.
A scalable approach for Test Automation in Vector CAST/Manage with
SOFTWARE TESTING OVERVIEW
CS1101X Programming Methodology
Chapter 13 & 14 Software Testing Strategies and Techniques
Structural testing, Path Testing
Testing Approaches.
Requirements-Based Testing
UNIT-4 BLACKBOX AND WHITEBOX TESTING
Software testing.
Chapter 10 – Software Testing
Test Case Test case Describes an input Description and an expected output Description. Test case ID Section 1: Before execution Section 2: After execution.
CSE 1020:Software Development
UNIT-4 BLACKBOX AND WHITEBOX TESTING
Chapter 13 & 14 Software Testing Strategies and Techniques 1 Software Engineering: A Practitioner’s Approach, 6th edition by Roger S. Pressman.
Presentation transcript:

Unit Testing -Ranjit Shewale

Contents  Scope  Owner  Approach  Conventional approach  Object oriented approach  Tips for the OOT  Web  Q & A

Scope  When does unit testing start? –As soon as the coding starts; Developer writes the first line of code  When does it end? –When project reaches integration phase on module level –Can also be when say 90% of test cases have status pass

Owner  Who is the owner of unit testing?  Developer –Release criteria needed to release the build/code to test team  Tester –Verify what the piece of code is intended to do –Verify it handles negative/exceptional conditions

Approach - UT  Which options do I have?  Black box –Drivers needed for the same –Techniques as input validation testing, boundary value analysis and category partitioning my be used

Approach- Black Box  Input validation –Validation of the input values passed to a function –Check for regular values, negative values, int values, long values, float values –E.G. Embedded systems needs to be coded with data types “short” instead of “int” and systems expecting huge transaction data may need “long” data types instead of “int” and so forth

Approach- Black Box  Boundary value analysis –The boundary conditions should be considered for the input and passed to the functions –E.G. If requirements checklist for the function mentions a range for a parameter as then boundary conditions as 0,1,2,50,99,100,101 should be considered in unit testing

Approach- Black Box  Category partitioning –An technique to split input values for a function to test into sub domains and handle input on sampling basis for testing –E.G. If requirements checklist for the function mentions a range for a parameter as –40 to100, then the input domain can be split into positive numbers and negative numbers. On sampling basis the test values for unit testing can be (– 40,-10,-1,0,1,25,100)

Approach - UT White box –Drivers needed for the same –Technique as coverage and Conventional debugging can be used –Coverage tools can be used for the same

Approach- White Box  Coverage testing –This includes statement coverage, branch coverage, conditional coverage is covered –Coverage statistics can be one of important release criteria's for the software

Conventional Structural Testing Approach  Structural testing was targeted to the procedural programming practice  This was discussed in earlier slides  The unit for testing was a “function”

Object Oriented Testing Approach  The scope broadens as the object oriented programming was adopted by IT industry  Unit for testing is changed to “class”  Structural testing is sub-set of OOT

Tips for OOT  In addition to the member function testing the following should also be considered –Member variable Effects of change in the value before and after a function is being called E.G. A function may have a pre-condition that member variable “XYZ” must be initialized and have value in a range etc

Tips for OOT –Integration of member functions of the class Sequence of calling member functions E.g. A function “ABC” may have a precondition that it needs a file generated to start processing it and one of the other member say “XYZ” function may be handling this task and hence this condition should be satisfied before function “ABC” is called

Tips for OOT –Inheritance In case of inheritance it is assumed that the base class is already unit tested Testing task of new member functions and member variables Again the function sequencing of the of the base class and new derived class should be considered

Tips for OOT –Polymorphism Function overloading –This can be handled in structural testing manner –E.g. Fn(int) and Fn(float) can be tested using structural approach –Consider the default argument case as well Dynamic binding –Object wise dynamic binding needs to be tested –E.g. If Base::fn{} is pure virtual function and Inherited class IH1::fn{} and IH2:fn{} are inherited classes then function testing of fn{} should be done considering both objects of classes IH1 and IH2

Tips for OOT  Exceptional testing should not be ruled out

Web  The unit can change according to the company and project  Some use unit as “web screen” for testing  Various techniques as Input validation, boundary condition, UI testing are considered as part of testing  Some project even consider the functionality of the web screen as part of unit testing

Q & A