Creative Jar Blog RSS Feed

What is Unit Testing.

November 3, 2008 10:35 by Andrey

All tests have been created with one aim, to improve the quality of program code, to make applications and systems more reliable and stable. Recently I've been looking for short and clear explanation of what is Unit Testing.

Unit testing is a software development process in which the smallest testable parts of an application, called units, are individually and independently scrutinized for proper operation. Unit testing is often automated but it can also be done manually. This testing mode is a component of Extreme Programming (XP), a pragmatic method of software development that takes a meticulous approach to building a product by means of continual testing and revision.

In our applications with n-tier architecture - the smallest parts could be Business Logic Layer components which obviously can be tested automatically.

Unit testing involves only those characteristics that are vital to the performance of the unit under test. This encourages developers to modify the source code without immediate concerns about how such changes might affect the functioning of other units or the program as a whole. Once all of the units in a program have been found to be working in the most efficient and error-free manner possible, larger components of the program can be evaluated by means of integration testing.

Notice that not everything should be tested under the Unit Tests first of all because of time restrictions. It may take a lot of hours to discover all possible scenarios and develop unit tests for them. Extreme Programming and Agile methodologies require quick reaction from the team members on the new changes of the developing project. However don't forget to keep testing documented as it can save a lot of time after amending some parts later.

Unit testing can be time-consuming and tedious. It demands patience and thoroughness on the part of the development team. Rigorous documentation must be maintained. Unit testing must be done with an awareness that it may not be possible to test a unit for every input scenario that will occur when the program is run in a real-world environment.

As in the real-world anything done by a human hand can contain a small mistake. So if you find something important that wasn't covered by Unit Tests just add it. As you can see, Unit Tests can't cover all components of the system, so there are other methodologies which help testers complete their work better.

Original text was taken from http://searchsoftwarequality.techtarget.com/sDefinition/0,,sid92_gci1243425,00.html


Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Tags:
Categories: Technical
Actions: E-mail | Permalink | Comments (0) | Comment RSSRSS comment feed

Calendar

November 2008
SuMoTuWeThFrSa
2627282930311
2345678
9101112131415
16171819202122
23242526272829
30123456