CSC 227 Lecture Notes - Lecture 1: Junit, Type Safety, Binary Tree

35 views12 pages

Document Summary

Assertequals(string expected, string actual: put @test before the method, @test, public void methodname() //methodname ex: showequals . Actions: guarded action, execute an action only under certain conditions, general form: if( booleanexpression ) Something: alternative action, select between one set of actions or another, must choose one action from two alternatives, general form: if(booleanexpression) thinga. Else thingb: multiple selection, nested logic, general form: Ex: public class controlfuntest, @test, public void testgreeting() Test driven development, test first design: writing the junit test cases first, then writing the class that will be tested. 4/2/16 9:37 pm: variables that store the state of the objects (instance variables, constructors initialize the state of an object, some messages modify the state of objects, some messages provide access to the state of objects. Misc: always use meaningful names, constructors are the same name as the class, make instance variables private, make constructors (no static) and methods public.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents