• Shuffle
    Toggle On
    Toggle Off
  • Alphabetize
    Toggle On
    Toggle Off
  • Front First
    Toggle On
    Toggle Off
  • Both Sides
    Toggle On
    Toggle Off
  • Read
    Toggle On
    Toggle Off
Reading...
Front

Card Range To Study

through

image

Play button

image

Play button

image

Progress

1/53

Click to flip

Use LEFT and RIGHT arrow keys to navigate between flashcards;

Use UP and DOWN arrow keys to flip the card;

H to show hint;

A reads text to speech;

53 Cards in this Set

  • Front
  • Back
Abstraction
The user doesn't need to know implementation details. However, they aren't prevented from accessing the details of the implementation.
Data Type
A set of data values and their representation as well as the operations which you can perform on such data. Data types can either be primitive in Java, such as boolean or int, be provided to us in libraries, such as string, or be made in classes and expressed in objects, such as bounded bags.
Data Abstraction
Application of abstraction to the definition of a data type.
Algorithm
A set number of steps that solves some well-defined problem.
Type Specific Code
Writing different versions of a method to handle different data types.
Generic Method
A single piece of code that can operate on multiple different data types. The data type takes a type argument.
Encapsulation
Also known as information hiding. Hides the implementation details in the Java class, so that the user must use the API to access the object.
Inheritance
An objection oriented programming principle which allows a class to "extend" another class, and inherit all of the superclass' methods. Provides versatility. A student Is A person." Thus students have all of the
API
Application Programming Interface. The ADT's public interface. The user utilizes the API.
Class Cohesion
High cohesion for a class means single, well-defined purpose. Low cohesion would mean that the class reveals too much about its implementation and tries to fulfill too many roles.
Coupling
Tight coupling means that a class is highly dependent on many other classes to accomplish it's goals. More loosely coupled classes have fewer dependencies.
Composition
Has-a relationship. Powerful Object Oriented Programming principle which allows classes to be made from pieces
of other classes. For example, a car (class) has an engine (class), transmission (class), etc.
Abstract Method
A method which does not have everything implemented.
Concrete Class
A class which has implementation for all its methods, so that it can be instantiated.
Override
A function that has already been created is reimplemented. The two methods have the same signature, but the replacement method has the @override tag.
Overload
Two methods with the same name have different method signatures by having a different number of arguments. The number of arguments can be the same, but they must be of different types. Static polymorphism.
Marker Interface
An interface with no actual methods or fields that states that the implementing classes have a particular capability. A class such as Cloneable is a Marker Interface.
Random-Access
It's equally efficient to access any given point in the data structure. Array is random access, the objects in a Doubly Linked List are not random access.
Required / Optional Methods
A concerete class implemening the interface must implement every required method. It may choose to implement optional methods, but can also simply throw an exception if the user tries to access an unimplemented optional method.
Clear Box Testing / Black Box Testing
Black Box: Testing solely based on the expected behavior. This is from the perspective of the client.
Clear Box: Looks at the code and thinks about boundary conditions or trouble spots that would need special attention to be coded, creating test cases based on those situations. The test knows the actual implementation of the class.
What are the principles of Object Oriented Programming?
Open Close Principle
Single Responsibility
Dependency Inversion
What are the four steps used for writing a member function.
Ready
Aim
Fire
Finish
What is a precondition?
The conditions assumed to be true on entry to a member function for the member function to correctly execute. The precondition is the responsibility of the caller.
What is a post condition?
What the member function guarantees to be true on any exit from the member function. The post condition is the responsibility of the member function.
What is programming by contract?
Formally stating the pre and post conditions using mathematical terminology.
What is contained in the signature of a method?
The method name, the data type of its parameters, the visibility, and the return type, if any.
What is implied by the contract?
If the preconditions are met, the the post conditions will also be met on every exit from the member function.
What is a class invariant?
The conditions that must be true for the object to be in a legal state. The invariant must be true at the start and end of any member function
What is DeMorgan's Law?
NOT (p OR q) = (NOT p) AND (NOT q)
What is the associative property in reference to logic?
p OR (q OR r) = (p OR q) OR r

p AND (q AND r) = (p AND q) AND r
What is the distributive property in reference to logic?
p OR (q AND r) = (p OR q) AND (p OR r)

p AND (q OR r) = (p AND q) OR (p AND r)
What is "E"?
"E" is a type parameter used by a generic.
What are assert statements?
Assert statements are similar to class invariants, but they are implemented within the actual methods.
What is nesting?
Nesting occurs when a class in wholly contained within another class.
What are the two types of equality, describe them.
== determines if the two objects are identical by checking to see if they have the same memory location.
.equals() checks to see if two objects are equivalent by checking the actual data values.
What is refactoring and at what step is it traditionally completed in the creation of a class?
Making small changes to code that do not change its functionality, but make it better is called refactoring. It is usually done during the "finish" step.
What is an iterator?
An iterator is an object that moves through all of the members of a data structure, accessing each member only once.
What are the four different categories that are described in the properties section of the contract? Describe them.
Inverse - tells whether or not there is another function that has the exact opposite functionality. It must be an inverse in all situations.
Mutator acts as an Observer - Is there a situation when a mutator only acts as an observer?
Idempotent - Is there any difference in an object if this method is run numerous times?
Local - Does this method change objects other than the one that it is operating on?
Describe the four steps in writing a method.
Ready - Write the method signature and the contract.
Aim - Find the typical and boundary condition cases and write tests for each of these.
Fire - Write the actual code of the method.
Finish - Extract repeated code, ensure that all variables have descriptive names, replace "magic numbers" with variables, and create parameter validations.
Describe the three principles of Object Oriented Programming.
Open Close Principle - The class is open to extension, but close to modification from the outside.
Single Responsibility - a method and a class should only do one very specific thing. Thus it should be considered to have a high level of cohesion.
Dependency Inversion - A class should always rely on an interface or an abstract class and never on a concrete class.
What are the types of testing?
Unit Testing
Component Testing
System Testing
What are the areas that Unit Testing looks at?
Functionality
Correctness
Performance
(Martin Reading) What causes software to decay and why?
A). Rigidity - Because of bad design, Changing the software is too time-consuming and difficult that we opt against change, making the software decay. B). Fragility - Because of bad design, Changing the software creates too many problems in dependencies that we opt against making the changes, so the software decays. C). Immobility - Borrowing pieces of software is too difficult because of bad design, so we opt to just rewrite and redo it instead. D). Viscosity -Doing the right thing from a design perspective is simply too hard or takes too long, so we are inclined towards the easier hack solutions which decay and degrade the software.
(Martin Reading) What is inevitable in our software development?
Software requirements will change, so we need to take care to make sure our designs were flexible in the first place to be ready to accept changes in software requirements.
(Martin Reading) What is the most effective way to not break working code?
To not have to change it in the first place. Even Partial OCP compliance can allow you, through abstraction, to create new classes which allow you to adapt to changing requirements without having to change working code. Only add new code is the goal.
(Martin Reading) What is the Liskov Substitution Princple?
If some user take an argument of type base, the super class (example, Drive(compactcar), then it should be legal to pass in an instance of Derived, the subclass, (for example, (Drive(Luxurycar)). The reason why square and rectangle don’t work as inheritance. The contract for the base class must be honored by the derived class, even if the contract is merely implied from a client perspective rather than explicitly logical from our programming perspective (better to err on the side of the client making mistakes).
(Martin Reading) What is the interface segregation principle?
Many client specific interfaces are better than one general purpose interface. Rather than load the class with every method that might be needed by any client, create multiple interfaces and use inheritance
(UML) What shows inheritance?
A solid line between the two classes, Closed arrow -no fill (looks like a triangle), pointing towards the superclass
(UML) How to display a set number of compositions (ex. A Car has four tires)
a solid line between the two classes, with a Closed diamond - no fill, with a number in it.
(UML) How do you display an interface to a more concrete class?
A dotted line between the two classes, likely with a closed arrow (no fill, looks like a triangle), pointing towards the interface.
(UML) How do you show a general relationship between two classes, such as simple composition?
A solid line, with an open arrow (looks like a simple arrow), with the direction that information is most likely to flow (for example, a Car class sends messages to an engine class, while the engine class makes decisions and runs operations no matter what it is in/where it is. So the arrow points to the engine, which recieves the signals from {is called via parameters from} the car class.
What does static mean and what are static data members and static methods?
Static genreally means that something is associated with the class, rather than objects that are created by the class. Static member functions are generally the final constants which we set. Static member functions could be some utility functions such as check for
What are the four steps of testing
Set up code, execute the test code, verify the results of the test code, tear down.