Question: We ve provided a nearly - working ArrayDeque implementation that is intentionally buggy, along with a failing test in BaseDequeTests.confusingTest that causes the bug to
Weve provided a nearlyworking ArrayDeque implementation that is intentionally buggy, along with a failing test in BaseDequeTests.confusingTest that causes the bug to emerge. Your task is to fix the flaw in the implementation.
Follow the debugging cycle:
Develop a hypothesis about what the root cause is based on what you know about the problem.
Skim through the code in ArrayDeque.java to learn the layout of its methods and fields.
Run the provided tests.
Read through ArrayDeque again, focusing on methods relevant to the failing tests.
Reproduce the issue in a minimal working example.
Write and run simple unit tests to help determine what exactly is going wrong. The failing test that we provide makes it hard to debug since it calls many methods. Youll want to write some simpler tests to figure out what exactly is going wrong.
As an aside, it may be useful to write these new tests in BaseDequeTests so that you can later reuse them for LinkedDeque.
Make productive changes based on the root cause discovered.
Make sure that the unit tests youve written pass after youve fixed the issue.
If there are more issues, return to step
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
