Chap 2
Chap 2
Testing
White box testing deal with the code, code structure and
internal design and how they are coded.
White box testing needs knowledge of the internal program
design and code required and these types of tests are based on
coverage of code statement, branches, paths and condition.
White box Testing involves
Testing all independent paths within a module at least
once.
Testing all logical decision on their True and False
sides.
Testing internal data structures to ensure their
validity.
Testing all loops at their boundaries and within their
operational bounds.
Types:
1)Code Coverage Testing
A)Function Coverage=(Number of functions Exercised/Total
number of functions in program)*100
B)Statement Coverage=(Number of Statements Exercised/Total
number of executable statement in program)*100
For Example:
Assume ,program has 100 statements,
Testes exercise 80 statements then,
Statements coverage=80%
Moral: The customer has only checked the function of the lock n
key not the internal manufacturing details like usage of how
many nuts , how much steel and as such.
Black Box Testing Techniques/Types
1)Equivalence Partitioning /
(Equivalence class Partition )
2)Requirements Based Techniques/Testing
3)Positive Testing
4)Negative Testing
5)Boundary value Analysis(BVA)
6)Cause Effect Techniques/Testing
Types of Black Box Testing
1)Functional Testing
2)System Testing
3)Integration testing
4)Incremental Integration testing
5)End-to-End Testing
6)Comparison Testing
7)Regression Testing
8)Stress Testing
Advantages
1)Efficient Testing
2)Code access not required
3)Easy to Execute
4)Easy of use
5)No coding skill required
6)Quicker Test Case Development
7)Simplicity
Disadvantages
1)The Test cases are difficult to design
2)Redundant
3)Lack of Introspection
4)Testing every possible input ,is not possible because
it would take a lot of time and therefore many of the
program paths go untested.
5)Blind coverage
6)Script Maintenance
Gray Box Testing is a technique to test the software product or
application with partial knowledge of the internal workings of an
application.
In this process, context specific errors that are related to web
systems are commonly identified. It will increase the testing
coverage by concentrating on all of the layers of any complex system.
Gray Box Testing is a software testing method, which is a
combination of both White Box Testing and Black Box Testing
method.
In White Box testing internal structure (code) is known
In Black Box testing internal structure (code) is unknown
In Grey Box Testing internal structure (code) is partially known
1)Top-down Approach
2)Bottom –Up Approach
3)Big-Bang Approach
4)Sandwich Approach
1)Top-down Approach
Advantages:
The tested product is very consistent because the integration
testing is basically performed in an environment that almost
similar to that of reality.
Fault Localization is easier.
Possibility to obtain an early prototype.
Critical Modules are tested on priority; major design flaws
could be found and fixed first.
Detects the flow of design.
Useful when major flaws occur at the top of the program.
Disadvantages:
Basic functionality is tested at the end of cycle.
Needs many Stubs.
2)Bottom –Up Approach
Advantages:
Useful when major flaws occur at the bottom of the
program
Useful for integration the Object-oriented Systems.
Test condition are easier to create
Observation of test results is easier.
In this approach development and testing can be done
together so that the product or application will be efficient
and as per the customer specifications.
Fault localization is easier.
No time is wasted waiting for all modules to be developed
unlike Big-bang approach.
Disadvantages:
Integration errors are found later than earlier.
Design flaws that could need major reconstruction are
found last.
We can catch the Key interface defects at the end of cycle.
It is required to create the test drivers for modules at all
levels except the top control.
Critical modules (at the top level of software architecture)
which control the flow of application are tested last and
may be prone to defects.
Early prototype is not possible.
3)Big-Bang Approach
Advantages:
This approach is well suited in scenarios where the
majority of components are already available and very
few components get added or modified.
Disadvantages:
When some failure is found out during integration, it is
very difficult to trace the module where the problems
existed.
Certain sub-systems may take lot of time to be
corrected.
It is also difficult to find the developer who developed
that module which again makes it difficult to make
modification so as to correct that defect.
4)Sandwich Approach
Process of sandwich Testing:
Upward
Downward
Middle Layer
Advantages:
Top and Bottom Layer Tests can be done in Parallel
Useful for very large Projects
Development Schedule
More Resources
Disadvantages:
Does not test the individual subsystems thoroughly before integration
of the sub components
High cost of Testing
Cannot be used for smaller Systems
Different skill sets.
Why do Integration Testing?
Although each software module is unit tested, defects still exist
for various reasons like,
A Module in general is designed by an individual software
developer whose understanding and programming logic may
differ from other programmers. Integration testing becomes
necessary to verify the software modules work in unity.
At the time of module development, there are wide chances of
change in requirements by the clients. These new requirements
may not be unit tested and hence system integration testing
becomes necessary.
Interfaces of the software modules with the database could be
erroneous
External Hardware interfaces, if any, could be erroneous
Inadequate exception handling could cause issues.
Integration Testing Procedure:
The integration test procedure irrespective of the test
strategies
Step1: Prepare the Integration Tests Plan
Step2: Design the Test Scenarios, Cases, and Scripts.
Step3: Executing the test Cases followed by reporting
the defects.
Step4: Tracking & re-testing the defects.
Step5: Steps 3 and 4 are repeated until the completion
of Integration is successfully.
Brief Description of Integration Test Plans:
It includes following attributes:
Methods/Approaches to test (as discussed above).
Scopes and Out of Scopes Items of Integration Testing.
Roles and Responsibilities.
Pre-requisites for Integration testing.
Testing environment.
Risk and Mitigation Plans.
Entry and Exit Criteria
Entry and Exit Criteria to Integration testing phase in any software
development model
Entry Criteria:
Unit Tested Components/Modules
All High prioritized bugs fixed and closed
All Modules to be code completed and integrated successfully.
Integration tests Plan, test case, scenarios to be signed off and documented.
Required Test Environment to be set up for Integration testing
Exit Criteria:
Successful Testing of Integrated Application.
Executed Test Cases are documented
All High prioritized bugs fixed and closed
Technical documents to be submitted followed by release Notes.
Best Practices/ Guidelines for Integration Testing:
First determine the Integration Test Strategy that could be
adopted and later prepare the test cases and test data
accordingly.
Study the Architecture design of the Application and identify
the Critical Modules. These need to be tested on priority.
Obtain the interface designs from the Architectural team and
create test cases to verify all of the interfaces in detail.
Interface to database/external hardware/software application
must be tested in detail.
After the test cases, it's the test data which plays the critical
role.
Always have the mock data prepared, prior to executing. Do
not select test data while executing the test cases.