Test 1 Flashcards
Software Development Lifecycle (steps)
REQUIREMENTS Determine the required input and output.
DESIGN a solution to the problem / develop an algorithm
CODE / DEVELOPMENT – translate the algorithm into code. Develop an effective user interface that obtains required inputs from the user and displays results.
TESTING and DEBUG the program. How can you prove to yourself (and others) that the program works for all expected and unexpected inputs?
PRODUCTION / DEPLOYMENT
MAINTENANCE * longest stage *
DOCUMENTATION throughout.
Design consideration
Algorithm and classes
Classes - what’s private / public.
Design consideration
Private: instance variables, helper methods Public: constants, class methods
Coupling
Design consideration
Minimize coupling between classes / modules.
Coupling is the degree to which a class interacts with or depends on another class.
undesirable state in which two methods or processes rigidly depend on each other. Coupling and dependencies between methods should be minimized.
Cohesion
Design consideration
How well a class encapsulates a single notion.
Maximize within classes / modules.
desirable quality in which the responsibilities of a method or process are closely related to each other.
Architecture (class hierarchy)
Design consideration
class relationships
Programming by Contract:
What this means. Contract between what parties?
Client and supplier.
Agreement that supplier will deliver on post-conditions, and client will follow requirements of pre-conditions. Rights / responsibilities.
Public interface = contract
Programming by Contract:
What goes into the public interface documentation?
Public interface:
- What are the benefits?
- Rights / responsibilities.
Specification:
- restriction on arguments
- what return will be
- any state changes that might happen and when
- when any exceptions might be thrown.
Programming by Contract:
Advantages for client/supplier of distinction between public/private members
controlling what members can be accessed and updated with / without use of an object / method. private will keep certain values protected from the client so they don’t accidentally get changed
Unit testing:
What this means
Test individual properties or operations of objects.
Unit Testing
When should testing design happen
Frequently. Do many small unit tests versus big complicated tests.
Precondition
something that must be true before a method can be called
Postcondition
something guaranteed to be true after method finishes.
Class invariant
something that must always hold true.
UML Object Diagram
represents state of object in memory at given point of execution