CSC207H5 Lecture Notes - Lecture 3: Junit, University Of Toronto Mississauga, Liskov Substitution Principle
Document Summary
Lecture 3: oo-programming + inheritance keyword static on variables. Initialized only once, at the start of the execution. Single copy to be shared by all instance of the class. Need to be more under controlled as you can change the variable outside the class. There is too much dependence between the objects; very easy to collapse the entire program. Misconception: takes too much time to write the test suite (test cases) Focuses you to think possible inputs and outputs. Should be written even before the implementation. Framework for writing tests in java; written by erich gamma and kent beck. Each method in unit test are labelled @before, @test and @after ( read more: . @before - some setup/prep work before running tests (eg. open files) @after - clean up after tests finish. Inheritance hierarchy, with class object at the root. All other java classes have one parent. if a class has no parent declared (not extending any class), .