Software QA FYI - SQAFYI

Unit Testing: Why? What? & How?

By:

In this tutorial you will learn about unit testing, various levels of testing, various types of testing based upon the intent of testing, How does Unit Testing fit into the Software Development Life Cycle? Unit Testing Tasks and Steps, What is a Unit Test Plan? What is a Test Case? and Test Case Sample, Steps to Effective Unit Testing

There are various levels of testing:
* Unit Testing
* Integration Testing
* System Testing

There are various types of testing based upon the intent of testing such as:
* Acceptance Testing
* Performance Testing
* Load Testing
* Regression Testing

Based on the testing Techniques testing can be classified as:
* Black box Testing
* White box Testing


How does Unit Testing fit into the Software Development Life Cycle?

This is the first and the most important level of testing. As soon as the programmer develops a unit of code the unit is tested for various scenarios. As the application is built it is much more economical to find and eliminate the bugs early on. Hence Unit Testing is the most important of all the testing levels. As the software project progresses ahead it becomes more and more costly to find and fix the bugs.

In most cases it is the developer’s responsibility to deliver Unit Tested Code.
Unit Testing Tasks and Steps:
Step 1: Create a Test Plan
Step 2: Create Test Cases and Test Data
Step 3: If applicable create scripts to run test cases
Step 4: Once the code is ready execute the test cases
Step 5: Fix the bugs if any and re test the code
Step 6: Repeat the test cycle until the “unit” is free of all bugs What is a Unit Test Plan?
This document describes the Test Plan in other words how the tests will be carried out.
This will typically include the list of things to be Tested, Roles and Responsibilities, prerequisites to begin Testing, Test Environment, Assumptions, what to do after a test is successfully carried out, what to do if test fails, Glossary and so on
What is a Test Case?

Simply put, a Test Case describes exactly how the test should be carried out. For example the test case may describe a test as follows:
Step 1: Type 10 characters in the Name Field
Step 2: Click on Submit
Test Cases clubbed together form a Test Suite

Full article...


Other Resource

... to read more articles, visit http://sqa.fyicenter.com/art/

Unit Testing: Why? What? & How?