why test? break our code, so we can fix it if we skip testing, certain to have a poor product testing is much more important with big software when to test? assignments must work with given test input order of tests test pieces separately, then integrate depends on project, dev comfort level who should test? devs aren't good at finding their own errors even if all tests pass, they're useful to make sure that they STILL pass later regression testing testing someone else's code + fewer biases about how the code works - have to read (or at least understand) their code do we have to read the code? read Javadoc comments, pre/postconditions "black box" : don't know the code "white box" : do know the code better for code coverage testing how much testing? 30% coverage? which 30%? which part of code to test? where the most dense logic is programmers think most likely to have errors code we think is flaky or new code that's hit a lot, used most often code that's NOT hit a lot constructors what makes a good test case? must know expected behavior cover all code paths (>= 1 for each path) boundary cases min, max, n-1, n, n+1 random data helps get rid of test case biasing