© 2012 IBM Corporation Rational Insight | Back to Basis Series Chao Zhang 06-07-2012 Unit Testing.

Slides:



Advertisements
Similar presentations
Testing Relational Database
Advertisements

Test Yaodong Bi.
Test process essentials Riitta Viitamäki,
SOFTWARE TESTING. Software Testing Principles Types of software tests Test planning Test Development Test Execution and Reporting Test tools and Methods.
Verification and Validation
SOFTWARE TESTING. INTRODUCTION  Software Testing is the process of executing a program or system with the intent of finding errors.  It involves any.
T. E. Potok - University of Tennessee Software Engineering Dr. Thomas E. Potok Adjunct Professor UT Research Staff Member ORNL.
Documentation Testing
Illinois Institute of Technology
Testing an individual module
Software Testing. “Software and Cathedrals are much the same: First we build them, then we pray!!!” -Sam Redwine, Jr.
Testing - an Overview September 10, What is it, Why do it? Testing is a set of activities aimed at validating that an attribute or capability.
Introduction to Software Testing
 What is Software Testing  Terminologies used in Software testing  Types of Testing  What is Manual Testing  Types of Manual Testing  Process that.
Issues on Software Testing for Safety-Critical Real-Time Automation Systems Shahdat Hossain Troy Mockenhaupt.
BY RAJESWARI S SOFTWARE TESTING. INTRODUCTION Software testing is the process of testing the software product. Effective software testing will contribute.
Software Testing Test Design and Implementation. Agenda Test Design Test Implementation Test Design Sources Automated Testing 2.
Testing Dr. Andrew Wallace PhD BEng(hons) EurIng
Extreme Programming Software Development Written by Sanjay Kumar.
Introduction to Software Quality Assurance (SQA)
Testing. What is Testing? Definition: exercising a program under controlled conditions and verifying the results Purpose is to detect program defects.
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.
Pragmatic Projects Prepared by Doug Glidden. Pragmatic Projects Pragmatic Teams Ubiquitous Automation Ruthless Testing It’s All Writing Great Expectations.
INFO 637Lecture #81 Software Engineering Process II Integration and System Testing INFO 637 Glenn Booker.
Software Systems Verification and Validation Laboratory Assignment 3 Integration, System, Regression, Acceptance Testing Assignment date: Lab 3 Delivery.
CMSC 345 Fall 2000 Unit Testing. The testing process.
1 Debugging and Testing Overview Defensive Programming The goal is to prevent failures Debugging The goal is to find cause of failures and fix it Testing.
Testing Basics of Testing Presented by: Vijay.C.G – Glister Tech.
Software Development Software Testing. Testing Definitions There are many tests going under various names. The following is a general list to get a feel.
Introduction to Software Testing. Types of Software Testing Unit Testing Strategies – Equivalence Class Testing – Boundary Value Testing – Output Testing.
© 2012 IBM Corporation Rational Insight | Back to Basis Series Chao Zhang Code Review.
TESTING LEVELS Unit Testing Integration Testing System Testing Acceptance Testing.
1 Introduction to Software Testing. Reading Assignment P. Ammann and J. Offutt “Introduction to Software Testing” ◦ Chapter 1 2.
Software Testing Process By: M. Muzaffar Hameed.
Software Development Problem Analysis and Specification Design Implementation (Coding) Testing, Execution and Debugging Maintenance.
CPSC 873 John D. McGregor Session 9 Testing Vocabulary.
Software Engineering1  Verification: The software should conform to its specification  Validation: The software should do what the user really requires.
Testing in Android. Methods Unit Testing Integration Testing System Testing Regression Testing Compatibility Testing Black Box (Functional) White Box.
Software Testing and Quality Assurance 1. What is the objectives of Software Testing?
Test Plan: Introduction o Primary focus: developer testing –Implementation phase –Release testing –Maintenance and enhancement o Secondary focus: formal.
Software Quality Assurance and Testing Fazal Rehman Shamil.
Oman College of Management and Technology Course – MM Topic 7 Production and Distribution of Multimedia Titles CS/MIS Department.
 Software Testing Software Testing  Characteristics of Testable Software Characteristics of Testable Software  A Testing Life Cycle A Testing Life.
1 Phase Testing. Janice Regan, For each group of units Overview of Implementation phase Create Class Skeletons Define Implementation Plan (+ determine.
Testing Overview Software Reliability Techniques Testing Concepts CEN 4010 Class 24 – 11/17.
Software Test Plan Why do you need a test plan? –Provides a road map –Provides a feasibility check of: Resources/Cost Schedule Goal What is a test plan?
Manual Testing Concepts Instructor: Surender. Agenda  Content: 1. Testing Overview I. What is testing II. Who does testing III. When to Start Testing.
Testing Integral part of the software development process.
Powerpoint Templates Page 1 Powerpoint Templates Unit Testing Ari Seppi
CPSC 372 John D. McGregor Module 8 Session 1 Testing.
Laurea Triennale in Informatica – Corso di Ingegneria del Software I – A.A. 2006/2007 Andrea Polini XVII. Verification and Validation.
Software Testing Strategies for building test group
SOFTWARE TESTING Date: 29-Dec-2016 By: Ram Karthick.
Software Engineering (CSI 321)
Testing Tutorial 7.
Software Testing Basics
John D. McGregor Session 9 Testing Vocabulary
Software Verification and Validation
SOFTWARE TESTING OVERVIEW
Software Testing.
John D. McGregor Session 9 Testing Vocabulary
UNIT-1 SOFTWARE TESTING FUNDAMENTALS
Applied Software Implementation & Testing
UNIT-1 SOFTWARE TESTING FUNDAMENTALS
John D. McGregor Session 9 Testing Vocabulary
Introduction to Software Testing
Test Planning Mike O’Dell (some edits by Vassilis Athitsos)
Test Case Test case Describes an input Description and an expected output Description. Test case ID Section 1: Before execution Section 2: After execution.
Overview Activities from additional UP disciplines are needed to bring a system into being Implementation Testing Deployment Configuration and change management.
Presentation transcript:

© 2012 IBM Corporation Rational Insight | Back to Basis Series Chao Zhang Unit Testing

© 2012 IBM Corporation Rational Insight | Back to Basis Series 2 06/19/12 Agenda Overview Unit Test introduction – Objective – Value – Approaches – Test Planning, Test Area and Test Cases – Test Process Unit Test Example Discuss

© 2012 IBM Corporation Rational Insight | Back to Basis Series 3 06/19/12 Overview: Unit Test Scope Unit Testing covers various aspects of verifying the functionality implemented for a feature activity. Debugging Phase Boundary Conditions Error Paths Functional Testing Stability/Memory Leaks Feature Compliance Error Paths Integration Testing Feature Integration Feature Verification FVT/SVTFeature design/Defect fixing Formal Test Capture - Rational Quality Management White/Grey box tests (automated) Grey/Black Box Functional Tests Unit Test

© 2012 IBM Corporation Rational Insight | Back to Basis Series 4 06/19/12 Unit Test Why is it so important? A good way to exercise your API and make sure it's usable and practical. Effective way to catch low level defects in modified code. Feeling good about what you deliver. Deliver the best product possible. Effective way to verify error paths that cannot be verified with the system test. Prevent you from wasting time on bugs that are easily caught and identified at unit test time. Throwing untested functionality "over the wall" is unacceptable.

© 2012 IBM Corporation Rational Insight | Back to Basis Series 5 06/19/12 Unit Test Value Best time to validate the error paths. Find bugs in smaller amount of code in a more controlled environment. Integration with other components is easier when everyone uses same methodology for Unit Test. Proper unit test can deliver reduced costs, increased quality, and better adherence to project schedule. Defects found in unit test are less expensive than those found in system test

© 2012 IBM Corporation Rational Insight | Back to Basis Series 6 06/19/12 Unit Test Testing approaches White Box Testing - Code is tested for execution correctness at a very detailed level. This type of testing often requires the use of tools and simulators to help with the testing. White box testing requires knowledge of and access to the code. Grey Box Testing - Testing is done more at the component level for code execution correctness but also functional correctness. This may require tools and simulators to complete the testing. Black Box Testing - Code is treated as a "black box". Tests are conducted from a functional point of view only for functional correctness against the functionality specified in plan item, enhancement or defect description. The implementation details are irrelevant at this stage. Black box testing does not require knowledge or access to the code.

© 2012 IBM Corporation Rational Insight | Back to Basis Series 7 06/19/12 Unit Test Test Planning Are the functional requirements well documented and understood? It is very important to test components according to provided specifications/requirements. What scope of testing is required? Which hardware and software should be covered? Consider three perspectives when planning a test activity: Isolated testing - testing of a specific component in an isolated matter Off-target testing - simulating the functionality without real h/w On-target testing - a must, testing using the real h/w in the lab environment What metrics or data, if any, need to be prepared? What metrics or data, if any, need to be collected? What codes is being included in the coverage? What codes is being excluded from the coverage?

© 2012 IBM Corporation Rational Insight | Back to Basis Series 8 06/19/12 Unit Test Test Areas Consider what you will be testing and identify which area of your design will be tested. This may include specific software modules or components that will be included in test. Consider the following test plan aspects when determining what tests are needed. These are suggestions and may not apply to all situations: – Ensure all affected user actions/notifications for the component(s) under test are exercised. – Ensure there are no SWERRs (software error reports) emitted under normal circumstances by the component(s) under test. – Exercise all success paths. – Evaluate all boundary conditions. – Exercise all error and exception paths within the code. – Exercise and validate variable initialization

© 2012 IBM Corporation Rational Insight | Back to Basis Series 9 06/19/12 Unit Test Test Cases A test case is a specific set of data and associated procedures (or test script) developed for testing of a particular objective. For example all these paths are exercised – Success tests - Exercise success paths – Error handling tests - Exercise error handling for both critical errors as well as errors that only occur under extreme/rare conditions. – Boundary tests - Exercise all boundary values Test cases should have enough information in it so that it can be run by a person other than the author.

© 2012 IBM Corporation Rational Insight | Back to Basis Series 10 06/19/12 Unit Test Test Process of White Box White Box Testing: Write test cases document Coding your test suite/ test case with some language framework: Junit, CppUnit Running your test suite and test case, check the output to make sure the test results are our expected. If error found, correct and run test case again until the issue is solved.

© 2012 IBM Corporation Rational Insight | Back to Basis Series 11 06/19/12 Unit Test Test Process of Grey/Black Box Grey/Black Box Testing: Write test cases document. Build your personal build or special component jar which will be tested Install your personal build or replace the component jar in an available environment Simulate user normal and exception actions to execute the functionality and make sure the test results are our expected. Test it on different platform or hardware which we need support If error found, correct and repeat test steps until the issue is solved

© 2012 IBM Corporation Rational Insight | Back to Basis Series 12 06/19/12 Unit Test Example Memory Leak of ReqPro DataService - White Box Testing White Box Testing: Create a single project with the new Java class files and make sure there is no compilation error. Prepare the server environment: RequisitePro Write the test cases to cover the following testing scenarios: – Cover all methods of class – Cover all codes path as could as possible – Cover all basic functions – Cover all exception cases – Cover the single thread and multi-thread in concurrence scenario Running test cases and make sure the test results are our expected, if not, correct codes and run again.

© 2012 IBM Corporation Rational Insight | Back to Basis Series 13 06/19/12 Unit Test Example Memory Leak of ReqPro DataService - Black Box Testing Black Box Testing: Create a personal build. Install the personal build and prepare the testing environment. Run the test cases to cover the following scenarios: – Make sure the RePro Dataservice start/stop normally and the basic functions are working. – Make sure the other Dataservices are working. – Simulate the multi-user to retrieve the data from ReqPro DataService and make sure all data can be returned successfully. – Long run to retrieve the data in concurrence scenario, observe the memory changes of RqProx.exe, JVM process and make sure the memory is ok. – Make sure the ETL can be run successfully. – After long run with multi-user scenario and shut to the DataService server, make sure all RqProxy can be existed and the memory can be released – Build exception environment and make sure the DataService work as our expected. – Check the ReqPro DataService logs, Make sure our need information is logged in different log level and the logs are enough if exception or error is happened.

© 2012 IBM Corporation Rational Insight | Back to Basis Series 14 06/19/12 Discussion What's your view about the unit test? What's your problem in your unit test? What's your suggestion about how to do unit test for RRDI/Insight components? What's your suggestion about the test case? What's your suggestion about the test process?

© 2012 IBM Corporation Rational Insight | Back to Basis Series 15 06/19/12

© 2012 IBM Corporation Rational Insight | Back to Basis Series 16 06/19/12 Revision History AuthorDateVersionComment Chao Zhang Initial Draft Chao Zhang Modified by Na Deng's comments