1 / 12

Plan for today

Plan for today. Review from last week Basic testing (text book) lec1, lec2 Syntax testing (chapter 16). Chapter 4: Test Specifications. Format: Test 3: Global is initially 5; setglobal(3,7); Expect return value is -1; global is 3 Describe exact, complete inputs. Marking requirements.

spinelli
Télécharger la présentation

Plan for today

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Plan for today • Review from last week • Basic testing (text book) lec1, lec2 • Syntax testing (chapter 16) Testing/COM 3220/99

  2. Chapter 4: Test Specifications • Format: • Test 3: • Global is initially 5; setglobal(3,7); • Expect • return value is -1; global is 3 • Describe exact, complete inputs. Testing/COM 3220/99

  3. Marking requirements • Test requirements initially marked 0. • Increment each time satisfied by test. • Satisfy many test requirements with a single test specification. Testing/COM 3220/99

  4. Combining rules • Each test specification should satisfy as many test requirements as is reasonable. • All test requirements must be satisfied. • If you must choose among test requirements, choose the one that is satisfied least. • Avoid repeating values; add variety. Testing/COM 3220/99

  5. Need for complex tests (4.2.1) • Think about bugs which are not revealed by simple tests. Testing/COM 3220/99

  6. Error test specifications (4.3) • Normally: use as many requirements per test as possible. • Exception: Test each error in isolation. Reason: errors often mask each other. Testing/COM 3220/99

  7. Rules for test content • Foreground modifications must be visible. (variables a test would change) • Background variables must be visible. (variables that should not be modified) • Is accidental correctness avoided? A+A, A*A, A=2 • Test requirements must be exercised • Make inputs distinct. Testing/COM 3220/99

  8. Combine with white box testing (4.7.2) • Build new checklist from code, generating test requirements from the code. • New tests or update old ones? • Updating old test preferable since it leads to fewer, more complex tests. But sometimes better to write new test (could invalidate old test requirements). Testing/COM 3220/99

  9. Test Drivers and Suite Drivers (chapter 5) • All tests for a product should be collected into a regression test suite. • Rerun test suite periodically. • Test driver: runs one test • Suite driver: runs entire suite Testing/COM 3220/99

  10. Comparing actual and expected outputs • Are expected outputs text? File comparison. How robust? What if more new-line and space characters for better formatting? • Use parsing and object comparison. • How to generate reference file? Generate and check? Testing/COM 3220/99

  11. Inspecting Code with the Question Catalog (chapter 6) • Some faults difficult to detect with testing • Question catalog appendix D (very C oriented) With Java the catalog is much shorter. • If a new field is added to a declaration, has any initializing code not been changed? • Yes answer means a probable fault (Java compiler would detect anyway). Testing/COM 3220/99

  12. PART 2:Getting Going (chapter 10) • Gradual adoption • Current practice is changed little in each step. • First step: use coverage. • If coverage is low: forget about coverage while you improve testing. Testing/COM 3220/99

More Related