Basics of Software Testing
Basics of Software Testing
The process:
- specifications are explicit.
- development and testing are independent (dev implements, tester specifies though dev may
still specify).
- resources are finite and priority is key when testing.
- specifications evolve thus tests must update.
Testing Approaches
Automated Fuzzer to run Feedback directed
commands on GUI random testing to GUI,
symbolic execution with
static analysis and code
monitoring
Manual Exercise different Looking at source code
GUI events to determine possible
rights
Black-box White-box
Testing cannot be fully manual or fully automated. Neither fully black-box or white-box.
Black-box White-box
Does not require code Efficient test suite
modification
Doesn't need to analyse Potentially better coverage
code - a details rabbit hole
Can be performed on any
code format
Example
- Monitoring network activity on blackbox to detect malicious network calls. Inspect source or
binary code on whitebox to see calls to malicious network calls.
Automated Testing can be hard for entire complex systems.
Condition Function
B is non-null B != null
B is same length as A B.length == A.length
Elements of B are in sorted order for (int i = 0; i < B.length-1; i++) B[i] <= B[i+1];
Elements of B are a permutation of the /* count no. of occurrences of each number in each array and
elements of A: DIY compare these counts */
- Mutation analysis/testing - assumes program is close to being correct or begin with thus tests
variations/mutants of the program i.e. Switching assignment or arithmetic operators. A good
suite should report failed tests in the mutants. Issue arises when mutants created are
equivalent to the original therefore no test will kill it. Inequivalence of programs is undecidable
and requires manual intervention to confirm that programs are not equivalent.
Testing is important.