Lecture 05-Testing, Class Hierarchy

Lecture 05-Testing, Class Hierarchy - CS1110 lecture 5 14...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
1 CS1110 lecture 5 14 Sept 2010 Testing; the class Object; toString; static variables & methods Reading for this lecture: Testing with JUnit (Appendix I.2.4 & pp. 385--388), the class Object (pp. 153-154), function toString (pp. 112-113), static variables and methods (Sec. 1.5, p. 47). Reading for next two lectures: Executing method calls, if-statements, the return statement in a function, local variables. Chapter 2 except 2.3.8 and 2.3.9. This reading will some clarify some concepts, such as method parameters, that we’ve had to gloss over so far. Keep your iClickers and a sheet of paper out. A1 (still) due Saturday Sept 18 on CMS; group yourselves by Wed. Ignore “Extended Until” on CMS (We had to put in a fake extension to work around a CMS limitation.) 1 Email re: lab 03, quiz 2, etc. was sent on Saturday. Bouncing emails: cabooserwar , blacktora4546 , jfk54 , tariq.mozaini , lukeg432 , dc.mcmurtry10 , khyjhcho . Organizing and streamlining the testing process Testing : Process of analyzing, running program, looking for bugs (errors). Test case : A set of input values, together with the expected output. Develop test cases for a method from its speciFcation --- even before you write the method’s body. /** = number of vowels in word w. Precondition: w contains at least one letter and nothing but letters*/ public int numberOfVowels(String w) { // (nothing here yet!) } Test cases “need”, “rhythm” reveal vagueness in the spec! Developing test cases Frst, in “critique” mode, can prevent wasted work. 2 “Slinky Dog” j0 best±emale±r bestMale±r numIsB±Of w0 0 dName Person s0 Person(String, int, boolean) “Jessie” null best±emale±r bestMale±r
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 11/27/2010 for the course CS 9339 at Cornell University (Engineering School).

Page1 / 2

Lecture 05-Testing, Class Hierarchy - CS1110 lecture 5 14...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online