Arunkumar Khannur's Software Testing Knowledge Center
   
 

7.3. Unit, Unit Test Case, Unit Test Suite

In structured programming, code uses modular design and is implemented as units. A unit may be regarded as a single callable routine or function or a procedure. In order to test units, we have to write test cases or test suites which are referred to as Unit Test Case or Unit Test Suite.

Unit Test Case (UTC) is the condition designed to test how well execution of a unit of code, called the unit under test, under the following conditions:
  • Procedures external to the module in which the unit under test resides are replaced by stub procedures
  • Global variables are defined, shared memory is loaded and input parameters are passed to the unit under test by a test driver
  • Predetermined test data are used for all file input required by the unit under test
  • The test driver validates behavior of the unit under test, and discrepancies are logged in a file.

During this, behavior of the unit under test is verified when any of the following occur:
  • Global variables changed in unit under test
  • Shared memory changed in unit under test
  • Changes to parameters that were passed to the unit under test
  • Output files produced or modified in the unit under test
  • Values returned by the unit under test

Next higher structure that emerges out of UTCs is Unit Test Suite. Unit Test Suite is the set of unit test cases that is required to fully test a single unit. A Module’s Unit Test Suite is the set of unit tests that is required to fully test all of the units in a module.
 
 
Khannur's Book
Arunkumar Khannur, Software Testing - Techniques and Applications, Published by Pearson Publications, 2011 (ISBN:978-81-317-5836-6; Pages:341 + xxii)
Follow Khannur
         
Khannur's Company
ISQT Process & Consulting Services Pvt. Ltd., Bangalore, INDIA
Khannur's Software Testing Forum
STEP-AUTO Forum
 Contact Khannur
ISQT Process & Consulting Services Pvt. Ltd.
#732, 1st Floor, 12th Main,
3rd Block, Rajajinagar,
Bangalore - 560010, INDIA
Phone: +91 80 23012511
URL: www.isqtinternational.com
Email: khannur@isqtinternational.com
Skype: arun.isqt