80 likes | 117 Views
Software Development Cycle. From Wikipedia: http://en.wikipedia.org/wiki/Systems_development_life-cycle Preliminary Analysis Systems analysis, requirements definition Systems design Development Integration and testing Acceptance, installation, deployment Maintenance.
E N D
Software Development Cycle • From Wikipedia:http://en.wikipedia.org/wiki/Systems_development_life-cycle • Preliminary Analysis • Systems analysis, requirements definition • Systems design • Development • Integration and testing • Acceptance, installation, deployment • Maintenance
Validation vs. Verification • Validation involves testing: white box vs. black box testing, alpha- and beta-test • Testing may be thorough, but not exhaustive • Verification is (mathematically) proving that the program meets the input/output specifications. • Use formal procedures
Types of Errors • Syntax Errors: Missing ; { }, misspelling, case differences, missing declarations, missing import statement, ... • Run-time Errors: Array boundary violations, null pointer exception, ... • Design Flaw: Misunderstanding of program requirements, program works sometimes, but not always
Debugging Strategies • Strategic printing: System.err.println() • Print out values of parameters when entering method and return values before leaving to isolate the error • Use of debugger:http://drjava.sourceforge.net/docs/user/ch09.html • Setting breakpoints, watches • Allows user to interact as program runs
Polymorphism • An object may be of more than one class, e.g., a Ship is a Thing is an Object (due to inheritance) • A derived class may override methods of the base class • Which method is called? • Especially tricky because variables may be cast to other types from what was declared, e.g., Thing[][] b = new Thing[10][10]; b[0][0] = new Ship(4,"Battleship",'B');
Early vs. Late Binding • Early, or static, binding is when the choice is made at compile time. The type of the variable is used to determine which method is called. For example, b[0][0].shootAt() would call the Thing shootAt() method, not the Ship one. • Late, or dynamic, binding is when the choice is made at run-time. The type of the actual object is used to select the method, so Ship shootAt() is called. • Java uses late binding. • This means that objects must know their types.
Static Methods • Since static methods belong to the class, not to an object, late binding cannot be used for them. • Static methods use early, or static, binding. The type of variable determines the method that is called.
Final Modifier • A class may be declared to be final which means that is cannot be subclassed. • A method may be declared to be final which means that it may not be overidden.