What is Unit Testing?

Unit Testing is the testing of individual software components or modules. It is the foremost level of software testing and is commonly performed prior to integration testing.
Unit testing performed in the implementation phase can result in significant gains in software quality. If unit testing is done properly, testing phases done later on will be more successful. Unit testing is considered the job of developers only and test engineers need not know about Unit testing. But this is not the case, Unit testing is as important for test engineers as it is for developers.

Developers generally write the unit test cases but it is also important for the testers to understand them. Tester’s understanding of the framework and unit testing can certainly help him/her in designing the flow for unit test cases, generating test data and making good reports. All these activities will ultimately help a tester in the long run as product quality will increase significantly because of the efforts a tester put in on the unit testing.

Advantage/Benefits of Unit Testing

  • Unit Testing plays a major role in the total testing efforts.
  • It allows being able to test parts of a project with out waiting for the other parts to be available.
  • Achieve parallelism in testing by being able to test and fix problems simultaneously by many engineers.
  • Be able to detect and remove defects at a much less cost compared to other later stages of testing.
  • Be able to take advantage of a number of formal testing techniques available for unit testing.
  • Simplify debugging by limiting to a small unit the possible code areas in which to search for bugs.
  • Be able to test internal conditions that are not easily reached by external inputs in the larger integrated systems (for example, exception conditions not easily reached in normal operation).
  • Be able to achieve a high level of structural coverage of the code.
  • Avoid lengthy compile-build-debug cycles when debugging difficult problems.
  • Unit testing is more cost effective compared to the other stages of testing.

Demerits of Unit Testing:-

  • Testing can be monotonous, boring and repetitive at this level.
  • Poor Documentation of Test cases may be there.
  • Coding Drivers and Stubs.
  • Informal testing process.
  • Poor Regression Testing.
  • Lack of Complete Testing tools.

Gray box testing

Gray box testing is a software testing technique that uses a combination of black box testing and white box testing. Gray box testing is not black box testing, because the tester does know some of the internal workings of the software under test.

Gray box testing is a powerful idea. The concept is simple; if one knows something about how the product works on the inside, one can test it better, even from the outside. Gray box testing is not to be confused withwhite box testing ; i.e. a testing approach that attempts to cover the internals of the product in detail. Gray box testing is a test strategy based partly on internals. The testing approach is known as gray box testing, when one does have some knowledge, but not the full knowledge of the internals of the product one is testing.

White box testing

White box testing strategy deals with the internal logic and structure of the code. White box testing is also called as glass box testing, structural testing, open box testing or clear box testing. The tests written based on the white box testing strategy incorporate coverage of the code written, branches, paths, statements and internal logic of the code etc.

In order to implement white box testing, the tester has to deal with the code and hence is needed to possess knowledge of coding and logic i.e. internal working of the code. White box test also needs the tester to look into the code and find out which unit/statement/chunk of the code is malfunctioning.

Advantages of White box testing are:

* As the knowledge of internal coding structure is prerequisite, it becomes very easy to find out which type of input/data can help in testing the application effectively.

* The other advantage of white box testing is that it helps in optimizing the code

* It helps in removing the extra lines of code, which can bring in hidden defects.

Disadvantages of white box testing are:

* As knowledge of code and internal structure is a prerequisite, a skilled tester is needed to carry out this type of testing, which increases the cost.

* And it is nearly impossible to look into every bit of code to find out hidden errors, which may create problems, resulting in failure of the application.

Following techniques can be applied in white box testing:-

* Statement Coverage Testing:- The percentage of executable statements that have been exercised by a est suite.100% decision coverage doesnot gurantee 100% decision coverage.

* Decision Coverage Testing:- The percentage of decision outcomes that have been exercised by a test suite. 100% decision coverage implies both 100% branch coverage and 100% statement coverage

* Condition Coverage Testing:- The percentage of condition outcomes that have been exercised by a test suite. 100% condition coverage requires each single condition in every decision statement to be tested as True and False.

* Branch Coverage Testing:- The percentage of branches that have been exercised by a test suite. 100% branch coverage implies both 100% decision coverage and 100% statement coverage.

* Code coverage Testing:- An analysis method that determines which parts of the software have been executed (covered) by the test suite and which parts have not been executed, e.g. statement coverage, decision coverage or condition coverage.

Black Box Testing

Black Box Testing refers to testing without knowledge of the internal workings of the system being tested. For example, when black box testing is applied to software engineering, the tester would only know the “legal” inputs and what the expected outputs should be, but not how the program actually arrives at those outputs.

Black box testing is also known as behavioral Testing since only the external behaviors of the program are evaluated and analyzed.

Only input for test engineer in this type of testing is requirement document and functionality of system which you get by working with the system.

Purpose of black box testing is to

* Make sure that system is working in accordance with the system requirement.

* Make sure that system is meeting user expectation.

The following are the most famous/frequently used Black Box Testing Techniques/Types.

* Equivalence Partitioning:- Equivalence partitioning is a black box testing method that divides the input domain of a pprogram into classes of data from which test cases can be derived. EP can be defined according to the following guidelines:

o If an input condition specifies a range, one valid and one two invalid classes are defined.

o If an input condition requires a specific value, one valid and two invalid equivalence classes are defined.

o If an input condition specifies a member of a set, one valid and one invalid equivalence class are defined.

o If an input condition is Boolean, one valid and one invalid class are defined.

* Boundary Value Analysis:- Boundary Valve Analysis (BVA) is a test case design technique that complements equivalence partitioning. Rather than selecting any element of an equivalence class, BVA leads to the selection of test cases at the “edges” of the class. Rather than focusing solely on input conditions, BVA derives test cases from the output domain as well.Guidelines for BVA are similar in many respects to those provided for equivalence partitioning.

Software Testing Life Cycle

Software Testing, being an important part of any project has it’s own life cycle.

Software Testing Life Cycle is divided into following Phases:

* Proposal/Contract.
                     –Analyze scope of project, Prepare Contract, Review of Contract, Release.

                     –Identify Test Requirements and risk assessment.
                     –Identify Resources.
                     –Project Plan and test strategy.

* Testing Requirements Specification (TRS) Design.
                     –Product requirements document.

                     –Identify acceptance criteria.
                     –Document product Definition, Testing Strategies.
                     –Define problem reporting procedures.

*Designing Phase
                     –Generate Test plans.

                     –Schedule the testing process.
                     –Setup test environment.
                     –High level test plan.
                     –Design Test Cases, define expected results.
                     –Decide if any set of test cases to be automated.
                     –Prepare Traceability matrix.
* Testing.
                     –Testing – Initial test cycles, bug fixes and re-testing.

                     –Final Testing and Implementation.
                     –Setup database to track components of the automated testing system, i.e. reusable modules.
                     –Verify results.
                     –Defect management

* Inspection and Release.
                     –Evaluate Testing activities

                     –Final Review of Testing.
                     –Metrics to measure improvement

* Client Acceptance

                     –Replication of Product Product Delivery Records Submission Client Sign-off .

Types of Software Testing

There are different types of Software Testing which can be defined under different categories. The most common types of software testing are are as follows. (Click at the link to know more)

On the basis of time testing is executed in the Software Development Life Cycle:-

On the basis of knowledge of application /system to the tester:-

On the basis of the purpose of Software Testing:-

  • Functional Testing
  • Non Functional Testing

Software Testing Definition

Welcome testers!!! to the world of software testing.
Here, we will try and share everything about Software Testing.

According to the classic definition of Myers “Software Testing is the process of executing a program or system with the intent of finding errors.

There are different versions of definitions available. Some of them are:
  • Testing is ‘questioning’ a product in order to ‘evaluate’ it” ~ James Bach
  • Testing is a process of gathering information by making observations and comparing them to expectations. ~ Dale Emery and Elisabeth Hendrickson
  • A test is an experiment designed to reveal information, or answer a specific question, about the software or system. ~ Dale Emery and Elisabeth Hendrickson

For me, I would say that Software testing is the process of evaluation a software application/project to detect and report differences between given input and expected output in order to make sure that it meets the customer requirements.


 Thus, Software Testing can also be defined as the activity or process which involves verification, validation of a software program to find out if it meets the business and technical specifications of requirements and providing a detailed defect report at the end of every iteration.