You are on page 1of 14

Software Testing

• The main objective of testing is to eliminate defects that


resulted from the implementation stage as a part of
ensuring the quality of the final product.

• The process of executing a program with the intent of


finding errors.

• Two approaches for identifying defects in code:


• Static: through code inspection or analyzing tools.
• Dynamic: by executing the code and examine
potential outputs.
Testing Concepts
• Errors: a measure of the difference between the actual and
the ideal outputs.

• Fault: is a condition that causes a system to fail in


performing its required function.
• Commonly known as bug

• Failure: is the inability of a system or component to


perform a required function according to its specifications.
• Resulted behavior != expected behavior.
Testing Concepts

• Test case: can be considered as comprising a set of test


inputs and execution conditions, which are designed to
exercise the system under testing in a particular manner.

• Test suite: A group of related test cases that are generally


executed together to test some specific behavior or aspect
of a system.
Testing Concepts
• The intent of Testing
• Test to identify defects
• Input wrong values!
• Test to prove working
• Input correct values!
• Levels of Testing
• Unit testing
• verification of the code produced by individual
programmers
• Integration testing
• System testing
• Acceptance testing
• Regression testing – after
modification!
Testing Concepts
Testing Process
• Composed of :
• Test Plan
• Test case Design
• Test case Execution
• Test Plan: is a general document for the entire project that
defines the scope, approach to be taken, and the schedule of
testing, as well as identifies the test items for testing and the
personnel responsible for the different activities of testing.
• Test Plan includes description of how the testing for the project
will proceed, which units will be tested, and what approaches (and
tools) are to be used during the various stages of testing.
• Input to test plan :
• Project plan, Req document, Design document.
Testing Process

• Test Case Design


• Test case design is a major activity in the testing process. Careful
selection of test cases that satisfy the criterion and approach specified is
essential for proper testing.
Testing Process
• Test Case Execution: During this test defects are found and
logged.
• Defects detector maybe different that their fixer.
• Any launched system must have their defects closed.
Testing Approaches

• Black-box testing:
• The internal structure is not considered.
• White-box testing
• The internal structure are examined carefully
Testing Approaches
• Black-box testing techniques:
• Partition inputs into classes and test one from each
class.
• Boundary values
• E.g. From 0.0 to 1.0.
• Special cases
• E.g. divide by zero.
• State-based testing
• Consider inputs + previous state of system
Key points

• Testing is a way to identify defects in a


system.
• The intention of testing depends on the
view of the tester.
• Black-box and white-box are two main
approaches to testing.
Testing Approaches

• White-box testing techniques:


• Control Flow-Based Criteria
• When a block starts execution and when it passes control
to other blocks
• A node corresponding to a block whose first statement is
the start statement of P is called the start node of G, and a
node corresponding to a block whose last statement is an
exit statement is called an exit node
Example
Compute the absolute value of a number

Check values between 0 - 100

You might also like