Showing posts with label Software Engineering. Show all posts
Showing posts with label Software Engineering. Show all posts

Friday 30 September 2011

Software Testing Technique


White-Box testing / Glass-Box testing :
 White box testing (a.k.a. clear box testing, glass box testing, transparent box testing, or structural testing) is a method of testing software that tests internal structures or workings of an application, as opposed to its functionality (i.e. black-box testing). In white-box testing an internal perspective of the system, as well as programming skills, are required and used to design test cases. The tester chooses inputs to exercise paths through the code and determine the appropriate outputs.
·         Examines the fundamental aspect of the system with complete information and access to the internal logical structure, code and algorithms.
·         Logical paths are tested. Test cases which tests the loops (DO conditions (IF STATEMENTS) are explicitly designed and used to test the logical paths.
·         Guarantee that all independent paths within a module have been exercised at least once.
·         Exercise internal data structure to ensure their validity.

Black box testing:
Black-box testing is also called BEHAVIORAL TESTING. It is a method of software testing that tests the functionality of an application as opposed to its internal structures or workings (see white-box testing). Specific knowledge of the application's code/internal structure and programming knowledge in general is not required. Test cases are built around specifications and requirements, i.e., what the application is supposed to do. It uses external descriptions of the software, including specifications, requirements, and design to derive test cases. These tests can be functional or non-functional, though usually functional. The test designer selects valid and invalid inputs and determines the correct output. There is no knowledge of the test object's internal structure.
This method of test can be applied to all levels of software testing: unit, integration, functional, system and acceptance. It typically comprises most if not all testing at higher levels, but can also dominate unit testing as well

Verification and Validation (V&V) is the process of checking that a software system meets specifications and that it fulfills its intended purpose. It is normally part of the software testing process of a project.
  • Verification: The process of evaluating software to determine whether the products of a given development phase satisfy the conditions imposed at the start of that phase.
  • Validation: The process of evaluating software during or at the end of the development process to determine whether it satisfies specified requirements.  
  • Validation: “are we building the right product?”
  • Verification: “are we building the product right?”
            ‘Unit testing’ focuses on testing each unit of the code.
Unit testing -- focuses on the smallest element of software design  viz. the module.
             Corresponds to class testing in the OO context.
Makes heavy use of white-box testing.

Integration testing
Integration testing’ focuses on testing the integration of “units of code” or components.
Each‘ level of testing builds on the previous level.
A systematic approach for constructing program structure while conducting tests to uncover errors associated with interfacing.
Incremental integration - program is constructed and tested in small segments.
o   Top-Down Integration testing
o   Bottom-Up Integration testing 
o   Top-down testing

Top-Down Approach:
Begin construction and testing with main module.
             Stubs are substituted for all subordinate modules.
Subordinate stubs are replaced one at a time by actual modules. 
Tests are conducted as each module is integrated.
On completion of each set of tests, another stub is replaced with the real module.
Regression testing may be conducted to ensure that new errors have not been introduced.
Top-Down Approach : 
Advantages:
Verifies major control or decision points early in the test process.
With the use of depth-first integration testing, a complete function of the software can be demonstrated.  -- Confidence builder for developer/customer.

Disadvantages:
Since stubs replace lower level modules, no significant data can flow upwards to the main module. 
Bottom Up Approach :
This approach begins construction and testing with modules at the lowest levels in the program structure.
Low-level modules are combined into clusters.
 A driver is written to coordinate test case input and output.
 The cluster is tested.
 Drivers are removed and clusters are combined moving upward in the program     hierarchy.


Bottom Up Approach :
Advantages:
Easier test case design and lack of stubs.
Disadvantages:
The program as an entity is does not exist until the last module is added.
System testing:
System Testing’ is the next level of testing. It focuses on testing the system as a whole.
This article attempts to take a close look at the System Testing Process and analyze:
Why System Testing is done? What are the necessary steps to perform System Testing? How to make it successful?
A series of tests to verify that all system elements have been properly integrated


Why System Testing is important?
System Testing is a crucial step in Quality Management Process.
........- In the Software Development Life cycle System Testing is the first level where
...........the System is tested as a whole
........- The System is tested to verify if it meets the functional and technical
...........requirements
........- The application/System is tested in an environment that closely resembles the
...........production environment where the application will be finally deployed
........- The System Testing enables us to test, verify and validate both the Business
...........requirements as well as the Application Architecture
In system software there are:
Recovery testing
Security testing
Stress testing
Performance testing
Deployment testing
 Recovery Testing:
Forces software to fail in a variety of ways and verifies that recovery is properly performed.  
Security Testing:
 Attempts to verify the software’s protection mechanisms. The software designer tries to make penetration cost more than the value of information obtained by breaking in.
Stress Testing:
Executes the system in a manner that demands resources in abnormal quantity, frequency or volume.  
Performance Testing:
To test the run time performance of a system within the context of an integrated system.
Deployment testing:
Deployment testing is a type of production testing which is Performed after the code is deployed to check whether it is Working fine in production or not.

Software Testing Introduction:
Software testing is the process used to measure the quality of developed computer software. Software testing is a process, or a series of processes, designed to make sure computer code does what it was designed to do and that it does not do anything unintended. Software should be predictable and consistent, offering no surprises to users.
One of the primary causes of poor program testing is the fact that most programmers begin with a false definition of the term. They might say:
·         “Testing is the process of demonstrating that errors are not present.”
OR
·         “The purpose of testing is to show that a program performs its intended functions correctly.”
OR
·         “Testing is the process of establishing confidence that a program does what it is supposed to do.”
These last statements are all based on a false premise. At the start of testing, a program should not be merely tested to show that it works. Rather, the test should start with the assumption that the program contains errors and the goal is to find as many errors as possible.
Hence, more appropriate definitions are these ones:
·         Testing is the process of executing a program with the intent of finding errors.
·         Testing is the process of uncovering errors in a program makes it a feasible task
·         Testing is a destructive process of trying to find the errors (whose presence is assumed) in a program.
u        Debugging is a consequence of successful testing -- when a test case uncovers an error, it is the debugging process that results in the removal of the error.
Debugging is an ART.  The external manifestation of the error and the cause of the error normally do not share obvious relationships.