9010 Testing
9010 Testing
Testing
One of the practical methods commonly used to detect the presence of errors (failures) in a computer program is to test it for a set of inputs.
The output is correct?
I1, I2, I3, , In,
Our program Expected results =? Obtained results
Inputs
Test oracles
When we can stop the testing activity
Objectives of testing
Executing a program with the intent of finding an error. To check if the system meets the requirements and be executed successfully in the Intended environment. To check if the system is Fit for purpose. To check if the system does what it is expected to do.
Validation - typically involves actual testing and takes place after verifications are completed. Validation and Verification process continue in a cycle till the software becomes defects free.
Testing Levels
Unit testing
The most micro scale of testing. Tests done on particular functions or code modules. Requires knowledge of the internal program design and code. Done by Programmers (not by testers).
Unit testing
Objectives To test the function of a program or unit of code such as a program or module To test internal logic To verify internal design To test path & conditions coverage To test exception conditions & error handling When After modules are coded Input Internal Application Design Master Test Plan Unit Test Plan Output Unit Test Report
Integration Testing
To technically verify proper interfacing between modules, and within sub-systems After modules are unit tested
When
Input
Internal & External Application Design Master Test Plan Integration Test Plan
Integration Test report
Output
test main
C
test A
F
test C
test B test D
test main, A, B, C D, E, F
test E
test F
Disadvantages
Integration testing can only begin when all modules are ready Fault localization difficult Easy to miss interface faults
Top-down Integration
Incremental strategy 1. Start by including highest level modules in test set. All other modules replaced by stubs or mock objects. 2. Integrate (i.e. replace stub by real module) modules called by called by modules in test set. 3. Repeat until all modules in test set. main
A B C
test main
test main, A, B, C D, E, F
Top-down Integration
Advantages Fault localization easier Few or no drivers needed Different order of testing/implementation possible Major design flaws found first in logic modules on top of the hierarchy Disadvantages Need lot of stubs / mock objects
Bottom-up Integration
Incremental strategy
Test low-level modules Modules calling them until highest level module
main
test D
C
test D,E,A
test E
F
test B
test C,F
test main, A, B, C D, E, F
test F
Bottom-up Integration
Advantages Fault localization easier (than big-bang) No need for stubs / fewer mock objects Logic modules tested thoroughly Testing can be in parallel with implementation Disadvantages Need drivers High-level modules (that relate to the solution logic) tested in the last (and least)
System Testing
Objectives
To verify that the system components perform control functions To perform inter-system test To demonstrate that the system performs both functionally and operationally as specified To perform appropriate types of tests relating to Transaction Flow, Installation, Reliability, Regression etc.
When Input
Output
Detailed Requirements & External Application Design Master Test Plan System Test Plan System Test Report
Output
To verify that the system meets the user requirements After System Testing Business Needs & Detailed Requirements Master Test Plan User Acceptance Test Plan User Acceptance Test report
Regression Testing
Regression testing is any type of software testing that seeks to uncover new software bugs, or regressions, in existing functional and non-functional areas of a system after changes, such as enhancements, patches or configuration changes, have been made to them. The intent of regression testing is to ensure that a change, such as a bugfix, did not introduce new faults. One of the main reasons for regression testing is to determine whether a change in one part of the software affects other parts of the software.