CS223: Software Engineering Lecture 19: Unit Testing.

Slides:



Advertisements
Similar presentations
Unit-Testing Presented by Benny Pasternak November 2005 Program testing can be used to show the presence of bugs, but never to show their absence! - Edsger.
Advertisements

SPL/2010 Test-Driven Development (TDD) 1. SPL/
Database System Concepts and Architecture
COMPSCI 105 S Principles of Computer Science 12 Abstract Data Type.
T. E. Potok - University of Tennessee Software Engineering Dr. Thomas E. Potok Adjunct Professor UT Research Staff Member ORNL.
C++ Sets and Multisets Set containers automatically sort their elements automatically. Multisets allow duplication of elements whereas sets do not. Usually,
Introduction to Structured Query Language (SQL)
1 Software Testing and Quality Assurance Lecture 21 – Class Testing Basics (Chapter 5, A Practical Guide to Testing Object- Oriented Software)
CS 290C: Formal Models for Web Software Lecture 10: Language Based Modeling and Analysis of Navigation Errors Instructor: Tevfik Bultan.
Introduction to Structured Query Language (SQL)
Introduction to Structured Query Language (SQL)
1 ES 314 Advanced Programming Lec 2 Sept 3 Goals: Complete the discussion of problem Review of C++ Object-oriented design Arrays and pointers.
Chapter 8 Physical Database Design. McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved. Outline Overview of Physical Database.
Advance Unit Test, Part V -Unit Test Patterns By Marc Clifton Presentation By Yasir Ibrahim.
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Slide 1- 1.
Chapter 13 & 14 Software Testing Strategies and Techniques
Topics Covered: Data preparation Data preparation Data capturing Data capturing Data verification and validation Data verification and validation Data.
Testing. Definition From the dictionary- the means by which the presence, quality, or genuineness of anything is determined; a means of trial. For software.
1 Software Testing (Part-II) Lecture Software Testing Software Testing is the process of finding the bugs in a software. It helps in Verifying and.
Modular Programming Chapter Value and Reference Parameters t Function declaration: void computesumave(float num1, float num2, float& sum, float&
CMSC 345 Fall 2000 Unit Testing. The testing process.
ITEC224 Database Programming
Introduction: Databases and Database Users
Computer Measurement Group, India Optimal Design Principles for better Performance of Next generation Systems Balachandar Gurusamy,
Introduction CS 3358 Data Structures. What is Computer Science? Computer Science is the study of algorithms, including their  Formal and mathematical.
Physical Database Design Chapter 6. Physical Design and implementation 1.Translate global logical data model for target DBMS  1.1Design base relations.
1 Welcome: To the second learning sequence “ Data Base (DB) and Data Base Management System (DBMS) “ Recap : In the previous learning sequence, we discussed.
Lecture Set 14 B new Introduction to Databases - Database Processing: The Connected Model (Using DataReaders)
SQL Server 7.0 Maintaining Referential Integrity.
Lecture 12 Designing Databases 12.1 COSC4406: Software Engineering.
Testing Workflow In the Unified Process and Agile/Scrum processes.
XRules An XML Business Rules Language Introduction Copyright © Waleed Abdulla All rights reserved. August 2004.
111 © 2002, Cisco Systems, Inc. All rights reserved.
ISV Innovation Presented by ISV Innovation Presented by Business Intelligence Fundamentals: Data Cleansing Ola Ekdahl IT Mentors 9/12/08.
1 CS 350 Data Structures Chaminade University of Honolulu.
1 CS 430 Database Theory Winter 2005 Lecture 16: Inside a DBMS.
Introduction CS 3358 Data Structures. What is Computer Science? Computer Science is the study of algorithms, including their  Formal and mathematical.
Architectural Patterns Support Lecture. Software Architecture l Architecture is OVERLOADED System architecture Application architecture l Architecture.
Chapter 1 Introduction to Databases. 1-2 Chapter Outline   Common uses of database systems   Meaning of basic terms   Database Applications  
6 1 Lecture 8: Introduction to Structured Query Language (SQL) J. S. Chou, P.E., Ph.D.
Chapter 38 Persistence Framework with Patterns 1CS6359 Fall 2011 John Cole.
Copyright 2006 Prentice-Hall, Inc. Essentials of Systems Analysis and Design Third Edition Joseph S. Valacich Joey F. George Jeffrey A. Hoffer Chapter.
Database Systems Design, Implementation, and Management Coronel | Morris 11e ©2015 Cengage Learning. All Rights Reserved. May not be scanned, copied or.
Configuration Management and Change Control Change is inevitable! So it has to be planned for and managed.
Unit Tests Руслан Трифонов Omegasoft Ltd.. Съдържание 1.Въведение 2.Unit test patterns 2.1. Pass/fail patterns 2.2. Collection management patterns 2.3.
CIS/SUSL1 Fundamentals of DBMS S.V. Priyan Head/Department of Computing & Information Systems.
Introduction Database integral part of our day to day life Collection of related database Database Management System : software managing and controlling.
1 CSCD 326 Data Structures I Software Design. 2 The Software Life Cycle 1. Specification 2. Design 3. Risk Analysis 4. Verification 5. Coding 6. Testing.
Database Management Systems (DBMS)
Design Patterns Software Engineering CS 561. Last Time Introduced design patterns Abstraction-Occurrence General Hierarchy Player-Role.
Physical Database Design Purpose- translate the logical description of data into the technical specifications for storing and retrieving data Goal - create.
Chapter 8 Physical Database Design. Outline Overview of Physical Database Design Inputs of Physical Database Design File Structures Query Optimization.
Test Case Designing UNIT - 2. Topics Test Requirement Analysis (example) Test Case Designing (sample discussion) Test Data Preparation (example) Test.
Lecture 4 Mechanisms & Kernel for NOSs. Mechanisms for Network Operating Systems  Network operating systems provide three basic mechanisms that support.
Copyright © 2009 Pearson Education, Inc. Publishing as Prentice Hall Chapter 9 Designing Databases 9.1.
March 1, 2004CS WPI1 CS 509 Design of Software Systems Lecture #6 Monday, March 1, 2004.
Introduction to Operating Systems Prepared by: Dhason Operating Systems.
Motivation FACE architecture encourages modularity of components on data boundaries Transport Services Segment interface is centered on sending and receiving.
CS223: Software Engineering Lecture 13: Software Architecture.
CS223: Software Engineering Lecture 21: Unit Testing Metric.
SOFTWARE TESTING LECTURE 9. OBSERVATIONS ABOUT TESTING “ Testing is the process of executing a program with the intention of finding errors. ” – Myers.
SOFTWARE TESTING AND QUALITY ASSURANCE. Software Testing.
(1) Organize information processing centers environment, the various functions and details Electronic Data Processing (EDP): can refer to the use of automated.
Chapter 6 - Database Implementation and Use
CS223: Software Engineering
Behavioral Design Patterns
Chapter 13 & 14 Software Testing Strategies and Techniques
Unit Test Pattern.
Team Project, Part II NOMO Auto, Part II IST 210 Section 4
Chapter 13 & 14 Software Testing Strategies and Techniques 1 Software Engineering: A Practitioner’s Approach, 6th edition by Roger S. Pressman.
Presentation transcript:

CS223: Software Engineering Lecture 19: Unit Testing

Recap Testing Types of testing Unit testing Test patterns

Objective After completing this lecture students will be able to Identify test pattern to be used in their project Apply appropriate test pattern while writing the unit test plan

Performance Patterns Used to test non functional requirements as performance and resource usage Performance-Test Pattern

Data Driven Test Patterns Patterns which enable testing units with a broad range of input output pairs Simple-Test-Data Pattern Data-Transformation-Test Pattern

Unit Testing The focus is the module a programmer has written Most often UT is done by the programmer himself UT will require test cases for the module UT also requires drivers to be written to actually execute the module with test cases Besides the driver and test cases, tester needs to know the correct outcome as well

Simple-Test-Data Pattern Reduces complexity of Parameter-Range unit by separating test data from the test. Test data is generated and modified independent of the test Results are supplied with the data set. Candidates for this pattern: Checksum Calculations, algorithims, etc… Data Set Input Output Unit TestVerify Result Computation Code

Data-Transformation-Test Pattern Works with data in which a qualitative measure of the result must be performed. Typically applied to transformation algorithms such as lossy compression Transformation code Unit test Validation Measurement Input test data

Data Transaction Patterns Patterns embracing issues of data persistence and communication Simple-Data-I/O Pattern Constraint Data Pattern The Rollback Pattern

Simple-Data-I/O Pattern Verifies the read/write functions of the service Service Write test Read Test

Constraint Data Pattern Adds robustness to Simple-Data-I/O pattern by o Testing more aspects of the service o Any rules that the service may incorporate Unit test verifies the service implementation itself For example, DB schema, web service, etc… Nullable Unique Default value Foreign key Cascading update Cascading delete Constraints Write test Service

Rollback Pattern Verifies rollback correctness Most transactional unit tests should incorporate ability to rollback dataset to known state In order to undo test side effects Write test Service Write test Rollback

Collection Management Patterns Used to verify that the code is using the correct collection Collection-Order Pattern Enumeration Pattern Collection-Constraint Pattern Collection-Indexing Pattern

Collection-Order Pattern Verifies expected results when given an unordered list The test validates that the result is as expected o Unordered, ordered or same sequence as input Provides implementer with information on how the container manages the collections Unordered data Code Containing Collection Unordered Sequenced Ordered

Enumeration Pattern Verifies issues of enumeration or collection traversal Important test when connections are non-linear. o E.g. collection tree nodes Edge conditions (past first or last item) are also important to test Edge test Code Containing Collection Enumerator (FWD, REV) Expected datum Collection

Collection-Constraint Pattern Verifies that the container handles constraint violations o Null values and duplicate keys Typically applies to key-value pair collections Write test Collection container Nullable Unique Constraints

Collection-Indexing Pattern Verifies and documents indexing methods that the collection must support – by index and/or by key Verifies that update and delete transactions that utiilise indexing are working properly and are protected against missing indexes Write test Collection container Index Key Out of bound index Update/ Delete Index Index test

Performance-Test Pattern Types of performance that can be measured: o Memory usage (physical, cache, virtual) Resource (handle) utilization Disk utilization (physical, cache) Algorithm Performance (insertion, retrieval) Metric at Start Code Metric at End Pass criteria Pass Fail

Pattern Summary Unit Test patterns cover broad aspects of development; not just functional May promote unit testing to become a more formal engineering discipline Helps identify the kind of unit tests to write, and its usefulness. Allows developer to choose how detailed the unit tests need to be

Some Best Practices Naming standards for unit tests Test coverage and testing angles When should a unit test be removed or changed? Tests should reflect required reality What should assert messages say? Avoid multiple asserts in a single unit test Mock Objects Usage Making tests withstand design and interface changes – remove code duplication

Thank you Next Lecture: Unit Test Metrics