次の a~d のうち,オブジェクト指向の基本概念として適切なものだけを全て挙げたものはどれか。 a クラス b 継承 c データの正規化 d ホワイトボックステスト
平成24年度 秋期 ITパスポート試験 問45
This question's explanation and your answers so far.
問 45
- ア
正解 The correct answer is ア, “a, b”. Object orientation is the idea of building a system out of objects — parts that combine data (attributes) with the procedures (methods) that operate on that data. The concepts always cited as its basics are classes, inheritance, encapsulation, and polymorphism, and items a and b in this question fall into that group. A class (a) is a “template” that defines together the attributes and operations shared by objects of the same nature; an actual entity generated from a class is called an instance (object). For example, if an “Employee” class defines the attributes employee number and name together with the operation of calculating pay, each individual employee can be handled as an instance of it. Inheritance (b) is the mechanism by which a new class (subclass, child class) automatically takes over the attributes and operations of an existing class (superclass, parent class), so that a class can be defined by adding or changing only the differences. Because the common parts can be gathered into the upper class, duplicated descriptions are reduced and reusability and maintainability improve. Items c and d, on the other hand, are terms of relational database design and of software testing respectively, and are not object-oriented concepts. Therefore the combination that lists exactly the basic concepts of object orientation, no more and no less, is a and b — that is, ア.
Incorrectイ
Class (a) is indeed a basic concept of object orientation, but data normalization (c) is wrong. Normalization is a design technique for relational databases: items mixed together in a single table are split step by step into first normal form, second normal form, and third normal form in order to prevent duplicated data and the inconsistencies (update anomalies) that arise on insertion, update, and deletion. What it deals with is the functional dependency between tables and items, not the structure of objects or classes, so it is not included among the basic concepts of object orientation. The combination of a and c is therefore inappropriate.
Incorrectウ
Inheritance (b) is indeed a basic concept of object orientation, but data normalization (c) is wrong — the same point as in イ, since normalization is no more than a concept of relational database design. Moreover, this option does not include a, class, which is also a correct concept, so even if c were removed it would still not satisfy the question’s requirement to give “all and only the appropriate items”. Note that both listing all of them and including nothing extra are required.
Incorrectエ
Neither data normalization (c), a design technique of relational database design, nor white-box testing (d) — a testing technique that designs test cases by focusing on the internal logical structure of a module, such as its branches and paths, and that forms a pair with black-box testing, which verifies only the relationship between input and output without looking at the internal structure — is an object-oriented concept. This option contains neither a, class, nor b, inheritance, the basic concepts of object orientation, so it is a doubly wrong combination.
- Basic concepts of object orientation — a class is the template that gathers attributes and operations, an instance is the entity generated from it, and inheritance is defining a class by taking over the attributes and operations of an existing class and specifying only the differences. Also keep in mind encapsulation, which hides the internal data and lets it be handled only through the exposed operations, and polymorphism, in which each object behaves differently in response to the same message; these too are basic concepts.
- Separate confusable terms by field — data normalization is a term of relational database design (eliminating duplication and update anomalies), while white-box testing is a term of software testing technique (designing test cases based on the internal logical structure). For this type of question that asks you to “list all and only the appropriate items”, you must choose the option that both omits none of the correct items and mixes in none of the wrong ones.