Part 1: Test Program Write a program to test all test cases outlined in the test plan. For each method (unit) being tested, ensure your client program provides output clearly describing the method being tested along with the expected and actual result. When testing constructors, verify the results by calling an accessor method of the class. When testing mutators, use the accessor method to verify the state change. When a test fails (actual does not match the expected), correct the method code, then re-test.  Keep in mind that a poorly written test can produce inaccurate test results.  If a test fails, ensure you have written the test correctly before modifying your unit code. Output Requirement For each method (unit), output the method signature. For each test, output the following: Test number Outcome description Expected result Actual result Leave one blank line between each test. Sample StudentGrades(int) Test #1 - Initialize grades array without data. Expected: [0, 0, 0, 0] Actual: [0, 0, 0, 0]

Programming Logic & Design Comprehensive
9th Edition
ISBN:9781337669405
Author:FARRELL
Publisher:FARRELL
Chapter6: Arrays
Section: Chapter Questions
Problem 12PE
icon
Related questions
Question
100%

can you help me how to test this 

Part 1: Test Program

Write a program to test all test cases outlined in the test plan. For each method (unit) being tested, ensure your client program provides output clearly describing the method being tested along with the expected and actual result.

  • When testing constructors, verify the results by calling an accessor method of the class.
  • When testing mutators, use the accessor method to verify the state change.
  • When a test fails (actual does not match the expected), correct the method code, then re-test.  Keep in mind that a poorly written test can produce inaccurate test results.  If a test fails, ensure you have written the test correctly before modifying your unit code.
Output Requirement

For each method (unit), output the method signature.

For each test, output the following:

  • Test number
  • Outcome description
  • Expected result
  • Actual result

Leave one blank line between each test.

Sample
StudentGrades(int) Test #1 - Initialize grades array without data. Expected: [0, 0, 0, 0] Actual: [0, 0, 0, 0]

 

Unit
StudentGrades(int)
StudentGrades(int[])
getGrades(): int[]
setGrades(int[]): void
A
getSortedGrades[] : int[]
getHighestGrade(): int
getAverageGrade(): double
toString(): String
B
Total Tests: 7
#
1
1
1
1
1
1
1
Module 6 Assignment - Test Plan
Outcome
Initialize grades array without
data.
Initialize grades array with
Return a copy of the grades
array sorted in ascending
Update the state of the grades. Initial grades = ?
grades?
Return the correct highest
grade value
Return the correct average of
all the grades.
Test Data
numberOfStudents ?
Return the correct String
representation.
grades?
grades ?
=
grades 7
grades?
grades
Expected
?
?
?
?
?
?
?
E
Comments
Use getGrades() to verify.
Use getGrades() to verify.
Tested above.
Use getGrades() to verify.
Start your Expected input with
a single quote (').
Use alt-enter for a line break in
the expected data.
G
Transcribed Image Text:Unit StudentGrades(int) StudentGrades(int[]) getGrades(): int[] setGrades(int[]): void A getSortedGrades[] : int[] getHighestGrade(): int getAverageGrade(): double toString(): String B Total Tests: 7 # 1 1 1 1 1 1 1 Module 6 Assignment - Test Plan Outcome Initialize grades array without data. Initialize grades array with Return a copy of the grades array sorted in ascending Update the state of the grades. Initial grades = ? grades? Return the correct highest grade value Return the correct average of all the grades. Test Data numberOfStudents ? Return the correct String representation. grades? grades ? = grades 7 grades? grades Expected ? ? ? ? ? ? ? E Comments Use getGrades() to verify. Use getGrades() to verify. Tested above. Use getGrades() to verify. Start your Expected input with a single quote ('). Use alt-enter for a line break in the expected data. G
Expert Solution
steps

Step by step

Solved in 3 steps with 3 images

Blurred answer
Knowledge Booster
Class
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,