about summary refs log tree commit diff
path: root/usth/ICT2.7/P4L2 Black-Box Testing Subtitles/20 - Identify Constraints Among Choices - lang_en_vs4.srt
blob: 0278cc8debc24970db05246755e3551ec4527ce9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
1
00:00:00,160 --> 00:00:02,080
Something that we saw when we were looking at the split

2
00:00:02,080 --> 00:00:05,760
program before is that if we just combine the interesting values that

3
00:00:05,760 --> 00:00:08,490
we identify, we might end up with a lot of cases.

4
00:00:08,490 --> 00:00:11,030
And I mentioned that we, we're going to look at some way of

5
00:00:11,030 --> 00:00:13,720
addressing that problem. And this is exactly what happens in the

6
00:00:13,720 --> 00:00:17,420
next step of the category partition method, in which we identify constraints

7
00:00:17,420 --> 00:00:20,510
among choices. And why do we identify these constraints? We do

8
00:00:20,510 --> 00:00:23,440
that to eliminate meaningless combinations of

9
00:00:23,440 --> 00:00:25,460
inputs. If you remember, for example,

10
00:00:25,460 --> 00:00:27,260
we had the case in which we were trying to

11
00:00:27,260 --> 00:00:30,110
create a string with a size less than 0, which

12
00:00:30,110 --> 00:00:32,930
doesn't make any sense. And very importantly, we also do

13
00:00:32,930 --> 00:00:37,070
that to reduce the number of test cases. Because every time

14
00:00:37,070 --> 00:00:40,930
we constrain one of the possible choices, we eliminate possible

15
00:00:40,930 --> 00:00:43,250
test cases, so we can use it to keep under

16
00:00:43,250 --> 00:00:45,960
control the number of tests that we generate. There are

17
00:00:45,960 --> 00:00:47,571
three types of properties. The

18
00:00:47,571 --> 00:00:50,610
pair property...if, error properties, and properties

19
00:00:50,610 --> 00:00:52,610
of type single. So we're going to look at what these

20
00:00:52,610 --> 00:00:56,230
properties mean, using, once more, our example of the split program.

21
00:00:56,230 --> 00:00:58,750
In particular, we're going to use some of the choices that we

22
00:00:58,750 --> 00:01:02,080
identified earlier. So let's look, for example, at choice 0, for

23
00:01:02,080 --> 00:01:04,599
category length of the string. All we can say is that,

24
00:01:04,599 --> 00:01:07,860
if the length is 0, this define a special property of

25
00:01:07,860 --> 00:01:11,160
the string. And that was specified in this way by saying

26
00:01:11,160 --> 00:01:15,610
that this identifies property zerovalue. So every time that we use

27
00:01:15,610 --> 00:01:19,080
this choice, zerovalue is defined. At this point, we can use

28
00:01:19,080 --> 00:01:20,550
this to exclude some meaningless

29
00:01:20,550 --> 00:01:23,170
combinations. For instance, consider special characters.

30
00:01:23,170 --> 00:01:25,130
If we have a string of length 0, which means a

31
00:01:25,130 --> 00:01:26,850
string with no characters. Obviously, there

32
00:01:26,850 --> 00:01:28,760
cannot be special characters. So, considering

33
00:01:28,760 --> 00:01:31,020
this combination will just be a waste of time. So what

34
00:01:31,020 --> 00:01:33,770
we do is that we specify next to this choice, that we

35
00:01:33,770 --> 00:01:36,360
will only consider this if length is not 0. And we

36
00:01:36,360 --> 00:01:41,110
do this by saying that we consider this only if not zerovalue.

37
00:01:41,110 --> 00:01:43,970
So, if zerovalue is not defined. So this pair is an

38
00:01:43,970 --> 00:01:47,640
example of a property...if case. Define a property and use that

39
00:01:47,640 --> 00:01:49,770
property. Now let's look at a case in which we might

40
00:01:49,770 --> 00:01:52,580
want to use an error property. For instance, when we look at

41
00:01:52,580 --> 00:01:56,480
the category value for the input size, the choice value less

42
00:01:56,480 --> 00:01:59,510
than 0 is an erroneous choice. So it's a choice that

43
00:01:59,510 --> 00:02:02,630
we selected to test a possibly erroneous situation, so we can

44
00:02:02,630 --> 00:02:06,160
mark this as an error property. And what that means is that

45
00:02:06,160 --> 00:02:09,949
when generating a combination of choices, we will consider this only

46
00:02:09,949 --> 00:02:12,990
once because we assume that we just want to test this error condition

47
00:02:12,990 --> 00:02:16,260
once. Finally, the single property is a property that we use

48
00:02:16,260 --> 00:02:19,050
when we want to limit the number of test cases. And it's

49
00:02:19,050 --> 00:02:21,900
similar as an effect to error. It just has a different

50
00:02:21,900 --> 00:02:24,410
meaning. So what we do when we use the single property is

51
00:02:24,410 --> 00:02:27,420
that we're saying that this choice, we want to use in only

52
00:02:27,420 --> 00:02:31,120
one combination. So don't combine it multiple times. And that, of course,

53
00:02:31,120 --> 00:02:34,260
given the combinatorial nature of the problem, cuts down dramatically

54
00:02:34,260 --> 00:02:36,370
the number of test cases. And we might use, for

55
00:02:36,370 --> 00:02:39,500
instance, the single property for maxint, which means that we

56
00:02:39,500 --> 00:02:41,890
will only have one test case in which the size is

57
00:02:41,890 --> 00:02:44,300
equal to maxint. We're actually going to see a demo

58
00:02:44,300 --> 00:02:46,880
on this topic so we'll have more chances of seeing how

59
00:02:46,880 --> 00:02:49,370
properties work in practice and how good they are at

60
00:02:49,370 --> 00:02:53,022
eliminating meaningless combinations and at reducing the number of test cases.