Professional Documents
Culture Documents
PGIT104
Module III
Testing
Why Testing?
• Testing find errors.
• An early agreement upon the test plan at the
requirement stage is important.
• Specification -> Test plan -> modify test plan ->
Specification.
Test case
• A test case is described through a choice of
inputs for the unit to be tested.
• For example :
What are the test cases for a given function
“ int f(int x, int y)” that compares two nos. and
report the maximum?
What is the criteria to be used?
1. Either the code should be tested based on
what is required from the external point of
view. (Black Box Testing)
2. Or, it should be tested on an insider’s view on
the given artifact i.e. the code is be seen to
design the test case. (White Box Testing).
Black Box Testing
• Black box testing is also called functional
testing, that is because we are going to mainly
look at the functionality of the black box, how
it is to be used as a black box.
• Test the artifact from external point of view.
• Specifications are used to generate test data.
• It checks performance and behavioural error.
• It is applied at the final stage of testing.
Black Box Testing
• Different methods of Black box Testing-
1. Graph based Testing
2. Equivalence Partitioning
3. Boundary Value Analysis
Boundary Value Analysis
White Box Testing
• White box testing, which is also called structural testing.
• The artifact are tested from internal or implementation
point of view.
• Cannot detect missing features.
• Coverage measures are used-
1. Statement coverage.
– Each statement is covered in testing
2. Branch coverage:
– Each branch is covered. (For example in “if then else”)
3. Path oriented testing.
– You are going to select the data such that different chosen parts
in a program are covered.
White Box Testing
• Two different methods of white box testing
are-
1. Basic Path Testing.
2. Control Structure Testing.
What should be tested?
• Entire System at once?
• Or, every component or unit before the
system is integrated?
Levels of Testing
1. Module testing (Unit Testing)
• Each module is individually tested
2. Integration level (Incremental Testing)
• Modules that depend on each other are tested
collectively
3. System testing (Evaluation testing)
• The entire system is tested.
4. Acceptance test (Live Test)
• For acceptance of software and subsequent payments.
Unit Testing
• It is a level of software testing where individual
units/ components of a software are tested
independently from rest of the software.
• The actual results are compared with the
results defined in specification and design
module.
• Fault isolation and debugging becomes easier
in unit testing.
What to test during unit testing
• Module interface
– Tested to check the correct flow of info in and out of
the system.
• Independent/basic paths
– Tested to ensure that all modules are executed at
least once during testing.
• Boundary conditions
– Output/computation at boundary value is correct.
• Error handling paths.
Role of Driver and Stub in Unit Testing
• Driver
– Main program that accepts test case data, passes data
to the components to be tested and prints relevant
results.
• Stub
– Subordinate modules that are called by the module to
be tested.
– It is a dummy sub program that does the minimal data
manipulation, provides verification of entry and
returns the control to the module under testing.
Integration testing
• It is a level of software testing where individual
units are combined and tested as a group.
• Here, unit tested module are taken one by one
and integrated incrementally.
• It is performed to expose defects in the
interfaces and in the interactions between
integrated components or systems.
• Test drivers and test stubs are used to assist in
Integration Testing.
Why Integration testing is required?
• Methods of Validation :
• Dynamic Testing
• Testing
• End Users
Difference between Verification
and Validation
Verification Validation
1. Verification is a static practice of 1. Validation is a dynamic mechanism of
verifying documents, design, code and validating and testing the actual product.
program.
2. It always involves executing the code.
2. It does not involve executing the code.
3. It is computer based execution of
3. It is human based checking of program.
documents and files.
4. Validation uses methods like black box
4. Verification uses methods like (functional) testing, gray box testing, and
inspections, reviews, walkthroughs, and white box (structural) testing etc.
Desk-checking etc.
5. Validation is to check whether software
5. Verification is to check whether the meets the customer expectations and
software conforms to specifications. requirements.
6. Verification is done by QA team to 6. Validation is carried out with the
ensure that the software is as per the involvement of testing team.
specifications in the SRS document.