Object-oriented programming Flashcards

1
Q

What is encapsulation?

A

A key aspect of OOP - bundling together data and methods that operate on the data into a single unit called a class.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is abstraction?

A

Refers to hiding the internal implementation details of an object. This is achieved in object-oriented programming by providing access to a set of methods and attributes. The “user” of the class doesn’t need to know how the functionality is achieved, they can just call the appropriate method.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is inheritance?

A

The ability to derive one class from another to inherit its attributes and methods. Additional attributes can be defined in the parent class.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is generalisation?

A

The technique of representing the essential characteristics of an entity (these include attributes and methods) into a base class. Specialisation is achieved by creating subclasses with additional attributes and new/overridden methods.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is polymorphism?

A

he ability for methods of the same name to perform different operations. This is achieved using inheritance and overriding methods in the base class, or writing different implementations of the same method for each subclass.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is a class?

A

A blueprint for creating objects, providing a means of storing information in objects (attributes) and defining functionality (methods).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What are objects?

A

Instances of a class.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is an attribute?

A

Variables stored in an object. These are generally initialised when the object is created, but can be modified by class methods or from outside the class.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is a method?

A

Subroutines defined within a class, that typically operate on the attributes of the object, but may also be passed parameters.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What does the term member refer to?

A

The collective name for attributes and methods of a class/object.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is a Level 0 Data Flow Diagram?

A

A Level 0 data flow diagram (also called a context diagram) provides a way to visualise the inputs into the system, the outputs from the system and any entities (people/organisations) involved.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

How do higher level data flow diagrams differ from Level 0 data flow diagrams?

A

While a Level 0 Data Flow Diagrams show the entire system, higher level data flow diagrams represent the system as a number of separate processes and relevant data stores.

The external entities are the same for both diagrams.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What are the symbols used in a Level 0 Data Flow Diagram?

A

Note: Level 0 Data Flow Diagrams

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What are the top-down and bottom-up approaches to software development?

A
  • In the top-down approach, the high level definition of the problem is decomposed into smaller and smaller parts.
  • In the bottom-up approach, individual data and/or operations are considered first and then composed into larger constructs.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is the facade pattern?

A

The façade pattern uses a façade object to simplify the process of using a module that consists of a number of submodules or classes, by creating an “interface” between the different submodules/classes of the module.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is the modular approach to software development?

A

A modular approach refers to separating (or decomposing) a problem into smaller modules, subprograms and subroutines. In OOP, classes would be used in this process.

17
Q

Identify benefits of using a modular approach to software development

A

Planning and designing. Complex problems can be broken down into smaller programs that are often more easily approached individually.

Implementing. Individual modules can be worked on by multiple people, development and ongoing testing is more manageable and progress of the whole project may be clearer.

Testing. The system does need to be tested as a whole, but only after individually testing modules with a full range test data.

Maintaining. Bugs can often be isolated to a single module, and changes to individual modules reduce the risk of larger problems arising.

18
Q

What does a clear and uncluttered mainline mean?

A

The mainline refers to the section of code that is first run when the program starts. Keeping the mainline uncluttered means minimising the amount of processing done in that section of code, and instead writing subroutines to handle that processing. The mainline calls these subroutines (and those subroutines may call other subroutines).

19
Q

What is a stub?

A

A stub is a placeholder for a subroutine that is not yet written. It means that subroutines higher up the calling chain can be written and tested before the stub is fully developed. Instead of performing the required eventual task, it may instead just return a constant that is within the possible return values, or it may just print out a value to the console to indicate that the processing of the overall application has reached it.

20
Q

Distinguish between white, grey and black box testing methodologies

A

These testing methodologies refer to testing a complete software system.

  • White box testing - the tester has complete understanding of how the code works and can run tests based on that internal working.
  • Grey box testing - the tester has partical knowledge of how the internal code works.
  • Black box testing - the tester has no knowledge of how the system works and is only able to observe the outputs from given inputs.
21
Q

What is quality assurance?

A

A set of ongoing processes to ensure that the software meets established standards of quality.

22
Q

Distinguish between unit, subsystem and system testing.

A

Unit Testing
* Used to test individual functions or modules, isolated source code is tested to validate expected behaviour.

Subsystem Testing
* Tests the individual software application for functionality, independent of interactions with other applications or other software systems.

System Testing
* Evaluates the overall functionality and performance of a complete and fully integrated software solution.