SQAT - Ch.06 - Software Testing
SQAT - Ch.06 - Software Testing
SQAT - Ch.06 - Software Testing
COURSE NAME
SOFTWARE TESTING
SOFTWARE
SOFTWARE
QUALITY AND
ENGINEERING
TESTING
(UNDERGRADUATE)
CSC 4133
(UNDERGRADUATE)
Chapter 6:
5: Software Testing
MMH S.2
TESTING
Testing is one of the most important parts and commonly performed activities in QA
Basic idea of testing involves the execution of software and the observation of its behavior
or outcome
If a failure is observed, the execution record is analyzed to locate and fix the fault(s) that
caused the failure. Otherwise, we gain some confidence that the software under test is more
likely to fulfill its designated functions
MMH
Chapter 6: Software Testing
MMH S.3
PRINCIPLES OF TESTING
Principle 1 – Testing shows presence of defects but cannot prove absence of defects
Principle 2 – Exhaustive testing is impossible
Testing everything (all combinations of inputs and preconditions) is not feasible. Instead of
exhaustive testing, risk analysis, time & cost analysis, and priorities should be used to focus
testing efforts
Principle 3 – Early testing
When defects are found earlier in the lifecycle, they are much easier and cheaper to fix
Principle 4 – Defect clustering
A small number of modules usually contains most of the defects discovered during pre-
release testing or is responsible for most of the operational failures.
There is NO equal distribution of defects within one test object. The place where defect
occurs, it’s likely to find some more. The testing process must be flexible and respond to
this behaviour.
Chapter 6: Software Testing
MMH S.5
PRINCIPLES OF TESTING
Principle 5 – Pesticide paradox
If the same tests are repeated over and over again, eventually the same set of test cases will
no longer find any new defects. To overcome this “pesticide paradox”, test cases need to be
regularly reviewed and revised, and new and different tests need to be written to exercise
different parts of the software or system to find potentially more defects.
Principle 6 – Testing is context dependent
Testing is done differently in different contexts, e.g. safety-critical software is tested
differently from an e-commerce site.
Principle 7 – Absence-of-errors fallacy
Finding and fixing defects does not help if the system built is unusable and does not fulfil the
users’ needs and expectations.
Just because testing didn’t find any defects in the software, it does not mean that the software
is ready to be shipped.
Chapter 6: Software Testing
MMH S.6
TESTING LEVELS
TESTING LEVELS
Regression Testing
New test cases are not designed
Tests are selected, prioritized and executed
To ensure that nothing is broken in the new version of the software to accommodate
any change
MMH
Chapter 6: Software Testing
MMH S.8
TESTING & DEBUGGING
MMH
Chapter 6: Software Testing
MMH S.9
HOW Techniques/activities/process/etc.
Generic testing process - Test planning and preparation, Test Execution, Analysis
and follow-up
VIEW Functional/external/black-box
Structural/internal/white-box
Gray-box (mixed black-box & white-box ) testing
TESTING TECHNIQUES
White-box testing is Implementation-based also known as structural testing
Examines source code with focus on:
(1) Control flow: refers to flow of control from one instruction to another
(2) Data flow: refers to propagation of values from one variable or constant to another variable
Software developers perform structural testing on the individual program units they write
Using white-box testing methods, you can derive test cases that:
(1) guarantee that all independent paths within a module have been exercised at least once
(2) exercise all logical decisions on their true and false sides
(3) execute all loops at their boundaries and
within their operational bounds
(4) exercise internal data structures to ensure their validity
Chapter 6: Software Testing
S.11
MMH
TESTING TECHNIQUES
MMH
Chapter 6: Software Testing
S.12
MMH
TESTING TECHNIQUES
High-level: Whole system ==> black-box (late in testing, e.g. system testing)
Low –level: Individual statements, data, and other elements ==> white-box (test in small/early)
Middle-levels of abstraction ==> Gray-box
Functional/subroutine/procedure, module , subsystem etc.
Method, class, super-class
Gray-box (mixed black-box & white-box ) testing:
Many of the middle levels of testing
Example: procedures in modules
o Procedures individually as black box
o Procedure interconnection white box at module level
Chapter 6: Software Testing
S.13
MMH
Techniques:
A specific technique is BBT if external functions are modeled
A specific technique is WBT if internal implementations are modeled
Tester:
BBT is typically performed by dedicated professional testers, and could also be
performed by third-party personnel in a setting of V&V
WBT is often performed by developers themselves
Chapter 6: Software Testing
S.16
MMH
Automated Testing
Manual Testing
Testing employing software tools
Oldest and most rigorous type of software testing
Execute tests without manual intervention
Requires a tester to perform manual test operations
o Fast
o Hard to repeat
o Repeatable
o Not always reliable
o Reliable
o Costly
o Reusable
o Time consuming
o Programmable
o Labour intensive
o Saves time
Chapter 6: Software Testing
S.18
MMH
TEST AUTOMATION
Key issues related to Test Automation
Specific needs and potentials for automation and selection of existing testing tools,
if available/suitable
Availability of user training for these tools and time/effort needed
Overall cost, including costs for tool acquisition, support, training, and usage
Impact on resource, schedule, and project management
Pre-requisites for test automation
The system is stable and its functionalities are well defined
The test cases to be automated are unambiguous
The test tools and infrastructure are in place
The test engineers have prior successful experience with automation
Adequate budget should have been allocated for the procurement of tools
Chapter 6: Software Testing
S.19
MMH
TEST AUTOMATION
TEST AUTOMATION
Automated testing CANNOT replace Manual testing
Which Test/Test cases should NOT be automated?
Usability testing (“How easy is the application to use?”) cannot be performed by automation
Logical error often cannot be identified by the automated testing.
Specification (e.g. SRS), Design document cannot be tested by automation.
One-time testing, “ASAP” testing –”we need to test NOW!”
Ad hoc/random testing: based on intuition, expertise, and knowledge of application
Tests without predictable results
Chapter 6: Software Testing
S.21
MMH
REFERENCES
Software Testing And Quality Assurance – Theory and Practice - Kshirasagar Naik & Priyadarshi
Tripathy
Software Quality Engineering: Testing, Quality Assurance and Quantifiable Improvement - Jeff Tian