Sei sulla pagina 1di 42

Software Testing

Unit 1

DR. KEMAL UMRAO KOCHE


GOVERNMENT POLYTECHNIC
BRAMHAPURI
Content

A perspective on Testing
 Basic Definition
 Test Cases
 Insights from a Venn Diagram
 Identifying Test Cases
 Black Box & White Box Testing
 Functional Testing
 Structural Testing
 Static vs Dynamic Testing
 Error & Fault Taxonomies
 Level of Testing
 Verification & Validation
 V-Model
CO Covered

Apply various software testing methods


Prepare test cases for different types and levels of
testing
Why Do we Test.?

To make a judgment about quality or acceptability.


Discover Problems
Basic Definitions

Error(mistake): mistake while coding-bug


Fault(defect): Result of an error
 Fault of omission
 Fault of commission
Failure: A failure occurs when a Fault executes.
Incident: Alerts user occurrence of a Failure
Test: concerned with errors, faults, failures,
incident
Test Case: have identity & is associated with a
program behavior. Has i/p & o/p
Process of testing

Test planning
Test case development
Running test cases
Evaluating test results
Test Cases
Insights from a Venn Diagram
Cont.,
Identifying Test Cases

Functional Testing( Black Box Testing):


implementation of Black box is not known.
Function of black box is understood by i/p & o/p.
Functional Testing

Advantages
 Independent of how the software is implemented.
 If implementation change test cases are still useful
 Test case development can occur in parallel with the
implementation.
Disadvantage:
 Redundancies may exist among test cases
 Possibility of gaps of untested software.
Conti.,
Structural Testing

Also called white box testing( even clear box


Testing)
Implementation (of the Black box) is known &
used to identify test cases.
The functional VS Structural Debate

Goals of both approach is to identify test cases.


Functional testing uses only the specification to
identify test cases.
Structural testing uses the programs source
code(implementation) as the basis of test case
identification.
Cont.,

 When functional test cases are executed in combination


with structural test coverage metrics twin problems
redundancies & gaps faced by functional testing can be
recognized & resolved.
Testing as a craft

When we know what kind of error we are prone to


make
If we know what kind of faults are likely to reside in
software to be tested.
We can use this to employ more appropriate test
case identification methods.
At this point testing really becomes a craft.
Static & Dynamic Testing

 Two other terms used to describe how software is tested are


static testing and dynamic testing.
 Static testing refers to testing something that’s not
running—examining and reviewing it.
 Dynamic testing is something that’s—running and using
the software.
 The best example for these terms is the process you go through when checking
out a used car. Kicking the tires, checking the paint, and looking under the hood
are static testing techniques. Starting it up, listening to the engine, and driving
down the road are dynamic testing techniques.
Error & Fault Taxonomies

Definition of error & fault hinge on the distinction


between process & product
Process-refer to how we do something.
Product-end result of a process.
SQA- tries to improve the product by improving the
process.
Testing is clearly more product oriented.
Faults can be classified in several ways
Levels of Testing

Levels of testing echo the levels of abstraction found


in the waterfall model of the SDLC.
In functional testing 3 levels of definition
(specification, preliminary design, detailed design)
correspond directly to 3 levels of testing –system,
integration & unit testing.
When to Start Testing

 An early start to testing reduces the cost, time to rework and


error free software that is delivered to the client.
 Software Development Life Cycle (SDLC) testing can be started from the
Requirements Gathering phase and lasts till the deployment of the
software.
 It also depends on the development model that is being used. For
example in Water fall model formal testing is conducted in the Testing
phase, but in incremental model, testing is performed at the end of every
increment/iteration and at the end the whole application is tested.
 Testing is done in different forms at every phase of SDLC like during Requirement
gathering phase, the analysis and verification of requirements are also considered testing.
 Reviewing the design in the design phase with intent to improve the design is also
considered as testing.
 Testing performed by a developer on completion of the code is also categorized as Unit
type of testing
When to Stop Testing

 Unlike when to start testing it is difficult to determine when to stop


testing, as testing is a never ending process and no one can say that any
software is 100% tested
 Following are the aspects which should be considered to stop the
testing:
 Testing Deadlines.
 Completion of test case execution.
 Completion of Functional and code coverage to a certain point.
 Bug rate falls below a certain level and no high priority bugs are identified.
 Management decision.
 Testing should be stopped when it meets the completion criteria.
Completion criteria should be based on Risks.
Difference

BLACK BOX TESTING WHITE BOX TESTING

It is a way of software testing in which the internal It is a way of testing the software in which the
structure or the program or the code is hidden and tester has knowledge about the internal structure r
nothing is known about it. the code or the program of the software.

It is mostly done by software testers. It is mostly done by software developers.

No knowledge of implementation is needed. Knowledge of implementation is required.


It can be referred as outer or external software
It is the inner or the internal software testing.
testing.
It is functional test of the software. It is structural test of the software.
This testing can be initiated on the basis of This type of testing of software is started after
requirement specifications document. detail design document.
It is mandatory to have knowledge of
No knowledge of programming is required.
programming.
It is the behavior testing of the software. It is the logic testing of the software.
It is applicable to the higher levels of testing of It is generally applicable to the lower levels of
software. software testing.
Verification

 It makes sure that the product is designed to deliver all functionality to


the customer.
 Verification is done at the starting of the development process. It
includes reviews and meetings, walkthroughs, inspection, etc. to
evaluate documents, plans, code, requirements and specifications.
 It answers the questions like: Am I building the product right?
 Am I accessing the data right (in the right place; in the right way).
 It is a Low level activity
 Performed during development on key art facts, like walkthroughs,
reviews and inspections, mentor feedback, training, checklists and
standards.
 Demonstration of consistency, completeness, and correctness of the
software at each stage and between each stage of the development life
cycle.
Validation

 Determining if the system complies with the requirements and


performs functions for which it is intended and meets the
organization’s goals and user needs.
 Validation is done at the end of the development process and takes
place after verifications are completed.
 It answers the question like: Am I building the right product?
 Am I accessing the right data (in terms of the data required to satisfy
the requirement).
 It is a High level activity.
 Performed after a work product is produced against established criteria
ensuring that the product integrates correctly into the environment.
 Determination of correctness of the final software product by a
development project with respect to the user needs and requirements.
Triangle Problem

Problem statement
Simple version: The triangle program accepts 3
integers a, b, c as input to be sides of a triangle
o/p is type of triangle determined by 3 sides
Equilateral, Isosceles, Scalene, Not a triangle.
Improved version

Sides of triangle integer a, b, c must satisfy the following conditions

One of the 4 mutually exclusive output is given


References

 Software Testing Craftsman’s Approach-Paul C


Jorgensen.

Potrebbero piacerti anche