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]

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
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
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education