Below is a sample program written in a high-level language. Read the program carefully and answer the following evaluation questions.
# Program to calculate the total cost of a shopping list item = ["Apples", "Bananas", "Cherries"] prices = [0.50, 0.30, 0.75, 0.65, 0.85] total_cost = 0 for i in range(len(item)): total_cost = total_cost + prices[i] print(item[i] + ": £" + prices[i]) print("Total Cost: £" + total_cost)
Questions
Answer the following questions
1. Why do we evaluate software?
Thinking about software evaluation (including the client) in general, why do we evaluate software?
2. Efficiency
(a) Identify one inefficiency in the program. Suggest a way to improve it.
(b) Would the program still work correctly with a longer list of items and prices? Explain your answer.
3. Fitness for Purpose
(a) Does the program meet its purpose of calculating the total cost of a shopping list? Justify your answer.
(b) If the prices list were incomplete (e.g., missing a price for an item), what would happen? How could this issue be addressed?
4. Readability and Maintainability
(a) Is the program easy to read and understand? Give one reason to support your answer.
(b) Suggest one improvement that would make the program easier to maintain in the future.
5. Robustness
(a) Does the program handle errors or unexpected inputs effectively? Why or why not?
(b) Suggest an improvement to make the program more robust.
Other forms of evaluation
There are other forms of evaluation that are often carried out on software. For each of the following explain what you think each of these mean.
(a) Usability evaluation
(b) Reliability evaluation
(c) Maintability evaluation
(d) Portability evaluation
Extension task
Look at one of your own programs (select the one you think is the best you have ever made, for example, the refresher task). Now evaluate it on efficiency, readability and maintainability and robustness. Write a couple of sentences explaining what you think about the quality of the program, detailing each of the above. Finally, explain whether it is fit for purpose.