CS 307 Final Study Guide
define implementation file (in relation to classes)
(.cpp) file defining the behaviors (functions) of the class.
define instanstiation (in relation to classes)
(noun) The object that is created during the process of Instantiation (v). An instance of a class.
UML consists of what three parts?
1. Building Blocks 2. Rules controlling how the blocks work together 3. Common mechanisms applied throughout the language
What are the three categories of Design Patterns?
1. Creational 2. Structural 3. Behavioral
What are the four types of relationships that can exist between objects?
1. Dependency 2. Association 3. Generalization 4. Realization
What are the four processes of requirements specification?
1. Elicitation 2. Analysis 3. Specification 4. Validation
Briefly discuss the concept of objects interacting by exchanging messages?
1. Message Receiver 2. Method to Invoke 3. Args to method (cRectangle->draw(args)) Means to call a function in another object
What are the 3 characteristics of an object?
1. State 2. Defined Behaviors 3. Defined ways of modifying the State
What are the three types of building blocks that make up the Unified Modeling Language (UML)?
1. Things 2. Relationships 3. Diagrams
Show how to define a pointer to a function given the function arguments and return type (1). Show how to set the function pointer pointing to the function (2) and how to use the pointer to call the function (3)
1. int (*fptr)(double, long); 2. fptr = testFunction; 3. NEED
What are the 5 types of software testing?
1. statement 2. unit 3. integration 4. acceptance 5. regression
What are the four types of type casting used in C++?
1. static_cast - Casting from one datatype to another 2. reinterpret_cast - Casting from a pointer to the integer value of said pointer 3. const_cast - Casting a const variable to a non-const variable 4. dynamic_cast - Casting one object to another of a different type
What 3 aspects of c++ programming language make the use of templates possible?
1. void pointers 2. function overloading 3. pointers to functions
define interface file (in relation to classes)
A (.h) file defining the states (member variables) and behaviors (prototyping the functions) of the class
Define multiple inheritence
A class inherits two or more classes
What are virtual functions?
A function by a parent class that a subclass must implement for its own use
define friend function (in relation to classes)
A function that is not part of a class but has access to all of its private member variables and functions
define const (in relation to classes)
A keyword that makes a value unmodifiable
Define extern
A keyword that specifies a variable or function has already been defined somewhere else
Define inheritence
A mechanism by which one class acquires the properties (member variables and member functions) of another class.
Object
A software "bundle", usually thought of as being a class or structure consisting of a set of variables which define the states the object can exist in and a set of functions that define the behavior of that object. Software objects are often used to model the real-world objects that you find in everyday life.
Define requirements as it's related to software engineering
A statement of what is to be provided by a computer system or software product. An expression of desired behavior for a software system. It's a specific thing your system has to do to work correctly.
What is the Unified Modeling Language (UML) and what is it used for?
A system that allows a software designer to graphically layout and model a software application. It gives designers a way to literally draw a map of how a piece of software will be constructed and function.
state design pattern
Allow an object to alter its behavior when its internal state changes. The object will appear to change its class.
composite design pattern
Allows you to compose objects into tree structures to represent part-whole hierarchies. ___________ lets clients treat individual objects and compositions of objects uniformly.
Define static
An access specifier that can be used 3 ways: 1. A static variable inside a function maintains its value for all calls to that function 2. A static function in a class definition can be called without an instance of the class 3. A global variable declared as static in a source code file cannot be declared as extern in another source file and accessed
decorator design pattern
Attach additional responsibilities to an object dynamically. _________ provides a flexible alternative to subclassing for extending functionality.
chain of responsibility design pattern
Avoid coupling the sender of a request to its receiver by giving more than one object a chance to handle the request. Chain the receiving objects and pass the request along the chain until an object handles it.
Be able to match UML diagrams with their graphics
Be able to match UML diagrams with their graphics
Be able to match UML relationships with their graphics
Be able to match UML relationships with their graphics
Be able to match UML things with their graphics
Be able to match UML things with their graphics
adapter design pattern
Convert the interface of a class into another interface the clients expect. _________ lets classes work together that couldn't otherwise because of incompatible interfaces.
bridge design pattern
Decouple an abstraction from its implementation so that the two can vary independently.
interpreter design pattern
Define a representation of the grammar for a language along with an ________ that uses the representation to_________ sentences in the language.
factory method design pattern
Define an interface for creating an object, but let subclasses decide which class to instantiate. ________ lets a class defer instantiation to subclasses
mediator design pattern
Define an object that encapsulates how a set of objects interact. __________ promotes loose coupling by keeping objects from referring to each other explicitly, and lets you vary their interaction independently.
template method design pattern
Define the skeleton of an algorithm in a method, deferring some steps to subclasses. ___________lets subclasses redefine certain steps of an algorithm without changing the algorithm's structure.
Strategy design pattern
Defines a family of algorithms, encapsulates each one, and makes them interchangeable
observer design pattern
Defines a one-to-many dependency between objects so that when one object changes state, all of its dependents are notified and updated automatically.
Define requirements analysis as it's related to software engineering
Determining exactly what the software should do. It is the process of studying and analyzing what the customer wants in order to develop a stated list of requirements
command design pattern
Encapsulate a request as an object, thereby letting you parameterize other objects with different requests, queue or log requests, and support undoable operations.
singleton design pattern
Ensure a class has only one instance, and provides a global point of access to it.
Given a Design Pattern be able to draw a UML diagram illustrating how this pattern is used. This can be a generic diagram or one of a specific example presented in class. The possible patterns included in this are: Strategy, Observer, Decorator, Factory Method, Abstract Factory, Singleton, Command, Adapter, Facade, Template Method, Iterator, Composite, State, and Proxy.
Given a Design Pattern be able to draw a UML diagram illustrating how this pattern is used. This can be a generic diagram or one of a specific example presented in class. The possible patterns included in this are: Strategy, Observer, Decorator, Factory Method, Abstract Factory, Singleton, Command, Adapter, Facade, Template Method, Iterator, Composite, State, and Proxy.
Given a brief description of the design of a small program (classes with a list of member functions and all function calls each makes) draw using appropriate UML graphics a Sequence Diagram of the program.
Given a brief description of the design of a small program (classes with a list of member functions and all function calls each makes) draw using appropriate UML graphics a Sequence Diagram of the program.
Given a brief description of the design of a small program (classes with a list of member variables and member functions) draw, using appropriate UML graphics, a Class Diagram of the program. This includes a graphic for each class and the appropriate relationship graphics between them.
Given a brief description of the design of a small program (classes with a list of member variables and member functions) draw, using appropriate UML graphics, a Class Diagram of the program. This includes a graphic for each class and the appropriate relationship graphics between them.
Given a list of the Design Patterns from the GoF book and a list of brief definitions of the Patterns be able to match the name with the definition.
Given a list of the Design Patterns from the GoF book and a list of brief definitions of the Patterns be able to match the name with the definition.
What type(s) of testing is done in each of the workflows of the Unified Method.
Implementation - statement & unit testing Implementation & testing - integration Testing - acceptance Post Delivery Maintenance- regression
What is a class and how does it relate to an object in a software system?
In C++ _________ represent objects in a program; _________ are the "blueprints" for building objects.
What are some possible dangers in the use of multiple inheritance?.
Multiple inheritance structures can become too complex and ambiguous leading to obscure and potentially unstable code
show how to create and use a reference variable
NEED
proxy design pattern
Provide a surrogate or placeholder for another object to control access to it.
facade design pattern
Provide a unified interface to a set of interfaces in a subsystem. _________ defines a higher-level interface that makes the subsystem easier to use.
iterator design pattern
Provide a way to access the elements of an aggregate object sequentially without exposing its underlying representation.
abstract factory design pattern
Provide an interface for creating families of related or dependent objects without specifying their concrete classes.
visitor design pattern
Represent an operation to be performed on the elements of an object structure. __________ lets you define a new operation without changing the classes of the elements on which it operates.
builder design pattern
Separates the construction of a complex object from its representation so that the same construction process can create different representations.
Show the implementation (.h and .cpp files) illustrating how to create a Singleton of a class.
Show the implementation (.h and .cpp files) illustrating how to create a Singleton of a class.
prototype design pattern
Specify the kinds of objects to create using a prototypical instance, and create new objects by copying this prototype.
Briefly explain the advantages of using Design Patterns.
Speed up the development process Helps to prevent subtle issues that can cause major problems Improves readability of the code Provides patterns for solving problems Provides a common language for designers
What is meant by the term data encapsulation?
Storing data and the methods access and change that data into a single entity/ binding together both the data and the functions which act on the data into a unit (object)
What is meant by bottom up testing?
Testing to ensure the components of the system work together correctly
What is meant by top down testing?
Testing to ensure the processes of the system work correctly
Define polymorphism
The ability of different sub-classes of a parent class to inherit functions from the parent class yet implement the functions in very different ways.
Why can you not overload a function by return type alone?
The compiler cannot determine which function is being called
Define step wise refinement as it is used in software engineering
The process in software design of starting off at a high level of abstraction and working down through an iterative process to add more and more detail to the design.
Define verification
The process of determining the degree to which a piece of software produces results that are accurate. Does it do what it is supposed to do correctly, i.e. did you build the software right.
Define validation
The process of determining the degree to which a piece of software produces results that satisfy the original requirements. Does it do what it is supposed to do, i.e. did you build the right software.
What does upcasting mean?
The process of treating a sub-class object as if it were an instance of its parent class
Define cooperative multitasking
The programmer must voluntarily surrender control back to the operating system so it can allocate time slices to other processes (older approach)
Define scope
The region of a program in which a variable exists
What is the basic difference between the requirements definition document and the requirements specification document?
The requirements definition document verifies with the customer the scope of the requirements (FOR THE CUSTOMERS) The requirements specification document is written in terms the software designers and programmers can use (FOR THE PROGRAMMERS)
Define object oriented design as it is used in software engineering
The use of data abstraction, inheritance and dynamic binding (memory allocation) to construct programs that are collections of interacting objects. The process of using objects as the building blocks of a program. aka Bottom Up Design.
What is the purpose of a friend function?
To give functions that are separated from a class quick access to member data if needed
flyweight design pattern
Use sharing to support large numbers of fine-grained objects efficiently.
Explain what default arguments to functions are and show how you would declare default values for arguments to a function.
Values to be assigned inside a function if a value is not explicitly passed see: http://quiz.geeksforgeeks.org/default-arguments-c/
Define black box testing
Verifying that a function being tested, when given the appropriate input, provides the expected results without knowing the structure of the code in the function.
Define white box testing
Verifying that specific paths through a function work as defined knowing all the paths of execution through the function.
memento design pattern
Without violating encapsulation, capture and externalize an object's internal state so that the object can be restored to this state later.
Define dependency
a semantic relationship in which a change on one thing changes the other thing
Define function stub
a special function written to use as a testing function-- returns known outputs to a calling function to see how the calling function handles the returned values. used to test higher level functions
define function driver
a special function written to use as a testing function. passes known inputs to selected functions and reports the returned values. used to test lower level functions
Define association
a structural relationship describing links between objects.
What is an enumerated data type? Show how to define one, create a variable of the type, and store values in the variable.
a user defined data type whose domain is an ordered set of literal values expressed as identifiers. enum Days {SUN, MON, TUE, WED, THUR, FRI, SAT}; Days d; d=WED; *See data types series of slides from 121
Define reference variable
a variable that is an alias for another
Show how to declare a function, not part of a class, as a friend function. What is the purpose of a friend function?
class Box { double width; public: friend void printWidth( Box box ); }; Purpose: This approach may be used in friendly function when a function needs to access private data in objects from two different classes
In the definition of a class (in the .h file) what is the syntax for indicating the class has more than one parent class, i.e. has multiple inheritance?.
class Snake : public Animal, public Drawing
define realization
defines a relationship in which one class speicifies something that another class should perform
Define generalization
describes the relationship between parent class and subclass
Describe the creational design pattern
focuses on how objects are created; often involves isolating the details of object creations in such a way that you don't to make major changes to your code when you have to create a new type of object.
Describe the structural design pattern
focuses on how objects are interconnected; attempts to ensure that changes in the system don't require changes in those connections; those patterns are often dictated by project constraints.
Describe the behavioral design pattern
focuses on objects that handle particular types of behavior; encapsulates processes such as interpreting a language, fulfilling a request, moving through a sequence (as an iterator), or implementing an algorithm.
What are Design Patterns?
general, reusable solutions to commonly occurring problems in software design; a description or template for how to solve a problem that can be used in many different situations; ways of organizing code to increase efficiency and provide greater Object Oriented Design.
What is operator overloading? Show how to create a function that overloads an operator (such as =, ==, <, >) in a class.
multiple uses for a single operator. for example > can be used as a comparison, but can also be used as a pointer ->
define instance (in relation to classes)
objects created while the program is running
define member access specifiers (in relation to classes)
public, private, and protected.; Decide how members of a class can be accessed
What is regression testing?
testing after fixing bugs or adding new features
What is integration testing?
testing how functions work together
What is unit testing?
testing single functions
What is statement testing?
testing single lines or blocks of lines
What is function overloading? Show how to create an overloaded function in a class.
the ability of two functions with the same name but different parameters to exist in the same program or class. int Multiply (int arg1, int arg2); long Multiply (long arg1, long arg 2); float Multiply (float arg1, float arg2);