Article Categories
» Arts & Entertainment
» Automotive
» Business
» Careers & Jobs
» Education & Reference
» Finance
» Food & Drink
» Health & Fitness
» Home & Family
» Internet & Online Businesses
» Miscellaneous
» Self Improvement
» Shopping
» Society & News
» Sports & Recreation
» Technology
» Travel & Leisure
» Writing & Speaking

  Listed Article

  Category: Articles » Technology » Computers » Article
 

Unit Testing




By Ahamad

Definition - Unit Test can be defined as running one component of a system for testing purposes.

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.


What is Unit Testing?

When we write programs we can not make them perfect from the first time. When you compile your project you face the first test for your application. The compiler checks the syntax and stops if it contains errors. This is a nice assistance but it does not end here. The program may contain bugs, and it CERTANLY contains bugs. Then we have to hunt them down and correct the application so the bug count is low enough. We can not correct all the bugs but we can reduce them to a decent level.So here come the Unit Tests. They help us hunt the bugs by writing tests. So the tests are programs, methods actually. They test every part of our program to see if it works right.


Benefits of Unit Testing

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 two main benefits:
1. 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.
2. 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.


Limitations of Unit Testing

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.

http://testingsoftware.blogspot.com

 
 
About the Author
Ahamad

http://testingsoftware.blogspot.com


Article Source: http://www.simplysearch4it.com/article/10834.html
 
If you wish to add the above article to your website or newsletters then please include the "Article Source: http://www.simplysearch4it.com/article/10834.html" as shown above and make it hyperlinked.



  Some other articles by Ahamad
Risk Driven Software Testing
Whenever there is a lot of testing to be done and not enough time to do the testing, we have to prioritize so that at least the ...

  
  Recent Articles
Microsoft Word. The power is under the hood
by Robert Duval

How To Select The Best Gaming Laptops
by Tim Childree

How To Select The Best Business Laptops
by Tim Childree

High-Tech Computer Rental for Business Promotion
by Michael Braganza

Managing a Worldwide Print Infrastructure from a Single Workstation in a Central Location
by Rick Ferguson

A Sneak Peek Into The World Of Refurbished Laptops
by Javier Fuller

Battery information
by goodbattery

Tell Me About Computers
by Khal Nuwar

Setting Up Your Own Internet Radio Station
by Jason Cole

Understanding Solar Energy
by Anna Stone

Mac FAXstf X Pro Faxing Program for Mac OS X Users
by Nivea David

How to Retrofit a Picture or an Image into Desktop Wallpaper for Your Computer
by Steve Dimeck

Wallpaper Choosing For Good Mood
by Dalvin Rumsey

Software Discounts
by Joe Cohen

Mac:The computer of new age
by Harry Johnson

Apple new iMac line with Intel core 2 Duo
by Monica Craft

Grid Computing
by Sandro Azzopardi

Can't connect to database