Development Models

Iterative Model

A structured approach following the waterfall stages (Analysis, Design, Implementation, Testing, Evaluation) but allows revisiting previous stages.

  • Structure: Predictive and rigid. Heavy documentation.
  • Process: Finish one stage completely before moving to the next.
  • Revisiting: If testing fails, the team loops back to Analysis or Design to fix issues.
Agile (e.g., Scrum) Adaptive
The Process
  • Sprints: Short dev cycles (2-4 weeks).
  • Deliverable: Working software at end of every sprint.
  • Stand-ups: Daily progress meetings.
Roles & Artifacts
  • Product Owner: Client representative.
  • Scrum Master: Removes blockers.
  • Backlog: Prioritized list of tasks.
Key Benefit: Constant client feedback during development allows for changes to be made easily, unlike Iterative where the client sees the product at the end.

Analysis Requirements

Functional Requirements

What the software must DO (Inputs, Processes, Outputs).

e.g., "Calculate tax", "Display graph".
Non-Functional Requirements

Constraints/Performance.

  • Performance: Speed, load time.
  • Security: Encryption standards.
  • Usability: Accessibility features.

Design

Planning the code logic.

  • Pseudocode: English-like structured text describing the algorithm.
  • Structure Diagram: Visual hierarchy of the program's modules/functions.
  • Data Flow: Shows how variables move between sub-programs (In/Out).
  • Wireframes: Visual sketch of the User Interface (UI).

Data Structures

1. Parallel Arrays

Separate arrays linked by index.

names = ["Ali", "Bo"]
ages = [17, 16]
# names[0] is linked to ages[0]
2. Array of Records

A custom data type (Record/Class) holding related fields.

class Pupil:
  name: str
  age: int
pupilArray = [Pupil("Ali", 17), Pupil("Bo", 16)]

Variable Scope

Global Variables
  • Declared in main program.
  • Visible everywhere (all functions).
  • Risk: Can be accidentally changed by any function. Inefficient RAM use (stay in memory).
Local Variables
  • Declared inside a function/sub-program.
  • Only visible inside that function.
  • Benefit: Modularity. Same variable name can be reused safely in other functions. Efficient RAM.

Modularity & Params

Parameters pass data to sub-programs, making them independent and reusable (avoiding Global Variables).

Sub-programs
  • Procedure: Performs a task. No return value.
  • Function: Returns a single value.
Parameter Types
Formal: In definition.
def add(a, b):
Actual: In call.
x = add(10, 50)

Algorithms

1. Linear Search
names = ["Ali", "Bo"]
target = "Bo"
found = False

for name in names:
  if name == target:
    found = True
    # break
2. Count Occurrences
scores = [1, 2, 1, 3]
target = 1
count = 0

for score in scores:
  if score == target:
    count = count + 1
print(count)
3. Find Maximum
ages = [12, 16, 9]
maximum = ages[0]

for i in range(1, len(ages)):
  if ages[i] > maximum:
    maximum = ages[i]
print(maximum)

File Handling (Python)

Read to Parallel Arrays
# 1. OPEN ("r" for Read)
file = open("data.csv", "r")
names = []
ages = []

line = file.readline()
while line != "":
    data = line.strip().split(",")
    names.append(data[0])
    ages.append(int(data[1]))
    line = file.readline()

file.close()
Read to Array of Records
class Pupil:
    def __init__(self, n, a):
        self.name = n
        self.age = a

file = open("data.csv", "r")
pupilArray = []

line = file.readline()
while line != "":
    data = line.strip().split(",")
    temp = Pupil(data[0], int(data[1]))
    pupilArray.append(temp)
    line = file.readline()

file.close()
Write Parallel Arrays to CSV
names = ["Ali", "Bo"]
ages = [17, 16]

# 1. OPEN ("w" for Write)
file = open("output.csv", "w")

for i in range(len(names)):
    # Construct CSV string
    line = names[i] + "," + str(ages[i]) + "\n"
    file.write(line)

# 2. CLOSE
file.close()
Write Array of Records to CSV
# assuming pupilArray exists
file = open("output.csv", "w")

for p in pupilArray:
    # Access fields from object p
    line = p.name + "," + str(p.age) + "\n"
    file.write(line)

file.close()

Testing

Test Data
  • Normal: Expected range.
  • Extreme: Boundaries.
  • Exceptional: Invalid/Wrong type.
Techniques
  • Dry Run: Manual trace on paper.
  • Trace Table: Tracking variable values row by row.
  • Breakpoints: Pause execution to check state.
  • Watchpoints: Monitor specific variables.

Evaluation

Fitness for Purpose

Does it meet ALL Functional Requirements?

Efficiency

Does it use loops/arrays effectively? Does it waste RAM?

Robustness

Can it handle errors without crashing? (Input validation, Try/Except).

Maintainability

Is it easy to update? (Modular code, Comments, Meaningful names).