CSC207H5 Lecture Notes - Lecture 3: Kent Beck, Erich Gamma, Junit
Document Summary
It is a variable which belongs to the class and not to object (instance) Static variables are initialized only once , at the start of the execution. A single copy to be shared by all instances of the class. Misconception: it takes too much extra time to write the test suite! Empirical research repeatedly show that test suites reduce debugging time more than the amount spent building the test suite. Unit tests allows you to make big changes to code quickly: make the change, then click on. If all green, then you know this module is all good. Unit tests help you understand the design of the code you are working on. It forces you to think through the possible inputs and outputs of your code. Test cases should be written even before the implementation. Unit test is not really about finding bugs, it"s about designing software components robustly. Junit is a framework for writing tests in java.