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]
OOPs
In today's technology-driven world, computer programming skills are in high demand. The object-oriented programming (OOP) approach is very much useful while designing and maintaining software programs. Object-oriented programming (OOP) is a basic programming paradigm that almost every developer has used at some stage in their career.
Constructor
The easiest way to think of a constructor in object-oriented programming (OOP) languages is:
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
Step by step
Solved in 3 steps with 3 images