Computer Science GCES OCR
-
Cpu Architecture Performance And Embedded Systems Ocr5 主题
-
Primary And Secondary Storage Ocr6 主题
-
Data Storage And Compression Ocr12 主题
-
Units Of Data Storage Ocr
-
Processing Binary Data Ocr
-
Data Capacity And Calculating Capacity Requirements Ocr
-
Converting Between Denary And Binary Ocr
-
Binary Addition Ocr
-
Converting Between Denary And Hexadecimal Ocr
-
Converting Between Binary And Hexadecimal Ocr
-
Binary Shifts Ocr
-
Representing Characters Ocr
-
Representing Images Ocr
-
Representing Sound Ocr
-
Compression Ocr
-
Units Of Data Storage Ocr
-
Networks And Topologies Ocr6 主题
-
Wired And Wireless Networks Protocols And Layers Ocr6 主题
-
Identifying And Preventing Threats To Computer Systems And Networks Ocr2 主题
-
Operating Systems And Utility Software Ocr2 主题
-
Ethical Legal Cultural And Environmental Impact Ocr2 主题
-
Computational Thinking Searching And Sorting Algorithms Ocr3 主题
-
Designing Creating And Refining Algorithms Ocr5 主题
-
Programming Fundamentals And Data Types Ocr5 主题
-
Additional Programming Techniques Ocr7 主题
-
Defensive Design And Testing Ocr6 主题
-
Boolean Logic Diagrams Ocr2 主题
-
Programming Languages And Integrated Development Environments Ides Ocr3 主题
-
The Exam Papers Ocr2 主题
-
Structuring Your Responses Ocr3 主题
Program Maintainability Ocr
Exam code:J277
Program Maintainability
What is program maintainability?
-
Maintainability is used to ensure programmers can easily understand what a program is doing months or years after having first written it
-
Maintainability is also used when programming as part of a large team, so each programmer working on the team understands what each section is doing
How are programs maintained?
-
Commenting of code: to explain the purpose of the code in a particular section
-
White space: to make each section clear and easy to see
-
Indentation: to show each instance of selection and iteration and to make it clear which code belongs to which clause in the program
-
Sensible variable names: so that the name explains what that variable or data structure does and to prevent confusion later in the development process
-
Use of sub-programs: functions or procedures split up programs into reusable sections of code which can remove the need for duplicating code and also increase the overall structure of the code
An example of maintainability
-
The first image below shows the code for a bubble sort algorithm written in Python
-
The code does not include any of the maintainability features mentioned in this section

-
The second image, below, is the same program however, it clearly shows the use of
-
comments
-
meaningful variable names
-
white space
-
indentation
-
-
By including each of these, the code immediately becomes easier to
-
read
-
understand
-
debug
-
improve
-

Worked Example
The area of a circle is calculated using the formula , where
is equal to 3.142 and
is the radius.
George has written a program to allow a user to enter the radius of a circle as a whole number, between 1 and 30, and output the area of the circle.
radius = int(0)area = float(0.0)radius = int(input("Enter radius: "))if radius < 1 or radius > 30:print("That radius is invalid")elsearea = 3.142 x(radius2)print(area)
Explain, using examples from the program, two ways Finn can improve the maintainability of the program. [6]
How to answer this question
-
To score full marks on this type of question you will be awarded
-
1 mark for identifying a maintainability feature
-
1 mark for explaining how it aids maintainability
-
1 mark for applying it to the context in the question
-
Answers: Maximum of 3 marks per method
-
Comments/annotation
-
To explain the key functions/sections
-
E.g. any relevant example, such as line 4 checks the input is valid
-
-
Indentation
-
To show where constructs/sections start and finish
-
E.g. indenting within IF statement
-
-
White space
-
So the code appears easier to read and understand
-
E.g. leaving a line break after the radius input
-
Responses