Lecture 4 Flashcards
What does testing a program consist of?
It consists of providing the program with a set of test inputs or test cases and observing if the program behaves as expected
What happens if the program fails to behave as expected?
The conditions under which failure occurs are noted for later debugging and correction
What is failure?
It is the manifestation of an error or bug. The mere presence of an error may not necessarily lead to a failure
What is a test case?
This is the ISO triplet, I is the data input to the system , S is the state of the system when the data is input and O is the expected output of the system.
What is a test suite?
The set of all test cases with which a given software product is to be tested, it tries to get all of the test cases from the equivalence classes
What is the aim of testing?
To identify all defects existing in a software product
Is it possible to guarantee that software is error free after testing?
No it is not possible to guarantee the software is error free because the input data domain of most software is very large and it isn’t practical to test them all.
Why is testing important?
It exposes many defects existing in a software product
What is the difference between verification and validation?
Verification is the process of checking whether a product or system meets specified requirements and standards, and is usually performed during the design and development phases before the product is released to market. Essentially are we building the product right?
Whereas validation takes place after verification and involves testing the product in real world scenarios to see how it behaves and performs. It ensures the product meets the needs of end users and satisfies all relevant quality criteria. Essentially did we build the right product?
Why is exhaustive testing of non trivial systems impractical?
Because the domain of input data values to most practical software systems is either extremely large or infinite.
Why must we design optimal test suites?
We must design optimal test suites of reasonable size so that we uncover as many errors existing in the system as possible
Is having a large collection of random test cases effective?
No it is not because it doesn’t guarantee that all or even most of the errors in the system will be uncovered. The test suite would have to be carefully designed to detect more errors.
What is the difference between functional testing and structural testing?
Functional testing is where test cases are designed using only the functional specification of the software for example black box testing where you test without any knowledge of the internal structure of the software.
Structural testing is where test cases are designed having thorough knowledge about the internal structure of software, for example white box testing
How do you perform black box testing?
You design the test cases from an examination of the input and output values only with no knowledge of the design or code.
Describe the two main approaches to designing black box test cases
Equivalence class partitioning and Boundary value analysis. Equivalence class partitioning is where the domain of input values to a program is partitioned into a set of equivalence classes. This partitioning is done such that the behaviour of the program is similar for every input data in the same equivalence class. The main idea is that testing with any one value in an equivalence class should be as good as testing with any other value in the same equivalence class.
Boundary value analysis is the selection of test cases at the boundaries of the different equivalence classes. This is done because programmers often fail to see the special processing required by the input values that lie at the boundary of the different equivalence classes. Using < instead of <=