Skip to content

平成22年度 秋期 ITパスポート試験 問89

This question's explanation and your answers so far.

問89
頻出度★★★

M さんは,総務課の N さんから宅配荷物の発送業務で利用する料金計算プログラム(以下,プログラムという)の作成を依頼された。そこで,N さんから聞いた料金計算の方法を基に次のように要件をまとめ,プログラムを作成した。 (1) 料金はサイズ区分と発送先の地区から表1の料金表で求める。サイズ区分は荷物の3辺計(荷物の縦,横,高さの長さの合計で1cm単位)と重量(1kg単位)を比較し,どちらか大きい方の区分を適用する。 なお,3辺計が140cm又は重量が20kgを超える荷物は受け付けない。 (2) 荷物の3辺計と重量,発送先の地区(A~D)を入力すると,料金を出力する。 表1 料金表(単位 円)

区分3辺計(cm)重量(kg)ABCD
180まで5まで1,3009501,1501,800
2100まで10まで1,6001,2001,4002,350
3140まで20まで2,0001,6001,8003,400

M さんは,プログラムを N さんに引き渡す前にテストを行うことにした。 テストに当たり,表2の出力結果表を作成し,これに基づいてテストデータを準備した。表2は,入力データが各列に示す Yes の組合せに該当する値であるときの正しい出力を,欄“予想出力”に記入したものである。 表2 出力結果表

123456…36
地区AYesYesYesYesYesYes…
B…
C…
D…Yes
3辺計(cm)80までYesYesYes…
100までYesYesYes…
140まで…Yes
重量(kg)5までYesYes…
10までYesYes…
20までYesYes…Yes
予想出力(円)a…
↑ b↑ c

注 網掛けの部分は,表示していない。 M さんがプログラムのテストに使うデータを準備するために表2の出力結果表を作成した理由として,適切なものはどれか。

出典 平成22年度 秋期 ITパスポート試験 問89
解説

問 89

  • Incorrectア

    Identifying the cases where processing errors are likely to occur describes error guessing, in which you take aim at the spots likely to contain defects on the basis of experience and intuition; it is a technique that picks out only the suspicious cases. Table 2, however, is a table that mechanically lines up all 36 combinations, and nowhere does it distinguish suspicious columns from ordinary ones. It is a table that lines everything up, not one that identifies and selects, so this does not explain why Table 2 was created.

  • Incorrectイ

    Tracing the execution order of instructions to see whether they are executed in the order given by the design is white-box testing, which is based on the internal structure (the code) of the program. What is written in Table 2 is only the combinations of input conditions and the expected fees; no instruction and no processing flow appears at all. The execution order cannot be traced from Table 2, so this is not a reason for creating the table.

  • Incorrectウ

    Selecting the cases that seem likely to occur frequently and testing efficiently with a small amount of test data means narrowing the conceivable cases down to a subset. Table 2, however, has columns for all 36 combinations and thins out not a single one. Moreover, the table contains no information at all showing frequency of occurrence, so there is no basis for narrowing anything down. This is the exact opposite of Table 2, whose purpose is exhaustive coverage.

  • エ

    正解 The correct answer is エ. The answer becomes clear once you work out what kind of table Table 2 really is. Among the input conditions, the district has 4 values (A to D), the 3-dimension total has 3 values (up to 80, up to 100, up to 140), and the weight has 3 values (up to 5, up to 10, up to 20), so the number of combinations is 4 × 3 × 3 = 36. The columns of Table 2 are numbered from 1 to 36, which is exactly these 36 combinations lined up without a single one left out. In each column, exactly one Yes appears in each of the three groups (district, 3-dimension total, weight), so that column represents one input pattern (for example, column 1 is district A, 3-dimension total up to 80, weight up to 5). Furthermore, the Expected output field is not a result obtained by running the program; it is the correct output worked out in advance from the fee table of Table 1, which is the requirement. In other words, Mr. M listed without omission every input combination conceivable from the requirements, fixed the expected value of each one before testing, and then prepared the test data on that basis. This way of working never looks inside the program (its instructions and branches) at all and checks correctness only from the correspondence between input and output; its aim is to test all the cases without omission. Choice エ, which states this, is appropriate.

ここがポイント
  • Test design that uses an output result table (the idea behind a decision table) means enumerating from the requirements every combination of input conditions, fixing the expected value of each combination in advance on the requirements side, and only then running the test. The total number of combinations is the product of the number of options for each condition (here, 4 districts × 3 three-dimension totals × 3 weights = 36).
  • Distinguishing the test techniques: looking only at the correspondence between input and output without asking about the internal structure is black-box testing (Table 2 belongs here), while following the execution paths of instructions and branches is white-box testing. In addition, error guessing and narrowing down by frequency of occurrence are techniques that screen cases for selection, not techniques that cover them exhaustively.
用語

Your answers