Chapter 7 Flashcards

1
Q

What are the four basic activities of software creation?

A
  1. establishing the requirements
  2. creating a design
  3. implementing the code (the easiest part actually)
  4. testing the implementation
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are software requirements?

A

The list of software requirements is list that specifies WHAT the program should do. These requirements must be analyzed and critiqued, leading to other requirements.

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

What is the design of a program?

A

The design specifies the WAY the program is going to accomplish its requirements.
The design should break every requirement into small pieces and manageable pieces.
The design also structures classes and object and the way they will interact with the program.

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

What is implementation in a program?

A

The implementation is the process of TRANSLATING design into a code.

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

What is testing in a program?

A

Testing is process in which the software is put under any possible circumstance to CHECK whether the requirements will be fulfilled and what errors or vulnerabilities can the program have.
Debugging will be the process in which problems and errors will be addressed and solved.

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

What is the lengthiest process in software development?

A

Maintenance: it will exist as long as the program does.

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

What is the build-and-fix approach of software development?

A

It’s the act of building a program that hasn’t been well structured and that with errors and bad design is attempted to be fixed piece by piece when the code is already in place.

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

What does persistence mean?

A

Persistence is the concept of an object remaining stored in memory even after the termination of a program that used it.

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

What is the difference between a normal method and a stiatic method?

A

A normal method is invoked by calling it on an object of class containing the method.

A static method is one that can be invoked by referencing the class name.

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

What is the difference between a normal variable and a static variable?

A

A normal variable is different for every object of the class.

A static variable is a variable that is shared across all objects of a class. This doesn’t mean that the variable is a constant, but it means that every instance of the class refers to the same variable: changing it in one object will change it for every other class as well.

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

Sometimes static methods cannot reference instance variables. Why?

A

Static methods cannot reference instance variables, before an object has been created, as the referenced variables start to exist only with the existence of an object.

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

What kinds of variables and methods can the main method of any class reference?

A

The main method is static and can refer to static or local variables and static methods. The main method cannot refer to instance variables and non-static methods, unless its variables or non-static methods are called thorugh referencing the object.

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

What is a dependency between classes?

A

A dependency means, that a class relies on another in some way, usually by invoking methods of the other.

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

What is an aggregate object?

A

An aggregate object is made up of other objects, whose references are stores as instance variables.

Example:
public class Student {

private String firstName, lastName ; ok
private Address homeAddress, schoolAddress;

}

public class Address {
....
}
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is a Java interface? How is it instantiated?

A

In Java, an interface is a collection of abstract methods and constants.
An interface cannot be instantiated.
It looks something like this:

public interface Doable  {
public void doThis();
public int doThat();
...
}
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is an abstract method?

A

An abstract method is a method header without a method body.

These methods have public visibility by default.

17
Q

What happens if a class declaration implements an interface?

A

If a class declares taht it implements an interface, it must define all methods in the interface (by putting a body in it).

18
Q

What variables can an interface contain?

A

An interface can contain constants.

public static final int…

19
Q

Can multiple classes implement the same interface?

A

Yes.

20
Q

Can a class implement multiple interfaces?

A

Yes: all method listed in the interfaces will have to be declared.

21
Q

The Comparable interface has the method compareTo. How does it work?

A

compareTo confronts in a lexicographical way two strings and returns a negative value is the first is smaller than the second, 0 if they’re equal and a positive value if the first is greater than the second

22
Q

What is the Iterator interface? How is it implemented?

A

An iterator is an object that provides a means of processing a collection of objects one at a time.

An iterator is created formally by implementing the Iterator interface, which contains three methods:

  • The hasNext method returns a boolean result
  • The next method returns the next object in the iteration
  • The remove method removes the last object returned by the next method.
23
Q

What is the Iterable interface?

A

The Iterable interface establishes that an object provides an iterator.

In other words, an Iterable interface has a method called iterator() that returns an Iterator object.

24
Q

What is the difference betwen Iterator and Iterable?

A

An Iterator has methods that perform an iteration. An Iterable object provides an iterator on request.

25
Q

What is the syntax of an enumerated type declaration?
How do the elements of an enumerated type behave?
What are behaviours can an enumerated type have?

A

Example:
enum Season {winter, spring, summer, fall}

The elements of an enumerated type are stored as objects. Like:
Season time = Season.fall;

As an enumerated type is a class, it can act like it. It can have instance variables and methods.
Like:
public enum Season {

winter(“December through February”),

private String span;
...
public String getSpan() {
return span;
}
26
Q

What is the difference betwen putting a primitive data type and an object as a parameter?

A

With primitive data types, the COPY of the actual parameter is stored inside the formal parameter.

When putting an object reference as a parameter, the ACTUAL REFERENCE is copied into the formal parameter, making actual and formal parameter alieases of each other.

This requires a specific care to the parameters.

27
Q

What is method overloading?

A

Method overloading consists in defining two or more method with the same name, on the condition that their signature is different.

The signature of a method is the collection of formal parameters. Their data type, their number of data and its order.

With different signatures, the compiler knows to which “method” refer by reading the arguments put into the method header.

If the signatures are not distnguishable one from the other, the compiler will signal an error.

The return type is not part of the signature.

28
Q

What is the goal of testing?

A

The goal of testing is to find errors. The more errors we find, the stronger is our program.

29
Q

What is a test case?

A

A test case is a set of input and user actions, couples with expected results.

30
Q

What is defect testing? And regression testing?

A

Defect testing is done with the objective of finding errors.
Regression testing is done after a set of errors has been fixed, checking whether others errors have not been introduced.

31
Q

What is black-box testing?

A

Black-box testing consists in running numerous test cases without considering the internal logic. They’re based on input and ouput.

Such testing is helped usually with the introduction of equivalence categories. Two inputs of the same category shoud produce similar results.

32
Q

What is white-box testing?

A

White-box testing focuses on the internal structure of the code.
This is done by analyzing the code.

33
Q

What is a review / inspection / walkthrough?

A

It’s the process in which several people examine a design document or a section of code.

34
Q

What are wizards?

A

Wizards are user-friendly GUI designs that walks a user through a process.

35
Q

What are the events that interact with the mouse?

A
MouseEvent -> event
setOnMouse\_\_\_\_\_\_\_:
- Pressed
- Released
- Clicked
- Entered
- Exited
- Moved
- Dragged
36
Q

What are the events that interact with keys?

A

getCode returns the key that was pressed

setOnKey_____:

  • Pressed
  • Released
  • Typed
37
Q

What is rubberbanding?

A

Rubberbanding consists in drawing a shape into place with the mouse