bai giang-se-03mar14
DESCRIPTION
Bài giảng môn Kỹ nghệ phần mềm cho lớp 56PM, Khoa Công nghệ thông tin, Trường Đại học Xây Dựng, ngày 03 tháng 03 năm 2014.TRANSCRIPT
1
Chapters
Chapter IV
Software Testing
●Software Testing Techniques
●Software Testing Strategies
2
Software Testing
●Testing Objectives● Testing is a process of executing a program with the
intent of finding an error.
● A successful test is one that uncovers an as-yet-undiscovered error.
3
Software Testing
●Attributes of a “good” test● A good test has a high probability of finding an error.
● A good test is not redundant.
● A good test should be “best of breed”.
● A good test should be neither too simple nor too complex.
4
Software Testing Principles
●Testing Principles● All tests should be traceable to customer
requirements.
● Tests should be planned long before testing begins.
● The Pareto principle applies to software testing.
● Testing should begin “in the small” and progress toward testing “in the large.”
● Exhaustive testing is not possible.
● To be most effective, testing should be conducted by an independent third party.
5
Software Testing Techniques
● Test Case Design Methods
● Black-Box Testing: Knowing the specified function that a product has been designed to perform, tests can be conducted that demonstrate each function is fully operational while at the same time searching for errors in each function.
● White-Box Testing: Knowing the internal workings of a product, tests can be conducted to ensure that internal operations are performed according to specifications and all internal components have been adequately exercised.
6
White-Box Testing
● White-box testing (glass-box testing) uses the control structure of the procedural design to derive test cases, in such a way that
● guarantee that all independent paths within a module have been exercised at least once,
● exercise all logical decisions on their true and false sides,
● execute all loops at their boundaries and within their operational bounds,
● exercise internal data structures to ensure their validity.
7
White-Box Testing Techniques
● Basis Path Testing (Tom McCabe)
● enables the test case designer to derive a logical complexity measure of a procedural design and use this measure as a guide for defining a basis set of execution paths.
8
White-Box Testing Techniques
● Basis Path Testing (cont.)
9
White-Box Testing Techniques
● Basis Path Testing (cont.)
10
Black-Box Testing
● Black-box testing (behavioral testing) focuses on the functional requirements of the software, enables the software engineer to derive sets of input conditions that will fully exercise all functional requirements for a program.
● Black-box testing attempts to find errors in the following categories:
● incorrect or missing functions,
● interface errors,
● errors in data structures or external database access,
● behavior or performance errors,
● initialization and termination errors.
11
Black-Box Testing
● Graph-Based Testing Methods
● the first step is to understand the objects that are modeled in software and the relationships that connect these objects.
● next step is to define a series of tests that verify “all objects have the expected relationship to one another”
Þ (1) creating a graph of important objects and their relationships
Þ (2) devising a series of tests that will cover the graph so that each object and relationship is exercised and errors are uncovered.
12
Black-Box Testing
● Graph-Based Testing Methods
● A graph is a collection of ● nodes that represent objects; ● links that represent the relationships between
objects;● node weights that describe the properties of a node
(e.g., a specific data value or state behavior);● link weights that describe some characteristic of a
link.
13
Black-Box Testing
● Graph-Based Testing Methods
14
Black-Box Testing
● Graph-Based Testing Methods