1 / 24

Art for Chapter 11, Testing

Art for Chapter 11, Testing. Management plan. Test planning. User interface design. Object design. Unit test. From ODD. From RAD. From TP. From RAD. Continued on next slide. Continued on next slide.

reese-lynch
Download Presentation

Art for Chapter 11, Testing

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. Art forChapter 11, Testing

  2. Management plan Test planning User interface design Object design Unit test From ODD From RAD From TP From RAD Continuedon next slide Continuedon next slide Figure 11-1, Testing activities and their related work products (continued on next slide). Developer Client User Usability test Integration Integration test strategy System Structure test decomposition From SDD Functional Functional test requirements

  3. Functional test User manual Project agreement Performance test Field test Daily operation Installation test Acceptance test Figure 11-1 (continued from previous slide). Developer Client User Functionalrequirements From RAD Nonfunctionalrequirements From RAD

  4. Test suite is revised by exercises * 1…n * Test case Component Correction * * * Test stub finds repairs * Test driver * * * * * * Failure Error Fault is caused by is caused by Figure 11-2, Model elements used during testing.

  5. Figure 11-3, An example of a fault.

  6. Figure 11-6, An example of an error.

  7. Figure 11-7, A fault can have an algorithmic cause.

  8. Figure 11-8, A fault can have a mechanical cause, such as an earthquake.

  9. Figure 11-9, Test model with test cases. TestA1:TestCase TestA:TestCase TestA2:TestCase precedes precedes TestB:TestCase TestC:TestCase

  10. Figure 11-11, Equivalent flow graph for the getNumDaysInMonth() method implementation of Figure 11-12. [year < 1] throw1 [month in (1,3,5,7,10,12)] n=32 [month in (4,6,9,11)] n=30 [month == 2] [leap(year)] throw2 n=29 n=28 return

  11. Figure 11-12, An example of a (faulty) implementation of the getNumDaysInMonth() method (Java). (continued on next slide) public class MonthOutOfBounds extends Exception {…}; public class YearOutOfBounds extends Exception {…}; public class MyGregorianCalendar { publicstaticboolean isLeapYear(int year) { boolean leap; if (year%4) { leap = true; } else { leap = false; } return leap; } /* … continued on next slide */

  12. Figure 11-12, An example of a (faulty) implementation of the getNumDaysInMonth() method (Java). (continued from previous slide) /* … continued from previous slide */ publicstaticint getNumDaysInMonth(int month, int year) throws MonthOutOfBounds, YearOutOfBounds { int numDays; if (year < 1) { thrownew YearOutOfBounds(year); } if (month == 1 || month == 3 || month == 5 || month == 7 || month == 10 || month == 12) { numDays = 32; } elseif (month == 4 || month == 6 || month == 9 || month == 11) { numDays = 30; } elseif (month == 2) { if (isLeapYear(year)) { numDays = 29; } else { numDays = 28; } } else { thrownew MonthOutOfBounds(month); } return numDays; } ... }

  13. Figure 11-13, Equivalent flow graph for the (faulty) isLeapYear() method implementation of Figure 11-12 and derived tests. [(year%4) == 0)] leap=true leap=false return

  14. Figure 11-14, UML statechart diagram and resulting tests for 2Bwatch set time function. (test cases on next slide) 3.pressButtonsLAndR 1. 2. 6. pressButtonL pressButtonL pressButtonR MeasureTime pressButtonR SetTime 4.after 2 min. 5.pressButtonsLAndR/beep 7.after 20 years 8.after 20 years DeadBattery

  15. Figure 11-15, A Strategy pattern for encapsulating multiple implementations of a NetworkInterface. Application NetworkConnection NetworkInterface open() send() close() receive() send() setNetworkInterface() receive() LocationManager Ethernet WaveLAN UMTS open() open() open() close() close() close() send() send() send() receive() receive() receive()

  16. Figure 11-17, Equivalent flow graph for the expanded source code of the NetworkConnection.send() method of Figure 11-16. [nif instanceof Ethernet] eNif.isReady() [nif instanceof WaveLAN] wNif.isReady() uNif.isReady() [ready] ; [nif instanceof Ethernet] eNif.send() [nif instanceof WaveLAN] wNif.send() uNif.send()

  17. Figure 11-18, Example of a hierarchal system decomposition with three layers. Layer I User Interface (A) Layer II Billing (B) Event Service (C) Learning (D) Layer III Database (E) Network (F) Neural Network (G)

  18. Figure 11-19, Bottom up test strategy. After unit testing subsystems E, F, and G, the bottom up integration test proceeds with the triple test B,E,F and the double test D,G. User Interface (A) Billing (B) Event Service (C) Learning (D) Database (E) Network (F) Neural Network (G) T riple test Double test B,E,F D,G

  19. Figure 11-20, Top down test strategy. After unit testing subsystem A, the integration test proceeds with the double tests (A,B), (A,C), and (A,D), followed by the quad test (A,B,C,D). Double tests A,B; A,C; A,D Quad test User Interface (A) A,B,C,D Billing (B) Event Service (C) Learning (D) Database (E) Network (F) Neural Network (G)

  20. Figure 11-21, Sandwich testing strategy. Top layer Test A,B Test A Test A,C Test A,B,C,D Test A,D Bottom layer Test G Test D,G Test F Test B,E,F Test E Test A,B,C,D, E,F,G

  21. Figure 11-22, An example of modified sandwich testing strategy. Top layer Test A,B Test A Test A,C Test A,B,C,D Test A,D Target layer Test B Test C Test D Bottom layer Test G Test D,G Test F Test B,E,F Test E Test A,B,C,D, E,F,G

  22. Figure 11-23, An example of use case model for a subway ticket distributor. Passenger <<extends>> PurchaseTicket <<extends>> TimeOut Cancel <<extends>> <<extends>> NoChange OutOfOrder

  23. Figure 11-26, Example of a PERT chart for a schedule of the sandwich tests shown in Figure 9-19.

  24. Figure 11-27, JUnit test framework. Test TestResult run(TestResult) TestCase TestSuite testName:String run(TestResult) run(TestResult) addTest() setUp() tearDown() runTest() ConcreteTestCase setUp() tearDown() runTest()

More Related