COMPUTER 2430 Object Oriented Programming and Data Structures
COMPUTER 2430 Object Oriented Programming and Data Structures I 1
2
3
Expected Learning Outcomes 1. Develop software using elementary data structures. 2. Design, implement, and test programs using classes, inheritance, and polymorphism. 3. Compare and contrast algorithm efficiency at a very basic level. 4. Write module tests, system tests, and develop test specifications. 5. Perform simple object-oriented analysis and design. 6. Work in a small team (two or three people) on the analysis, design, implementation, and testing of a project. 4
TESTING • JUnit tests • Test. Bed main • System test 5
TESTBED MAIN • Testing all methods of a class • Inside the same class • Specify input and verify output • Need programming skills 6
Lab 4 Due Monday, October 15 No Grace Date! 7
JUNIT TESTS • Testing individual public methods of a class • A separate class • Verify expected result against actual result • • assert. Equals • assert. Not. Equals No system input and output • • No Scanner or System. out Need programming skills 8
Lab 5 Due Wednesday, October 17 No Grace Date! 9
System Tests • Testing the program as a whole • Independent of any particular decomposition (classes and methods) • Don’t require programming skills 10
System Testing • Developed based on the program requirements • Use explicit data for input. • Specify explicit expected results / outputs. • Multiple test cases may be needed for one requirement • Test cases must be separated and independent of each other. 11
System Testing • If you give someone a program and a test document, he/she should be able to go through and run each test, and record whether the test passes or not. • Need to know – The commands to run the program – Provide input – Check output 12
System Testing on Golf. League Test Description Case Command Expected result / output 1 Print Add Frank Regular 75 Print All members of the League: Add a golfer to empty golf league Regular Member Frank was added All members of the League: Regular Member Frank: 0, 75, 75, 75 13
Test Case 1 Add a Golfer to an Empty League Test Description Case Command Expected result / output 1. 1 Print Add Frank Regular 75 Print All members of the League: Test Description Case Command Expected result / output 1. 2 . . . Test Description Case Command Expected result / output 1. 3 . . . Add a golfer to empty golf league Add a senior golfer to empty golf league Add a youth golfer to empty golf league Regular Member Frank was added All members of the League: Regular Member Frank: 0, 75, 75, 75 14
Test Case 2 Cannot Add a Golfer with the Same Name Test Description Case Command Expected result / output 2. 1 Add Frank Regular 73 Print Add Frank Senior 73 Print Regular Member Frank was added All members of the League: Regular Member Frank: 0, 73, 73, 73 Cannot add golfers with the same name Frank was not added All members of the League: Regular Member Frank: 0, 73, 73, 73 15
System Testing on Golf. League Test Description Case Command Expected result / output 2. 2 Add Frank Regular 73 Print Add Frank Regular 72 Print Delete Frank Print Add Frank Regular 72 Print Regular Member Frank was added All members of the League: Regular Member Frank: 0, 73, 73, 73 Cannot add golfers with the same name (Robustness test) Frank was not added All members of the League: Regular Member Frank: 0, 73, 73, 73 Frank was deleted All members of the League: Regular Member Frank was added All members of the League: Regular Member Frank: 0, 72, 72, 72 16
Lab 6 • 5 points • Due 10 pm, Friday, October 19 • No Grace Date 17
Lab 4 Lab 5 Lab 6 Lab 206 and 217 not available. 10: 00 to 10: 50: Lab 110 11: 00 to 11: 50: Lab 110? 18
• I will be in my office to answer any questions • Put your programs to your folder on K: drive and come to discuss 19
- Slides: 19