IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How is UNIT TESTING performed


IBM Mainframe Forums -> Mainframe Interview Questions
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
mf_karthik

New User


Joined: 26 Jul 2005
Posts: 55

PostPosted: Wed Aug 03, 2005 7:56 am
Reply with quote

HI
HOW IS UNIT TESTING PERFORMED?
EXPLAIN IT CLEARLY WITH PROCEDURES AND SMALL EXAMPLES
Back to top
View user's profile Send private message
sriteja

New User


Joined: 25 Jul 2005
Posts: 15
Location: Hyderabad

PostPosted: Wed Aug 03, 2005 1:56 pm
Reply with quote

Karthik,

Unit Testing tests a subroutine, module, or class i.e the smallest unit of functional code.
For example say you have a date routine in your cobol program.
Giving test cases and testing for all valid and invalid values of dates you test the date routine.
Say you also have a module in COBOL that accepts data from the JCL via SYSIN. You may want to test how different data (valid and invalid) is being accepted by your cobol program.
So basically Unit testing is testing the smallest functional lines of code.
You can use Xpeditor, File-Aid as tools for unit testing.

Hope this answers your question.

Regards
Sri
Back to top
View user's profile Send private message
EnjoyMF

New User


Joined: 27 May 2005
Posts: 88

PostPosted: Wed Aug 03, 2005 2:00 pm
Reply with quote

hi friend

it would be nice if u can get this information from an working professional directly
************************************************************8
in simple sense
unit testing is nothing but to test ur code by using the testcase that u had written

different input data is given from the input file and then program is checked to see that it is getting the expected output in the output file.
********************************************************88

Unit Testing
The primary goal of unit testing is to take the smallest piece of testable software in the application, isolate it from the remainder of the code, and determine whether it behaves exactly as you expect. Each unit is tested separately before integrating them into modules to test the interfaces between modules. Unit testing has proven its value in that a large percentage of defects are identified during its use.

The most common approach to unit testing requires drivers and stubs to be written. The driver simulates a calling unit and the stub simulates a called unit. The investment of developer time in this activity sometimes results in demoting unit testing to a lower level of priority and that is almost always a mistake. Even though the drivers and stubs cost time and money, unit testing provides some undeniable advantages. It allows for automation of the testing process, reduces difficulties of discovering errors contained in more complex pieces of the application, and test coverage is often enhanced because attention is given to each unit.

For example, if you have two units and decide it would be more cost effective to glue them together and initially test them as an integrated unit, an error could occur in a variety of places:

Is the error due to a defect in unit 1?
Is the error due to a defect in unit 2?
Is the error due to defects in both units?
Is the error due to a defect in the interface between the units?
Is the error due to a defect in the test?
Finding the error (or errors) in the integrated module is much more complicated than first isolating the units, testing each, then integrating them and testing the whole.

Drivers and stubs can be reused so the constant changes that occur during the development cycle can be retested frequently without writing large amounts of additional test code. In effect, this reduces the cost of writing the drivers and stubs on a per-use basis and the cost of retesting is better controlled.
*************************************************************
if time permits check these

en.wikipedia.org/wiki/Unit_testing

radio.weblogs.com/0100190/stories/2002/07/25/sixRulesOfUnitTesting.html

www.testingfaqs.org
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> Mainframe Interview Questions

 


Similar Topics
Topic Forum Replies
No new posts Related to Unit Testing Testing & Performance 2
No new posts Finding Esoteric Unit Names Programma... All Other Mainframe Topics 2
No new posts IMS DB / DB2 simulator for ETL testin... IMS DB/DC 1
No new posts Regression testing of date format con... CLIST & REXX 0
No new posts UNIT=AFF for Easytrieve code JCL & VSAM 7
Search our Forums:

Back to Top