Download presentation
Presentation is loading. Please wait.
Published byAlexina Blake Modified over 6 years ago
1
Learning Intention I will learn about evaluating a program.
2
Analysis Design Implementation Testing Documentation Evaluation
3
Program Evaluation There are four areas to consider when evaluating a program: Fitness for purpose Efficient use of coding constructs Robustness Readability
4
Fitness for Purpose Software that is fit for purpose - has passed it’s testing (so it’s correct) - meets all the requirements (does what it was supposed to do)
5
Efficiency A program can be written in many different ways and do what it is expected to do Software that is efficient uses the most efficient programming constructs to solve a problem
6
How could this be made more efficient?
DECLARE total INITIALLY 0 RECEIVE number FROM KEYBOARD SET total TO total + number SEND total TO DISPLAY
7
Using repetition (loops) can greatly reduce code
DECLARE total INITIALLY 0 FOR index FROM 1 TO 4 DO RECEIVE number FROM KEYBOARD SET total TO total + number END FOR SEND total TO DISPLAY Using repetition (loops) can greatly reduce code
8
How could this be made more efficient?
DECLARE total INITIALLY 0 RECEIVE number1 FROM KEYBOARD RECEIVE number2 FROM KEYBOARD RECEIVE number3 FROM KEYBOARD RECEIVE number4 FROM KEYBOARD RECEIVE number5 FROM KEYBOARD SET total TO number1 + number2 + number3 + number4 + number5 SEND total TO DISPLAY
9
Using arrays can greatly reduce code
DECLARE number AS REAL INITIALLY [] FOR counter FROM 1 TO 4 DO RECEIVE number(counter) FROM KEYBOARD SET total TO total + number(counter) END FOR SEND total TO DISPLAY Using arrays can greatly reduce code
10
How could this be made more efficient?
IF mark < 50 THEN SET grade TO D END IF IF mark >= 50 AND mark <= 59 THEN SET grade TO C IF mark >= 60 AND mark <= 69 THEN SET grade TO B IF mark >= 70 THEN SET grade TO A Always does all 4 comparisons
11
Does 1, 2 or 3 comparisons depending on the value of mark
IF mark < 50 THEN SET grade TO D ELSE IF mark >= 50 AND mark <= 59 THEN SET grade TO C ELSE IF mark >= 60 AND mark <= 69 THEN SET grade TO B ELSE SET grade TO A END IF Does 1, 2 or 3 comparisons depending on the value of mark
12
Using IF .. ELSE IF … ELSE is more efficient than IF … END IF, IF … END IF
13
Robustness A program is robust if it does not crash, even when it is given invalid input. A robust program will not have any execution errors. A robust program should reject invalid data.
14
Readability Readability means how easy your code is for another programmer to read.
15
Readability – White Space
Using white space means the code is spaced out to make it easier to read.
16
White space
17
Readability - Indentation
Indentation is moving code right a few spaces from the start of the line. (VB does this for you automatically). Using indentation makes it easier to see the code inside different constructs.
18
Readability - Indentation
19
Readability – Meaningful Identifiers
Using meaningful identifiers means using names for objects (TextBoxes, ListBoxes, Buttons etc) and variables which help to describe the information they hold.
20
Readability - Meaningful Identifiers
21
Readability - Meaningful Identifiers
22
Readability – Internal Commentary
Internal commentary is comments you add to your program to help explain what the program is doing. e.g. - why use the variable types you did - why that kind of loop - what the IF statement is trying to decide - etc.
23
Readability – Internal Commentary
24
Complete the Program Evaluation questions.
In your jotter Complete the Program Evaluation questions.
25
I can evaluate a program in terms of:
Success Criteria I can evaluate a program in terms of: Efficiency Readability Robustness Fitness for purpose
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.