Quality Assurance Flashcards
Testing is…
show program does what is intended
discover defects before it is put into use
finding differences between expected behaviour and observed behaviour
is aimed at breaking the system
is part of a more general verification and validation process
Testing can reveal the presence of errors - not their absence!
Validation
Are we developing the right product?
“The assurance that a product, service, or system meets the needs of the customer and other identified stakeholder”
Often involves external stakeholders/customers.
Verification
Are we developing the product right?
“The evaluation of whether or not a product, service or system complies with regulation, requirement, specification, or imposed condition.”
Often performed as internal procedure.
Static analysis
Hand execution (reading source code)
Walk-through (informal presentation)
Code inspection (formal presentation)
Automated tools (i.e. in the IDE)
Dynamic analysis
Black box
White box testing
Black-box testing
We don’t focus on the program but only input and getting the expected output.
Focus on I/O behaviour. If for any given input we can predict the output, the the unit passes the test. (almost impossible to generate all possible inputs (“test cases”))
Equivalence partitioning
Done in black-box testing bc there are infinite many possible inputs. A way to reduce the number of test cases by dividing inputs into equivalence classes.
Example: if an object is supposed to accept a negative number, testing one negative number is enough.
Or could be: negative number, 0, positive small number, positive large number
White-box testing
White box testing is a form of application testing that provides the tester with complete knowledge of the application being tested, including access to source code and design documents.
Statement
One language construct
‘Line of code” checking true or false
Branch
Caused by conditions (if, switch, while, etc.)
E.g. A at first choice but not B.
Path
One potential execution.
E.g. sequence creating A,C
Coverage
Test quality criteria
Degree to which sum of test cases cover program.
e.g. 75% path coverage
Statement coverage C_0
Branch coverage C_1
Path coverage C_2
Statement coverage
Basically check all conditions.
Full coverage: every statement executed at least once.
Easy to achieve
reveals unreachable code
C_0 = covered statements / all statements
Branch coverage
Full coverage == all branches are executed.
For if statement, both then and else part.
Reveals unreachable branches.
Good functional test usually achieves high branch coverage.
C_1 = covered (primitive) branches / all (primitive) branches
Path coverage
Full coverage == all sequences whose elements relate to directly connected nodes in the control flow graph (potentially infinitely many)
Considers repeated loops.
Theoretically optimal testing strategy but combinatorial explosion.
C_2 = covered execution paths / all execution paths (theoretically)
The three different path coverage tests
Complete test: all possible paths (generally not possible with loops)
Boundary-Interior Test: Similar to above but loops are executed via special rules (high effort)
Structure test: Similar to above, but loops are executed exactly n-times (high effort)
Unit testing
Individual components (class or subsystem) are tested.
System testing
The entire system is tested
Goal: determine if the system meets the requirements (functional and non-functional)