All homework assignments are due before class on the due date. All homework assignments must reflect your own understanding of the topic and be communicated in your own words. You may use one of the collaborative options. You may also request help and advice from your classmates on Piazza as long as the help/advice follows the course's collaborative policy. Any help not allowed by that policy will be an honor violation.
Purpose: To encourage students to start working on the homework assignments early and recognize students who are actively engaged in the content
You will receiveNote: The final submission timestamp shown on Gradescope will be used. No extension/exception on the early submission bonus points.
[Reminder: Two mandatory components of each test case: input value(s) and expected output — point(s) will always be deducted if any of these is missing]
/**
* Find last index of element
*
* @param x array to search
* @param y value to look for
* @return last index of y in x; -1 if absent
* @throws NullPointerException if x is null
*/
line 1 public static int findLast(int[] x, int y)
line 2 {
line 3 if (x == null)
line 4 throw new NullPointerException();
line 5 for (int i=x.length-1; i>0; i--)
line 6 {
line 7 if (x[i] == y)
line 8 return i;
line 9 }
line 10 return -1;
line 11 }
// test: x = [2, 3, 5]; y = 2;
// expected = 0
Answer the following questions.
Hint: What is the fault?
// test input: x = [2, 3, 5]; y = 2; // expected = 0Describe the first error state. Be sure to describe the complete state. Note: Use the format introduced in class; refer to the slides and the Fault, Error, Failure activity.
/**
* Raises left to the power of right
* precondition: right >= 0
* postcondition: return left**right
*/
line 1: public static int power(int left, int right)
line 2: {
line 3: int rslt = 0;
line 4: rslt = left;
line 5:
line 6: if (right < 0)
line 7: throw new IllegalArgumentException();
line 8:
line 9: if (right == 0)
line 10: rslt = 1;
line 11: else
line 12: {
line 13: for (int i=2; i<=right; i++)
line 14: // rslt = rslt * left; // correct version
line 14: rslt = rslt + left; // fault
line 15: }
line 16: return rslt;
line 17: }
Reminder: Setting up an input value that causes a compilation error is not useful and
thus no credit will be awarded.
Answer the following questions.
Question 1: If you do, or have, worked for a software development company, how much effort did your testing or QA team put into each of the four test activities (test design, automation, execution, evaluation)
Question 2: If you have never worked for a software development company, which of the four test activities do you think you are best qualified for? (test design, automation, execution, evaluation)
We are looking for a paragraph or two here. This is an introspective exercise without a "correct" answer; it is mainly to get you to think. You will receive credit if you turn in something reasonable.
Refer to MDTD for the four test activities
( -5 points) for 24 hours late (submitted after 15-September 11am EST, by 16-September 11am EST)
(-10 points) for 48 hours late (submitted after 16-September 11am EST, by 17-September 11am EST)
(-2 points) for submitting a Word document or handwriting, or a write-up that is not a typed PDF file.
Save your assignment as a PDF file. — No handwriting. No hand-drawing. No Word document.
Log in to Canvas, then upload your report as a PDF to Assignment1 on Gradescope. Make sure you connect your partner to your group on Gradescope so that everyone receives credit.
Each team submits only one copy.
Making your submission available to instructor and course staff is your responsibility; if we cannot access or open your file, you will not get credit. Be sure to test access to your file before the due date.
CC-BY-NC-SA 4.0 license.