csc 309 lecture notes week 4 formal specs in testing
play

CSC 309 Lecture Notes Week 4 Formal Specs in Testing Intro to - PowerPoint PPT Presentation

CSC309-S15-L4 Slide 1 CSC 309 Lecture Notes Week 4 Formal Specs in Testing Intro to Testing Techniques CSC309-S15-L4 Slide 2 I. Deriving and refining method specs. A. Testing requires that we know exactly what constitutes valid versus


  1. CSC309-S15-L4 Slide 60 Case No. Inputs Expected Output Remarks 1 parm 1 = ... ref parm 1 = ... ... ... parm m = ... ref parm n = ... data field a = ... data field a = ... ... ... data field z = ... data field z = ... return = ... throw = ... ... n parm 1 = ... ref parm 1 = ... ... ... parm m = ... ref parm n = ... data field a = ... data field a = ... ... ... data field z = ... data field z = ... return = ... throw = ... ...

  2. CSC309-S15-L4 Slide 61 Unit test details, cont’d C. Note that

  3. CSC309-S15-L4 Slide 62 Unit test details, cont’d C. Note that 1. Must specify all input parameters and data fields.

  4. CSC309-S15-L4 Slide 63 Unit test details, cont’d C. Note that 1. Must specify all input parameters and data fields. 2. Must specify all ref parms, return val, modified fields.

  5. CSC309-S15-L4 Slide 64 Unit test details, cont’d C. Note that 1. Must specify all input parameters and data fields. 2. Must specify all ref parms, return val, modified fields. 3. Not mentioned assumed "don’t care".

  6. CSC309-S15-L4 Slide 65 Unit test details, cont’d D. One test plan for each method.

  7. CSC309-S15-L4 Slide 66 Unit test details, cont’d D. One test plan for each method. E. Unit test plans included a javadoc comments.

  8. CSC309-S15-L4 Slide 67 XI. Module, i.e., class testing

  9. CSC309-S15-L4 Slide 68 XI. Module, i.e., class testing A. Write unit test plans for each method.

  10. CSC309-S15-L4 Slide 69 XI. Module, i.e., class testing A. Write unit test plans for each method. B. For class as whole, write class test plan .

  11. CSC309-S15-L4 Slide 70 XI. Module, i.e., class testing A. Write unit test plans for each method. B. For class as whole, write class test plan . C. Guidelines:

  12. CSC309-S15-L4 Slide 71 Class testing, cont’d 1. Start with unit tests for constructors.

  13. CSC309-S15-L4 Slide 72 Class testing, cont’d 1. Start with unit tests for constructors. 2. Next, unit test other constructive methods.

  14. CSC309-S15-L4 Slide 73 Class testing, cont’d 1. Start with unit tests for constructors. 2. Next, unit test other constructive methods. 3. Unit test selector methods.

  15. CSC309-S15-L4 Slide 74 Class testing, cont’d 1. Start with unit tests for constructors. 2. Next, unit test other constructive methods. 3. Unit test selector methods. 4. Test certain method interleavings.

  16. CSC309-S15-L4 Slide 75 Class testing, cont’d 1. Start with unit tests for constructors. 2. Next, unit test other constructive methods. 3. Unit test selector methods. 4. Test certain method interleavings. 5. Stress test.

  17. CSC309-S15-L4 Slide 76 Class testing, cont’d D. Use/write a test driver that:

  18. CSC309-S15-L4 Slide 77 Class testing, cont’d D. Use/write a test driver that: 1. executes each method test plan,

  19. CSC309-S15-L4 Slide 78 Class testing, cont’d D. Use/write a test driver that: 1. executes each method test plan, 2. compares actual with expected output,

  20. CSC309-S15-L4 Slide 79 Class testing, cont’d D. Use/write a test driver that: 1. executes each method test plan, 2. compares actual with expected output, 3. reports the differences, if any,

  21. CSC309-S15-L4 Slide 80 Class testing, cont’d D. Use/write a test driver that: 1. executes each method test plan, 2. compares actual with expected output, 3. reports the differences, if any, 4. optionally records output results.

  22. CSC309-S15-L4 Slide 81 Class testing, cont’d E. Concrete examples: projects/work/calendar/testing/ implementation/source/java/ caltool/schedule/ ScheduleTest.java projects/work/calendar/testing/ implementation/source/java/ caltool/caldb/ UserCalendarTest.java

  23. CSC309-S15-L4 Slide 82 Class testing, cont’d F. Java details

  24. CSC309-S15-L4 Slide 83 Class testing, cont’d F. Java details 1. Each class X has companion testing class named XTest .

  25. CSC309-S15-L4 Slide 84 Class testing, cont’d F. Java details 1. Each class X has companion testing class named XTest . 2. Test class may extend class it tests.

  26. CSC309-S15-L4 Slide 85 Class testing, cont’d F. Java details 1. Each class X has companion testing class named XTest . 2. Test class may extend class it tests. 3. Each method X.f has a companion unit test method named XTest.testF .

  27. CSC309-S15-L4 Slide 86 Class testing, cont’d 3. Comment at top of test class describes the module test plan.

  28. CSC309-S15-L4 Slide 87 Class testing, cont’d 3. Comment at top of test class describes the module test plan. 4. The comment for each unit test method describes unit test plan.

  29. CSC309-S15-L4 Slide 88 Class testing, cont’d 3. Comment at top of test class describes the module test plan. 4. The comment for each unit test method describes unit test plan. 5. Each tested class implements dump method for dumping test values as String.

  30. CSC309-S15-L4 Slide 89 XI. Integration testing

  31. CSC309-S15-L4 Slide 90 XI. Integration testing A. Once tested, modules are integrated.

  32. CSC309-S15-L4 Slide 91 XI. Integration testing A. Once tested, modules are integrated. B. Stubs replaced with actual methods.

  33. CSC309-S15-L4 Slide 92 XI. Integration testing A. Once tested, modules are integrated. B. Stubs replaced with actual methods. C. Test plan for top-most method(s) rerun with integrated modules.

  34. CSC309-S15-L4 Slide 93 XI. Integration testing A. Once tested, modules are integrated. B. Stubs replaced with actual methods. C. Test plan for top-most method(s) rerun with integrated modules. D. Continues until entire system is integrated.

  35. CSC309-S15-L4 Slide 94 D. Integration testing A. Once tested, modules are integrated. B. Stubs replaced with actual methods. C. Test plan for top-most method(s) rerun with integrated modules. D. Continues until entire system is integrated.

  36. CSC309-S15-L4 Slide 95 Integration testing, cont’d E. Concrete example: projects/work/calendar/testing/ implementation/ integration-test-plan.html

  37. CSC309-S15-L4 Slide 96 1. Integrate schedule + caldb

  38. CSC309-S15-L4 Slide 97 1. Integrate schedule + caldb 2. Add view to schedule+caldb

  39. CSC309-S15-L4 Slide 98 1. Integrate schedule + caldb 2. Add view to schedule+caldb 3. Add admin to schedule+view+caldb

  40. CSC309-S15-L4 Slide 99 1. Integrate schedule + caldb 2. Add view to schedule+caldb 3. Add admin to schedule+view+caldb 4. Integrate caldb + caldb.server

  41. CSC309-S15-L4 Slide 100 1. Integrate schedule + caldb 2. Add view to schedule+caldb 3. Add admin to schedule+view+caldb 4. Integrate caldb + caldb.server 5. Add caldb.server to schedule + ...

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend