Question: 5. Two approaches used to write the specifications for operations between a sender and a receiver object (e.g., Queue) are based on design by
5. Two approaches used to write the specifications for operations between a sender and a receiver object (e.g., Queue) are based on design by contract and defensive design. (a) Briefly describe each of the two approaches to writing such a specification. (b) State how each approach affects the testing process and relate it to the Queue class where possible. [35] (c) Draw a state machine specifying the operations for a Queue. Use a modeling tool, such as StarUML, to draw your state machine (statechart), copy and paste the state machine into this document. (d) Write test cases that satisfy the all states criteria for the Queue using the state machine. Assume the Queue stores Integer objects with a maximum size of 5 objects. (e) Write test cases that satisfy the all transitions criteria for the Queue using the state machine. Assume the Queue stores Integer objects with a maximum size of 5 objects. (f) Draw a subsume hierarchy for the all states and all transitions criteria. Which of these testing criteria is the best in your opinion and why? (g) Using an IDE (e.g., Eclipse) write well-documented code for the Queue class using the defensive design approach (Queue DD). Assume the Queue stores Integer objects with a maximum size of 5 objects. The Queue must be implemented using a LinkedList from the Java library. If you copy the code from the Internet or a textbook, please show the reference in the documentation. (h) Write two (2) well-documented JUnit test classes using the IDE for the test cases in parts (d) and (e). The names of the JUnit test classes should be QueueDD AS Tests and QueueDD AT Tests, respectively. Copy and paste the code for the Queue class (Queue DD) and its associated test classes (QueueDD AS Tests and QueueDD AT Tests) into this document.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
