Question: Please make sure will a be writing a more complex modular program that uses at least two loops, validates user input, and includes a test
Please make sure will a be writing a more complex modular program that uses at least two loops, validates user input, and includes a test plan.
As long as your program satisfies the requirements listed below, you are free to design and write any type of program that you care to. You are encouraged to be creative, and pick something that has meaning for you, because you'll have more fun. Feel free to create a more complex version of the program you did in an earlier lab, as long as it meets all of the additional requirements below.
Requirements
Your lab submission should consist of a Python file, Lab4.py, uploaded to the Lab 4 Assignments folder, plus a document Lab4-TestPlan.doc (or docx) containing a test plan. The Lab4.py file should meet all of the following requirements:
A comment at the top with a brief description of the program, including Input List and Output List.
Your name given as the author.
Full pseudocode should be included in the comments.
It must have at least one input and at least one output.
It must validate all user input. This means the user is not allowed to just enter any value. You must check the value, ask the user to enter it again if the entry is invalid, and repeat this loop until the user enters a valid value. A user should not be able to produce a Python error by entering invalid input values - your program should handle all invalid input with an error message and a re-prompt.
Your program must use at least two loops in meaningful ways. The loops you use for input validation count for at most one of the two required loops. If you use loops to validate two separate inputs, that does not count as two loops for satisfying this lab requirement.
It should be organized into separate modules (one module for input, one module for output, and one module for each separate calculation or action that the program is to perform [that is, each module should be "cohesive" and should only do one thing]).
Use parameters and arguments to pass values into your modules (don't use global variables).
The Python code should run correctly, and the logic should match your pseudocode.
The test plan document Lab4-TestPlan should meet all of the following requirements:
Follow the format given in the example test plans (one below, and one on the Testing page). You can download and copy the test plan document below and use it as a template: replace the content of each section with your own content.
http://softwaretestingfundamentals.com/system-testing/
Write the test plan as if for someone who cannot see your source code (utilize black-box testing). They can only run the program, provide inputs, and observe outputs.
For each test case, include at least the following fields: Summary, Test Procedure, Test Data, Expected Result. Feel free to add more fields if you want to. (See Test Case for additional fields.)
http://softwaretestingfundamentals.com/test-case/
Include test cases for all important categories of input (valid, invalid, boundary, etc.). If your program passes every test case in your test plan, you should be confident that it functions correctly.
Be sure to run your program against the test plan to determine its correctness, and fix any bugs found.
make sure to watch this video first
https://www.youtube.com/watch?v=O-PanlMU3hY
Fibonacci Program Test Plan
Program Description
Calculates terms in the Fibonacci sequence as well as the Golden Ratio.
Input
n: the number of Fibonacci terms to calculate
Output
counter: ordinal position of the Fibonacci term
first: prior Fibonacci term
second: prior Fibonacci term
next: first + second, the current Fibonacci term
golden: the golden ratio approximated by the last 2 Fibonacci terms calculated
Test Plan Overview
System tests using black-box testing of all functions of the program. Valid as well as invalid inputs are tested.
Test Cases
Test Case 1: Invalid Inputs
| Summary | Verify that invalid inputs produce an error message |
| Test Procedure | When prompted for the number of Fibonacci numbers, enter the input |
| Test Data | asdf 4.0 |
| Expected Result | Message indicating that a whole number must be entered. Ability to re-enter the input. |
Test Case 2: Valid Inputs Producing No Output
| Summary | Verify that input of the value 0 or less does not produce any output |
| Test Procedure | When prompted for the number of Fibonacci numbers, enter the input |
| Test Data | 0 -3 |
| Expected Result | No output. Program ends normally. |
Test Case 3: First 2 Terms
| Summary | Verify that input of 1 or 2 produces 1 or 2 Fibonacci terms respectively, and no golden ratio |
| Test Procedure | When prompted for the number of Fibonacci numbers, enter the input |
| Test Data | 1 2 |
| Expected Result | Output of the first 1 or 2 Fibonacci terms and their ordinal position. The first 2 terms are both 1. Each term should be on a separate line. For example: Fibonacci number 1 is 1 Fibonacci number 2 is 1 |
Test Case 3: Multiple Terms
| Summary | Verify that input greater than 2 produces the requested number of Fibonacci terms, as well as the golden ratio |
| Test Procedure | When prompted for the number of Fibonacci numbers, enter the input |
| Test Data | 3 20 |
| Expected Result | Output of the requested number of Fibonacci terms and their ordinal position, with each term on a separate line. For terms 3 and greater, the addition showing the calculation of the term is also output, as well as the golden ratio as calculated so far (and identified as such with a label). For example, the first few terms output should be: Fibonacci number 1 is 1 Fibonacci number 2 is 1 Fibonacci number 3 is 1 + 1 = 2 Approximate Golden Ratio: 2.0 Fibonacci number 4 is 1 + 2 = 3 Approximate Golden Ratio: 1.5 Fibonacci number 5 is 2 + 3 = 5 Approximate Golden Ratio: 1.6666666666666667 |
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
