Lecture9 10
Lecture9 10
Lecture9 10
SOFTWARE TESTING
By Sabeen Amjad
Outline
Formal Definition of Software Testing
What is a Bug?
Test Case
Software Testing Life Cycle
Waterfall Model
V Model
Modified V Model
Spiral Model
Agile Model
Software Testing
Formal:
Software test plans are part of project’s development and quality plans,
scheduled in advance
It is often signed between developer and customer
Ad hoc examination by colleague and or regular checks by the
programming team leader cannot be considered software tests
Formal Definition of Software Testing
Test Case
A set of
Input values
Execution preconditions
Expected results
Execution post conditions
Developed for a particular objective or test condition, such as
To exercise a particular program path
To verify compliance with a specific requirement.
Test Case Template
Below are the standard fields of sample test case template
Test case ID:
Unique ID for each test case.
Follow some convention to indicate types of test. E.g. ‘TC_UI_1’
indicating ‘user interface test case #1’.
Product / Ver./ Module:
Mention product name.
Mention name of main module or sub module.
Mention version information of the product.
Test case Version: (Optional)
Mention the test case version number.
Use Case Reference(s):
Mention the use case reference for which the test case is written.
Test Case Template
GUI Reference(s) :(Optional)
Mention the GUI reference for which the test case is written.
QA Test Engineer / Test Designed By:
Name of the tester
Test Designed Date:
Date when test case is written.
Test Executed By:
Name of tester who executed this test.
To be filled after test execution.
Test Execution Date:
Date when test case is executed.
Test Case Template
Test Title/Name:
Test case title. E.g. verify login page with valid username and password.
Test Case Summary/Description:
Describe test objective.
Pre-Requisite/Pre-condition:
Any prerequisite that must be fulfilled before execution of this test case.
List all pre-conditions in order to successfully execute this test case.
Dependencies: (Optional)
Mention any dependencies on other test cases or test requirement.
Test Steps:
List all test execution steps in detail.
Write test steps in the order in which these should be executed.
Make sure to provide as much details as you can.
Test Case Template
Test Data/Input Specification:
Use of test data as an input for the test case.
You can provide different data sets with exact values to be used as an
input.
Examples: If you’re testing Calculator, this may be as simple as 1+1.
If you’re testing cellular telephone switching software, there could be
hundreds or thousands of input conditions.
If you’re testing a file-based product, it would be the name of the file
and a description of its contents.
Expected Result/ Output Specification:
What should be the system output after test execution?
Describe the expected result in detail including message/error that
should be displayed on screen.
Examples: Did 1+1 equal 2?
Were the thousands of output variables set correctly in the cell phone
software?
Test Case Template
Actual result:
Actual test result should be filled after test execution.
Describe system behaviour after test execution.
Status (Pass/Fail):
If actual result is not as per the expected result mark this test as failed.
Otherwise update as passed.
Notes/Comments/Questions: To support above fields if there are some
special conditions which can’t be described in any of the above fields or
there are questions related to the expected or actual results, mention those
here.
Post-condition:
What should be the state of the system after executing this test case?
Test Case Template
Environmental needs: (Optional)
Environmental needs that are necessary to run the test case include:
Hardware
Software
Test tools
Facilities
Staff and so on.
Special procedural requirements: (Optional)
This section describes anything unusual that must be done to perform
the test.
Example: Testing WordPad probably doesn’t need anything special, but
testing nuclear power plant software might.
Level of Detail For Test Case
You can use the following test case format for printer compatibility matrix
All the other information that goes with a test case are most likely common
to all these cases and could be written once and attached to the table
Testing Life Cycle
Project Initiation Summary Reports
Software
Requirements
Coding
Testing
Phases of testing for different development phases
Software
System Testing
Requirements
Component
Low Level Design
Testing
Testing
The V Model
Unit Testing
Coding produces several program units, each of these units have to be
tested independently before combining them to form components. The
testing of program units form the unit testing.
Component Testing
The components that are the outputs of low level design have to be
tested independently before being integrated. This type of testing is
component level testing.
The V Model
Integration Testing
High level design views the system as being made up of interoperating
and integrated subsystems. The individual subsystems should be
integrated and tested. This type of testing corresponds to integration
testing.
System Testing
Before product deployment, the product tested as an entire unit to
make sure that all the software requirements are satisfied by the
product. This testing of entire software system is system testing.
Acceptance Testing
For overall business requirements, eventually whatever software is
developed should fit into and work in overall context and should be
accepted by end user. This testing is acceptance testing.
The V Model
Planning of testing for different development phases
Planning phase is not shown as a separate entity since it is common for
all testing phases.
It is still not possible to execute any of these tests until the product is
actually built.
In other words, the step called "testing" is now broken down into
different sub-steps.
It is still the case that all the testing execution related activities are done
only at the end of the life cycle.
The V Model
Who should design test
Execution of the tests cannot be done till the product is built, but the design
of tests can be carried out much earlier.
Skill sets required for designing each type of tests,
The people who are actually performing the function of creating the
corresponding artifact.
For example,
Acceptance tests should be designed by those who formulate the overall
business requirements (the customers, where possible).
Those should design the integration tests who know how the system is
broken into subsystems i.e. those who perform the high level design.
Again, the people doing development know the innards of the program
code and thus are best equipped to design the unit tests.
The V Model
Benefits of early design
We achieve more parallelism and reduce the end-of-cycle time taken for
testing.
By designing tests for each activity upfront, we are building in better
upfront validation, thus again reducing last-minute surprises.
Tests are designed by people with appropriate skill sets.
V-Model
Integration Test
High Level Design Integration Testing
Design
Verification Validation
V-Model
Advantages of V- Model
Testing activities like planning, test designing happens well before
coding.
This saves a lot of time hence higher chances of success over the
waterfall model.
Proactive defect tracking – that is defects are found at early stage
it avoids the downward flow of the defects.
Dis-advantages of V-Model
It is Very rigid and least flexible.
No early prototypes of the software are produced.
If any changes happen in midway, then the test documents along with
requirement documents has to be updated.
Modified V-Model
In the V-Model there is an assumption
Even the activity of test execution was split into execution of tests of
different types, the execution cannot happen until the entire product is
built.
For a given product, the different units and components can be in
different stages of evolution
For example one unit may be in development and thus subject to unit
testing whereas another unit may be ready for component testing
The V model does not explicitly address this parallelism commonly
found in the product development
Modified V-Model