Share the Experience and Exchange Ideas
German | French | Portugese | Italian


 
Software Testing
 
  • Testing Forum
  • Introduction
  • Testing Start Process
  • Testing Stop Process
  • Testing Strategy
  • Testing Plan
  • Risk Analysis
  • Software Testing Life Cycle
  • Test Management
  • A-Z Knowledge
  • Software Listings
  •  
    Software Testing Types
     
  • Static Testing
  • Dynamic Testing
  • Blackbox Testing
  • Whitebox Testing.
  • Unit Testing.
  • Requirements Testing.
  • Regression Testing.
  • Error Handling Testing.
  • Manual support Testing.
  • Intersystem Testing.
  • Control Testing.
  • Parallel Testing.
  • Volume Testing.
  • Stress Testing.
  • Performance Testing.
  •  
    Testing Tools
     
  • Win Runner
  • Load Runner
  • Test Director
  • Silk Test
  • Test Partner
  •  
    Interview Question
     
  • Win Runner
  • Load Runner
  • Silk Test
  • Test Director
  • General Testing Question
  •  
    Resources
     
  • Testing Forum
  • Downloads
  • E-Books
  • Jobs
  • Testing Interview Questions
  • Testing Tools Questions
  •    
     

    Unit Testing



     


    In computer programming, a unit test is a method of testing the correctness of a particular module of source code.

    The idea is to write test cases for every non-trivial function or method in the module so that each test case is separate from the others if possible. This type of testing is mostly done by the developers.

    Benefits

    The goal of unit testing is to isolate each part of the program and show that the individual parts are correct. It provides a written contract that the piece must satisfy. This isolated testing provides four main benefits:

    Encourages change

    Unit testing allows the programmer to refactor code at a later date, and make sure the module still works correctly (regression testing). This provides the benefit of encouraging programmers to make changes to the code since it is easy for the programmer to check if the piece is still working properly.

    Simplifies Integration

    Unit testing helps eliminate uncertainty in the pieces themselves and can be used in a bottom-up testing style approach. By testing the parts of a program first and then testing the sum of its parts will make integration testing easier.

    Documents the code

    Unit testing provides a sort of "living document" for the class being tested. Clients looking to learn how to use the class can look at the unit tests to determine how to use the class to fit their needs.

    Separation of Interface from Implementation

    Because some classes may have references to other classes, testing a class can frequently spill over into testing another class. A common example of this is classes that depend on a database; in order to test the class, the tester finds herself writing code that interacts with the database. This is a mistake, because a unit test should never go outside of its own class boundary. As a result, the software developer abstracts an interface around the database connection, and then implements that interface with their own Mock Object. This results in loosely coupled code, thus minimizing dependencies in the system.

    Limitations

    It is important to realize that unit-testing will not catch every error in the program. By definition, it only tests the functionality of the units themselves. Therefore, it will not catch integration errors, performance problems and any other system-wide issues. In addition, it may not be trivial to anticipate all special cases of input the program unit under study may receive in reality. Unit testing is only effective if it is used in conjunction with other software testing activities.

    Unit Testing - Software Unit Testing, Tools, Research Topics, Toolkits, Extreme Programming Unit Testing


    Recommended Resources
    • Testing Interview Questions - http://www.coolinterview.com/type.asp
    • Testing Tools Interview Questions - http://www.coolinterview.com/type.asp
    • What is Software Testing?- http://en.wikipedia.org/wiki/Software_testing
    • Software QA & Testing Resource Center- http://www.softwareqatest.com/
    • Testing Faqs- http://www.testingfaqs.org/

    Get Free Software Testing eBook when you join One Stop Testing!
    A D V E R T I S E M E N T

     

     

     

       
    A D V E R T I S E M E N T

       


    Home | Forum | Contact Us | Sitemap

    Vyom Network : Free SMS, GRE, GMAT, MBA | Online Exams | Freshers Jobs | Software Downloads | Programming & Source Codes | Free eBooks | Job Interview Questions | Free Tutorials | Jokes, Songs, Fun | Free Classifieds | Free Recipes | Bangalore Info | GATE Preparation | MBA Preparation | SAP Info
    Sitemap | Sitemap (XML)

    The site is maintained by Vyom Technosoft Pvt. Ltd.
    Job Interview Questions | Placement Papers | SMS Jokes | C++ Interview Questions | C Interview Questions