bai giang-se-03mar14

14
Chapters Chapter IV Software Testing Software Testing Techniques Software Testing Strategies 1

Upload: tran-khanh-dung-khoa-cntt-dai-hoc-xay-dung

Post on 17-Nov-2014

100 views

Category:

Education


0 download

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

Page 1: Bai giang-se-03mar14

1

Chapters

Chapter IV

Software Testing

●Software Testing Techniques

●Software Testing Strategies

Page 2: Bai giang-se-03mar14

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.

Page 3: Bai giang-se-03mar14

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.

Page 4: Bai giang-se-03mar14

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.

Page 5: Bai giang-se-03mar14

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.

Page 6: Bai giang-se-03mar14

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.

Page 7: Bai giang-se-03mar14

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.

Page 8: Bai giang-se-03mar14

8

White-Box Testing Techniques

● Basis Path Testing (cont.)

Page 9: Bai giang-se-03mar14

9

White-Box Testing Techniques

● Basis Path Testing (cont.)

Page 10: Bai giang-se-03mar14

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.

Page 11: Bai giang-se-03mar14

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.

Page 12: Bai giang-se-03mar14

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.

Page 13: Bai giang-se-03mar14

13

Black-Box Testing

● Graph-Based Testing Methods

Page 14: Bai giang-se-03mar14

14

Black-Box Testing

● Graph-Based Testing Methods