Saturday, December 27, 2014

Methods of Unit Testing

Methods of Unit Testing
A) Static Analysis Testing

B) Dynamic Analysis Testing


A) Static Analysis Testing :-

a) Desk Check method


This is done by the programer to check the logical syntax errors abd deviation from the coding standards.. The Programmer uses paper and pen to verify the Logic of code by jotting down values of data sets and thinking like computer to arrive at possible values.

Example :-


b). Structured Walk Through :

Desk Checks performed with team or peers who scan through the text of the program and explanations try to uncover errors

A structured walkthrough is an organized procedure for a group of peers to review and discuss the technical aspects of software development and maintenance deliverables and outputs.  The major objectives in a structured walkthrough are to find errors and to improve the quality of the product.  Errors typically occur as omissions or contradictions, flaws in logic, or inconsistencies in the output style (e.g., poorly stated requirements and inefficient code).

Structured walkthroughs are not be used to discuss solutions for the errors found.  The basic purpose of a walkthrough is error detection, not error correction.  When the walkthrough is finished, the author of the output is responsible for taking the necessary actions to correct the errors.  The author may hold private conversations with reviewers or conduct follow-up meetings to discuss potential solutions.

Structured walkthroughs are conducted during all phases of the software lifecycle.  Walkthroughs can be conducted in various formats, with various levels of formality, and with different types of participants.

In some cases, it might be useful and expedient to include users in walkthroughs.  Management representatives do not participate in structured walkthroughs.   Regardless of the variations in format and participants, the basic activity (peer review) and the major objectives (find errors and improve quality) of the structured walkthroughs remain the same.


c) Code Inspecton :

The Program is reviewed is by a formal committee . Review is done with formal Checklist

B)  Dynamic Analysis Testing 

a) Black Box Testing

A software testing technique whereby the internal workings of the item being tested are not known by the tester. For example, in a black box test on a software design the tester only knows the inputs and what the expected outcomes should be and not how the program arrives at those outputs. The tester does not ever examine the programming codea nd does not need any further knowledge of the program other than its specifications.

black box testing image

EXAMPLE
A tester, without knowledge of the internal structures of a website, tests the web pages by using a browser; providing inputs (clicks, keystrokes) and verifying the outputs against the expected outcome.


b) White Box Testing

White Box is a software testing method in which the internal structure/design/implementation of the item being tested is known to the tester. The tester chooses inputs to exercise paths through the code and determines the appropriate outputs. Programming know-how and the implementation knowledge is essential. White box testing is testing beyond the user interface and into the nitty-gritty of a system.

This method is named so because the software program, in the eyes of the tester, is like a white/transparent box; inside which one clearly sees.

There are automated tools (like Test tools/ debuggers etc) are available to conduct this type of testing

EXAMPLE

A tester, usually a developer as well, studies the implementation code of a certain field on a webpage, determines all legal (valid and invalid) AND illegal inputs and verifies the outputs against the expected outcomes, which is also determined by studying the implementation code.


c) Gray Testing

It uses both the Black box testing and White Box testing .

Tester applies a limited number of test cases to the internal workings of the software under test. . 

In the remaining part of the grey box testing , one takes a black box approach in applying inputs to 

the software under test and observing the outputs.

No comments:

Post a Comment