CS307
Object
An object is a software "bundle" consisting of: 1. A set of variables which define the states the object can exist in 2. A set of functions that define the behavior of that object
Data Abstraction
Focuses on what the operations do with the collection of data, instead of on how you implement
Code Peer Review
Peer Review for the Code
Stakeholder
-Anyone involved in anyway with the design, development, or use of the proposed software system -Anyone who operates the software, benefits from the software, involved in the purchase of software, regulatory organizations
Application Domain
-Specific subject matter content which the software will operate on and the environment in which the software will operate -Software for a bank, Missile defense
At which CMMI level is an organization developing software without strictly adhering to plans and procedures, and instead relies on heroics to get the job done?
1
Step-Wise Refinement
1. List all possible objects that might be needed. Create UML class diagram 2. For each class list what it should do. Add this info to the UML diagram 3. For each service/behavior in each class list the functions that might be needed to provide that service or perform that behavior that might be needed 4. for each function in each service/behavior in each class work out the details of the algorithm in psudocode to perform this action.
1. The Proxy Pattern 2. The Bridge Pattern 3. The Builder Pattern
1. Provides a surrogate or place holder 2. Decouples an abstraction from its implementation 3. Separates the construction of a complex object
1. The Iterator Pattern 2. The Composite Pattern 3. The State Pattern
1. Provides a way to access the elements of an aggregation 2. Allows you to compose objects into tree structures 3. Allows object to alter its behavior when intial changes are made
1. The Abstract Factory Pattern 2. The Command Pattern 3. The Adapter Pattern
1. Provides an interface for creating families 2. Encapsulates a request as an object 3. Converts the interface of a class into another interface
1. The Flyweight Pattern 2. The Interpreter Pattern 3. The Mediator Pattern
1. Uses sharing to support large numbers 2. Defines a representation of a grammar for a language 3. Defines an object that encapsulates how a set of objects interact
1. The Template Method Pattern 2. The Façade Pattern 3. The Strategy Pattern
1. defines a skeleton of an algorithm in a method 2. Provides a unified interface to a set of interfaces in a subsystem 3. Defines a family of algorithms
1.The Observer Pattern 2.The Decorator Pattern 3.The Factory Method Pattern
1.Defines a one-to-many 2.Attaches additional responsibilities 3.Defines an interface for creating
From the descriptions below, select the one that best describes what a non-modal or modeless dialog or window is.
A window that can remain open even if the user switches to another window of the application.
From the descriptions below, select the one that best describes what a modal dialog or window is.
A window that must be closed before the user can switch to another window of the application.
Model Review
An inspection, ranging anywhere from a formal technical review to an informal walk-through. It may be done by others who were not directly involved with the development of the model.
During which workflow of the Unified Process / Unified Method are all the requirements and technical details listed?
Analysis Workflow
Which of the following best and mostly completely describes what a "stakeholder" in a software system is?
Anyone involved in any way with the design, development, or use of the software system
What are the three parts of UML (i.e., these three parts make up all of UML)?
Basic building blocks, rules controlling how the blocks are put together, and common mechanisms
Common Language Runtime
CLR Allows you to include C, ISO/C++, and C++/CLI in the same program and still compile it
Specification
Clearly state the requirements
Which of the following terms matches this definition: "Hiding how any of an object's behaviors are performed so that nothing outside of the object becomes dependent on the object performing some action in a particular way."
Data abstraction
Which of the following terms matches this definition: "Making the internal state of an object not directly accessible, but instead requiring all interactions that access the internal state to be performed through the object's methods/interface."
Data hiding
Analysis
Do we understand the requirements
In Visual Studio, the Resource Editor shows a preview of what the GUI window will look like and allows you to drag-and-drop widgets into the GUI. We also learned that you can easily add an event handler to a widget in this view by doing which of the following:
Double clicking the widget
Object-Oriented Design
Elaborates the analysis models to produce implementation specifications.(How the system does it)
Which of the following terms matches this definition: "Binding together both the data and the functions that act on the data into a unit/object."
Encapsulation
Which of the following is not one of the steps for determining the requirements of the software system?
Evaluation
In the Unified Method / Unified Process, testing is done only in the testing workflow, and no testing is done in any of the other workflows.
False
The Open-Closed Principle, which states that "Classes should be open for extension, but closed for modification" means that every class in our code should be open for extension.
False
Elicitation
Find the requirements of the software
Black Box Testing
Give the function an appropriate input and expect an output Can't look at the code
We discussed a study by the Standish Group that found that very few software projects are delivered on time and within budget. What five reasons were given for this?
Incomplete Requirements Lack of user involvement Unrealistic expectations Changing requirements and expectations Lack of planning
One of our design principles states, "Favor composition over inheritance." Does this mean that we should always avoid inheritance? What is the advantage of favoring composition over inheritance?
Inheritance can be used if you know that something will not change. Composition is easier to change later in the program than inheritance.
What is wrong with the following function? (Assume all necessary #includes have been done, and that we've indicated we're using the namespace std.) int *returnPointer() { int a = 5; return &a; }
It's unsafe to return the address of a non-static (temporary) local
Encapsulation
Keeping details (like data and procedures) together in one part of a program so that programmers working on other parts of the program don't need to know about them.
Statement Testing
Make sure every line of code is executed in one test (test every statement of code) -Use Drivers to pass known values in as arguments -Use Debugger to check validity of variables -Use special output statements to check states -Test each statement or set of statements as they are added to a function
Validation
Make sure they are correct
Polymorphism
Objects can determine appropriate operations at execution time
Requirements Analysis
Process of Determining what software should do
Select the four different types of testing that we identified as being done in the Implementation Workflow of the Unified Method / Unified Model.
Statement testing Unit testing Integration testing Code peer reviews
Which of these is a "top-down" approach to software development?
Structured or Classical Paradigm
Boundary value testing
Testing all the possible unusual or rare cases in the execution of a function. Check start, end and middle of the list
client->handler<---------------| | | | | concreteHandler1 ConcreteHandler2
The Chain of Responsibility Pattern
Which Design Pattern best fits the following description: Without violating encapsulation, captures and externalizes an object's internal state so that the object can be restored to this state later.
The Memento Pattern
Preemptive Multitasking
The OS allocates a slice of time in each second in which to run. At the end of an application's slice it is suspended by the operating system until it is that applications turn to run again.
Which Design Pattern best fits the following description: Specifies the kinds of objects to create using a prototypical instance, and creates new objects by copying this prototype.
The Prototype Pattern
Below is the class interface file for an implementation of one of the design patterns we talked about in this module. Which one is it? (Hint: Make sure you look at the access specifiers for all the variables / methods.) //================================= // DPDemo.h //================================= #ifndef DPDEMO_H #define DPDEMO_H class DPDemo { private: int instanceNumber; DPDemo(); public: ~DPDemo(); int getInstanceNumber(); static DPDemo *getInstance(); }; #endif
The Singleton Pattern
Which Design Pattern best fits the following description: Represents an operation to be performed on the elements of an object structure. This pattern lets you define a new operation without changing the classes of the elements on which it operates.
The Visitor Pattern
Which of these best describes the way events, like mouse clicks or menu selections, are handled by a GUI program as described in this module?
The operating system handles all input. The GUI program just registers callbacks / event handlers that are called by the operating system when an event is detected.
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.
Cooperative Multitasking
The programmer must voluntarily surrender control back to the operating system so it can allocate time slices to other processes. An older approach
Stress Testing
This is ensuring that the system performs as expected under high volumes of transactions, users, load, and so on.
Installation Testing
This testing verifies that the software been correctly installed at the customers site and that it works as expected.
In the Unified Method / Unified Process, testing is done simultaneously with other workflows instead of just being done at the end as in the Classical approach.
True
Match the following description with the type of software testing it describes: "Testing that is done on a single function. These often use drivers to pass in known values as arguments to the function being tested, and the goal is to test every possible path through the function."
Unit Testing
Match the following description with the type of software testing it describes: "A testing technique in which one or more persons validates a model by acting through the logic of usage scenarios."
Usage scenario testing
Unit Testing
Use drivers to pass known values in as arguments -Use stubs to test function calling actions -pass in fake results -Use separate tests for each possible path -Test all possible behaviors of the functions -Test for occurrence of fault conditions -Get someone to break your code -Use Debugger to check validity of variables
White/Clear Box Testing
Verifying that specific paths through a function work as defined knowing all the paths of execution through the function. Plot out and devise test cases to test each individual class Look at the code and plot
What is the name of the entrypoint function in a Windows GUI program, as described in this module?
WinMain
We talked about three different ways of doing Windows GUIs: the Windows API, Microsoft Foundation Classes (MFC), and Windows Forms. Which of these was used in the two GUI programs we wrote in this module?
Windows API
One of our design principles states, "Identify the aspects of your application that vary and separate them from what stays the same." Why?
You need to accommodate your program to any changes that might occur. You can identify classes that may change and work on them separately so that can test the change instead of re-working everything.
Extreme Programming (XP)
a discipline of software development based on values of simplicity, communication, feedback, and courage
Unified Process / Unified Model
a specific methodology that maps out when and how to use the various UML techniques for OO analysis and design
Data Hiding
allows the internal data and methods to be hidden. It controls outside access
Inheritance
allows you to reuse classes you defined earlier for a related purpose by extending that implementation or making slight modification.
add a string to the end of the vector
colour.push_back("Blue");
Alpha Testing
first release of the product select users get access and give your feedback (bugs, feedback, etc.
Regression Fault
helps development teams concentrate on new functionality, while maintaining stability with every new product increment. make sure that tested software continues to perform after every modification.
Multiple Inheritance
in an object-oriented system, the ability of a class to have multiple superclasses and to inherit methods from all of them.
The Agile Manifesto states that some things should be valued more over others (i.e., valued most). Select all those things that the Agile Manifesto says to value most.
individuals and interactions working software customer collaboration responding to change
When one class subclasses another class, the subclass receives all the same fields and methods that were defined in the parent class via a process called
inheritance
device context
is a Windows data structure containing information about the drawing attributes of a device such as a display or a printer.
modal dialog
is a window that forces the user to interact with it before they can go back to using the parent application
Scrum
is an iterative and incremental agile software development method for managing software projects and product or application development. It focuses on project management institutions where it is difficult to plan ahead.
In the world of object oriented programming, instead of thinking of objects as 'calling methods' on each other, we think of them as passing '___________________________' that contain information information about the receiver, the method to be executed, and the method arguments."
messages
how to get the number of items in the vector
myvector.size();
Object-Oriented Analysis
object-modeling techniques to analyze the functional requirements for the system(focuses on what)
Microsoft Foundation Classes (MFC)
provide a C++ object-oriented wrapper over Win32 for rapid development of native desktop applications.
What is wrong with the following code snippet? (Assume all necessary #includes have been done, and that we've indicated we're using the namespace std.) char myString[] = "Hello"; //Print out hello cout << myString << endl; //Change the string myString = "Hey"; //Now print out hey cout << myString << endl;
strcpy must be used, instead of the equal sign, to assign a character array a new value
Regression Testing
testing after fixing bugs or adding new features -Perform full unit testing on new code -Perform full integration testing on all sections of the application affected by the new code -Perform acceptance testing to verify new code meets requirements to fix bug or add new feature.
Prototype Walkthrough
users walk through a collection of use cases using a prototype as if the prototype was a real system and seeing if it meets requirements
make a vector of strings
vector<string> colour