Professional Documents
Culture Documents
Analysis
The Waterfall Method
Program Design
A fairly detailed plan for solving the problem as described in the specification.
The program design takes into account all of the objects, classes, and the
hierarchy that will be used in the solution. It will also include the data
structures that will implement those objects.
It does not include the minutiae (small, trivial details) of Java code.
Program Implementation
Out - Of - Range Values that are not part of the input domain.
Compile - Time Error: This type of error occurs while the program is
compiling. This means that the compiler is unable to translate the program
into bytecode.
Syntax Error: Syntax errors are compile - time errors, occur due to
breaking programming rules.
Run - Time Error: An error that occurs during the execution of the program,
when the Java run - time environment throws an exception, meaning it stops
execution and prints an error message.
Intent or Logic Error: Error in which the program fails to carry out the
specification of the program. The program compiles and runs but does not do
the job.
Robustness
Robust: A program that will work even if the user of the program does not
follow the directions of the program. A robust program is able to deal with
input data that is not in the input domain.
Program Maintainence
This involves upgrading the code as circumstances change, making the
program easy to follow in the code for new coders and programmers, good
documentation, and allowing for new features to be added easily.
Identifying Classes
When identifying classes, the programmer must decide names that accurately
describe parts of the code. These parts of the code include basic objects,
collections, controllers, and display(s).
Remember, a basic object should not be required to manage actions for the
whole group, only itself.
Also, consider which data fields each class will need and which data
structures should store them.
A wrapper class always has a has - a relationship with any objects that it
wraps.
Implementing Classes
Bottom - Up Development:
In bottom - up development, the developer first starts by, for each method,
listing all of the other classes needed to implement that particular method.
These classes are called collaborators. A class that has no collaborators is
independent.
Then, independent classes are fully implemented and tested before being
incorporated into the overall project. This means that unrelated classes in a
programming project can be implemented by programmers.
There is also a driver class that contains a main method that can be used to
test the program as it is being developed.
Implementing Methods
Procedural Abstraction:
Information Hiding:
Stub Method:
Stub: A dummy method that stands in for a method until the actual method
has been written and tested. It usually has an output statement to show that it
was called in the correct place, or it may return some reasonable values if
necessary.
Algorithm:
Program Analysis
Program Correctness
Although it is not possible to test every single possible input (in many cases),
scientists have developed mathematical techniques to prove correctness in
certain cases.
Assertions
Assertion: A precise statement about a program at any given point. If an
assertion is proved to be true, then the program is working correctly at that
point in time. Assertions are useful for knowing if your code works.
Try to aim for early detection of output conditions. For example, in a sorting
algorithm, once the element or value that the program has been looking for is
found, the sorting algorithm should be stopped, and halted.
Best Case: The configuration of the data that causes the algorithm to run in
the least possible time amount.
Worst Case: A configuration of the data that causes the algorithm to run in
the most possible time amount.
Average Case: Typical configurations, or the time amount for the algorithm
to run under normal conditions.