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 contract
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. (c) Draw a state machine specifying the operations for a Queue using the defensive design approach. Use a modeling tool, such as StarUML, to draw your state machine (statechart), copy and paste the state machine into this document. The operations of the Queue class are: enqueue(x), dequeue(), isFull(), isEmpty(), and size(). (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 test power hierarchy (subsume hierarchy) for the all states and all transitions criteria. State which of these testing criteria is the best in your opinion and why? (g) Using an IDE (e.g., Eclipse) write a well-documented code for the Queue class using the defensive design approach (QueueDD). 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 (QueueDD) 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
