Professional Documents
Culture Documents
What is Testing?
The process of executing a program with the intent of finding errors. The purpose of the final testing activities is then only to ensure a quality certificate for the product, which is called certification to distinguish it from other type of quality activity.
Basic definitions
A failure is an unacceptable behaviour exhibited by a system n The frequency of failures measures the reliability n An important design objective is to achieve a very low failure rate and hence high reliability. n A failure can result from a violation of an explicit or implicit requirement A defect is a flaw in any aspect of the system that contributes, or may potentially contribute, to the occurrence of one or more failures n It might take several defects to cause a particular failure An error is a slip-up or inappropriate decision by a software developer that leads to the introduction of a defect
Purpose of Testing
The purpose of testing is to find faults. Testing is thus a destructive process to some extent; we must show that something incorrect. Well known phenomenon that when you correct detected faults, you introduce new faults into the system When faults has been corrected,you may have to reset your software
Test types
Testing levels
Unit testing means that one and only one unit is tested as such. In OOSE, the unit is typically a class, block Integration testing involves testing with the purpose of verifying that the units are working together correctly. System Testing concerns testing the entire system or the application as such. This takes an end-user view of the system and the test cases perform typical end-user actions.
Acceptance Testing
of tests is made by client/sponsor Many tests can be taken from integration testing Acceptance test is performed by the client, not by the developer.
Majority of all bugs in software is typically found by the client after the system is in use, not by the developers or testers. Therefore two kinds of additional tests:
Alpha test:
Sponsor uses the software at the developers site. Software used in a controlled setting, with the developer always ready to fix bugs.
Beta test:
Conducted at sponsors site (developer is not present) Software gets a realistic workout in target environ- ment Potential customer might get discouraged
Testing Techniques A regression test is done when u have made changes in the system, for example corrected a fault, and the tests purpose is to verify that the old functionality remains. This test is very important, but rather tiring and time consuming. Testing focuses The Operation test is the most common system test. The system is used in the intended manner . Full scale test (stress testing)means that we run the system on its maximum scale. All the parameters of the system approach their limit values Negative test , the system is intentionally and systematically used in an incorrect manner.
Result
Black box Actual output compared with required output
Gray box
Testers provide the system with inputs and observe the outputs
They
n The
source code n The internal data n Any of the design documentation describing the systems internals
Unit test cases can be reused, but in end user oriented new test cases have to be developed as well.
Glass Box
Also called white-box or structural testing Testers have access to the system design
They
can
n Examine
the design documents n View the code n Observe at run time the steps taken by algorithms and their internal data
Individual
programmers often informally employ glassbox testing to verify their own code
Gray Box
A black-box tester is unaware of the internal structure of the application to be tested, while a white-box tester knows the internal structure of the application. A gray-box tester partially knows the internal structure, which includes access to the documentation of internal data structures as well as the algorithms used. Gray-box testers require both high-level and detailed documents describing the application, which they collect in order to define test cases.
Unit Testing
A unit test is the lowest level of testing and it is normally done by the developer himself, mainly due to costs. Unit tests are performed for classes, blocks. The larger the unit, the more formal the testing will be.
It tests the interaction between the operations of a class by monitoring the changes that takes place in an object attributes Testing only one operation in isolation is not enough to test a unit.
Ex : State Matrix
This matrix indicates all the states that can be adopted by the unit and all the requests that the unit is expected to receive in various states. Advantage: Draws attention of Designer to state combinations(neglected during design)
Stimulus 1 2 3 4 S0 ok S1 ok fail ok S2 ok Slow checking S3 s4 fail Wrong response ok
Structure Testing
Essentially the same as white box testing. Goal: Cover all paths in the system design Exercise all input and output parameters of each component.
Exercise all components and all calls (each component is called at least once and every component is called by all possible callers.)
Drivers A driver is a method used to call a module that is being tested. Sends values to module under test. Collects return values Stubs A stub is a module used specifically for testing that replaces a called module.
Top-down Integration
Incremental strategy 1.Test high-level modules, then 2.Modules called until lowest level modules
Top-down Integration
Advantages
o o o o
Fault localization easier Few or no drivers needed Different order of testing/implementation possible Major design flaws found first
Need lot of stubs Potentially reusable modules (in bottom of the hierarchy)
Bottom-up Integration
1.Test low-level modules, then 2.Modules calling them until highest level module
Bottom-up Integration
Advantages Fault localization easier (than big-bang) No need for stubs Reusable modules tested thoroughly Testing can be in parallel with implementation Dis-advantages Need of drivers High-level modules (that relate to the solution logic) tested in the last (and least)
Sandwich Integration
Combines top-down strategy with bottom-up strategy The system is view as having three layers
A target layer in the middle A layer above the target A layer below the target Testing converges at the target layer
How do you select the target layer if there are more than 3 layers?
Sandwich Integration
B
Layer I C D Layer II
Layer III
Test D,G Test G Test A,B,C, D Top Layer Tests Test A down
Test A, B, C, D, E, F, G
THANK YOU