Grade by Grade
B. Software Development · Software Development: Problem Solving, Design, Testing and the Life Cycle

Software Development: Problem Solving, Design, Testing and the Life Cycle: Unit Review

B1.1 B1.2 B1.3 B2.1 B2.2 B2.3 B2.4 B2.5 B3.1 B3.2 B3.3 B4.1 B4.2 B4.3 B4.4 B4.5 B4.6About 40 minutes
Learning goals
  • I can choose and use problem-solving strategies and the IPO model.
  • I can design and describe programs with flow charts, pseudocode, structure charts, DFDs and UML, using modular, reusable code and friendly interfaces.
  • I can design algorithms to specifications, including formulas, sorted arrays and exception handling.
  • I can apply the software development life cycle, with project planning, test plans, debugging and status reports.

Words to know

stepwise refinement
Breaking a task into smaller and smaller steps until each is easy to code.
IPO model
Input, process, output: the basic shape of every program.
modularity
Building a program from self-contained modules with clear interfaces.
exception
A run-time error that stops the program unless it is detected or handled.
critical path
The longest chain of dependent tasks; it sets the project length.
test plan
Scenarios, input data, expected and actual outcomes, and pass/fail.

Let's review!

In this unit you learned how programs are planned, designed, built, tested and delivered. You practised problem-solving strategies and the input-process-output model, worked in teams, and described designs with flow charts, pseudocode, structure charts, data flow diagrams and UML. You designed modular, reusable code from skeletons, built user-friendly interfaces, applied formulas, kept arrays sorted, and handled exceptions. Finally you followed the software development life cycle with specifications, Gantt and PERT charts, test plans, debugging methods and status reports, and put it all together in a mini project.

This review has three questions from every lesson. Try each one, then press Show answer.

How to use this review

Do one or two sections at a time. Answer on paper first; for code questions, trace by hand before you run anything. For every question you get wrong, write down why (forgot a definition? off-by-one? wrong symbol? skipped an extreme case?) and go back to that lesson's worked examples. Finish with the 10-question quiz. If you can explain each diagram in this unit to someone at home in under a minute, you are ready.

Define and analyzeproblem statementinterviews, surveysspecificationIPO chartDesignstepwise refinementflow chart, pseudocodestructure chart, DFD, UMLskeleton, screen designsCodemodular functionsformulas, sorted arraysexception handlingfriendly promptsTest and delivertest plantracing, debug printsuser guidemaintenanceAcross every phase: Gantt chart, critical path and PERT, status reports, teamwork
The unit at a glance: the tools you used in each part of the life cycle. Project management and communication run through all of it.
Flow chart / pseudocodesteps, decisions and loops in ONE algorithmStructure chartmodules, who calls whom, data couplesData flow diagramwhere data comes from, goes and is storedUML class diagramattributes and methods of a classGantt charttasks and milestones on a timelinePERT / critical pathdependencies and the longest chain
Which diagram shows what. Choose the diagram that answers the question your reader is asking.

Problem-Solving Strategies for Programmers

1

A value is tripled, then 4 is subtracted, giving 26. Work backwards to find the value.

2

With halving, what is the greatest number of guesses needed to find a number from 1 to 200?

3

Name the strategy: "Try every n from 1 to 99 and print those that satisfy the condition." When is it a reasonable choice?

The Input-Process-Output Model

1

Make an IPO chart for: "Read the number of kilometres skied each day for 3 days and output the total and the daily average."

2

A program reads a price and outputs the total with 13% HST. What is the output for $80?

3

What is an intermediate value? Give one from the road-trip program.

Solving Problems Alone and in Teams, and Talking About Designs

1

Describe the roles in pair programming.

2

Two designs find 1 + 2 + ... + n: a loop and the formula n(n + 1) ÷ 2. Compare them on efficiency and flexibility.

3

Rewrite as a good help request: "Help, my code is broken."

Designing with Flow Charts and Pseudocode

1

Which flow chart symbols are used for: a decision, an input, a calculation, Start?

2

Trace and give the output: SET n TO 2 / WHILE n < 30 / SET n TO n × 2 + 1 / END WHILE / OUTPUT n.

3

Translate FOR i FROM 3 TO 6 into a Python for line.

Structure Charts, Data Flow Diagrams and UML

1

In a structure chart, what does a data couple going up from a module usually become in Python?

2

In a DFD, why can an external entity not connect directly to a data store?

3

Write a UML class box (as text) for Rink with a name, a capacity, and a method is_full(people) that returns a Boolean.

Modular Design: Reusable Code and Program Skeletons

1

What is a stub, and why does a good skeleton contain them?

2

Explain high cohesion and low coupling in one sentence each.

3

A file tools.py contains def double(x): return 2 * x. Write the two lines another program uses to print double(21), and give the output.

Designing User-Friendly Interfaces

1

Improve the prompt input("n?") for a program that needs the number of guests (1 to 20).

2

Give the three qualities of a good error message.

3

Why does a validation loop use while instead of if?

Formulas in Algorithms: Hypotenuse, Primes, Area and Circumference

1

Find the hypotenuse for legs 9 and 12, and write the Python expression.

2

Up to which divisor does the efficient prime test check for n = 150? Is 150 prime?

3

Find the area of a circle of radius 4 cm to 1 decimal place.

Algorithms to Specification: Inserting and Deleting in a Sorted Array

1

Trace insert_sorted([2, 6, 9, 14], 7). How many items shift?

2

Trace delete_value([5, 10, 15, 20], 10). What is returned and what is the list?

3

Give three extreme cases to test for these algorithms.

Detecting and Handling Exceptions

1

Name the exception: int(""), 7 / 0, [1, 2][2], math.sqrt(-1).

2

What does this print? try: n = int("4.5") print("A") except ValueError: print("B")

3

How many real roots has 2x² + 4x + 5 = 0? What should real_roots return?

The Software Development Life Cycle and Clarifying Specifications

1

List the seven phases of the life cycle in order.

2

Give one milestone and one product for the analysis phase.

3

Make this requirement testable: "Reports should be easy to read."

Planning a Project: Gantt Charts, Critical Paths, PERT and Status Reports

1

Tasks: A (3 days), B (2 days, after A), C (4 days, after A), D (1 day, after B and C). Find the project length, the critical path and B's slack.

2

Find the PERT expected time for O = 2, M = 3, P = 10.

3

Name the five parts of a status report.

Testing with a Test Plan: Expected versus Actual

1

For "pass if mark >= 50" (marks 0 to 100), list two boundary tests and two invalid tests with expected results.

2

Why must expected outcomes be worked out before running the program?

3

Explain black-box versus white-box testing.

Debugging Methods: Tracing and Printing Variable State

1

Trace: t = 1, for k in range(1, 4): t = t * k, then print(t). What is printed?

2

What is a debug print, and what should happen to it after the bug is fixed?

3

A function to find the smallest number starts with smallest = 0. Which input reveals the bug, and what is the fix?

Mini Project: Building a Program Through the Whole Life Cycle

1

In the coat-drive project, which line of code makes " 11b" and "11B" the same homeroom?

2

A client asks for a new feature after the specification is approved. What should the team do?

3

Which product belongs to the implementation phase of the project?

Just for fun

Final debugging fact: the most common bug in this unit is not in the code at all. It is skipping the plan. Good news: it's also the easiest one to fix.

Check your understanding

Quiz

1.

Which strategy breaks one big task into smaller and smaller steps?

2.

In the IPO model, the 13% HST rate in a tax program is best treated as:

3.

Which diagram shows a program's modules and which module calls which?

4.

What is a stub?

5.

To test whether 121 is prime, the efficient algorithm checks divisors up to:

6.

How many items shift when 1 is inserted into the sorted list [3, 5, 8, 13]?

7.

What does this print? try: print(len([]) / 0) except ZeroDivisionError: print("none")

8.

In which life-cycle phase is the specification produced?

9.

Chains of tasks take 9, 14 and 11 days. A task on the 9-day chain is delayed by 3 days. The project now takes:

10.

A test expects $10 but the program shows $14 for age 65. What is the best next step?

For parents and teachers

How to use the review: Let your teen work through one or two sections at a time and check answers honestly. Mistakes show which lesson to revisit:

  • Strategies, working backwards, halving or brute force → Problem-Solving Strategies for Programmers.
  • Mixing up inputs, constants and outputs → The Input-Process-Output Model.
  • Teamwork roles, comparing designs → Solving Problems Alone and in Teams.
  • Wrong flow chart symbols or pseudocode translations → Designing with Flow Charts and Pseudocode.
  • Structure charts, DFDs or UML confused → Structure Charts, Data Flow Diagrams and UML.
  • Stubs, skeletons, imports, cohesion and coupling → Modular Design.
  • Prompts, error messages, validation loops → Designing User-Friendly Interfaces.
  • Formula brackets, hypotenuse, primes, area → Formulas in Algorithms.
  • Shifting errors in inserts and deletes → Inserting and Deleting in a Sorted Array.
  • Exception names, try/except, discriminant → Detecting and Handling Exceptions.
  • Phases, milestones, products, specifications → The Software Development Life Cycle.
  • Critical path, slack, PERT, status reports → Planning a Project.
  • Boundary and invalid tests, expected versus actual → Testing with a Test Plan.
  • Trace tables, debug prints → Debugging Methods.
  • Putting the phases together → Mini Project.

The best final check is the mini project itself: if your teen can take a small program from a client conversation to a tested, documented hand-over, they have met this strand.