Question: 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
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.
- 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.
- Write test cases that satisfies the all transitions criteria for the Queue using the state machine. Note one test case should cover one transition. Assume the Queue stores Integer objects with maximum size of 5 objects.
- Using the Eclipse IDE write well documented code for two (2) Queue classes, one for design by contract (QueueDC) and the other for defensive design (QueueDD). Assume the Queue stores Integer objects with maximum size of 5 objects.
- Write well documented JUnit test cases in the Eclipse environment (or other IDE) using the test cases in (d) and test each of the two classes in (e). That is, for each Queue class you should have a JUnit test case class (QueueDCTests and QueueDDTests, as appropriate). Copy and paste the code for each of the classes (QueueDC and QueueDD) and their associated test classes (QueueDCTests and QueueDDTests) into this document.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
