You are on page 1of 8

7.1.

Program Development Life Cycle


Learning Objective: Understand the program development life cycle.

Activities:

1. Introduction to Program Development Life Cycle (PDLC):

• Teacher explains the four stages of PDLC: Analysis, Design, Coding, and Testing.
• Briefly defines each stage.
2. Analysis:

• Teacher explains analysis, emphasizing identification, abstraction, decomposition of


the problem, and identification of requirements.
3. Design:

• Teacher demonstrates decomposition using structure diagrams, flowcharts, and


pseudocode.
• Discusses the importance of structure diagrams in representing systems.
4. Coding:

• Teacher explains the coding stage, emphasizing writing program code and iterative
testing.
5. Testing:

• Teacher discusses the testing stage, explaining how program code is tested using test
data.

7.2. Decomposition and Algorithm Design


Learning Objective: Understand how a problem can be decomposed into its component
parts. Use different methods to design and construct a solution to a problem.

Activities:

1. Brainstorming Non-Computer System:

• Class brainstorms a non-computer system to show it is comprised of sub-systems.


• Learners analyze a system (e.g., academic structure of a school) to identify and sub-
divide sub-systems.
2. Tutorial on Structure Diagrams:

• Teacher introduces SmartDraw and provides a tutorial on drawing structure


diagrams.
• Learners create structure diagrams for a chosen system.
3. Everyday Process Analysis:
• In pairs, learners identify the sequence of operations for a simple multi-stage
everyday process (e.g., making tea).
• Teacher leads discussion on decomposing problems into inputs, processes, outputs,
and storage.
4. Introduction to Flowcharts and Pseudocode:

• Teacher introduces flowcharts, explaining symbols and flow of control/data.


• Teacher presents a simple flowchart for a common problem.
5. Pseudocode Algorithm:

• Teacher presents a pseudocode algorithm for the same problem.


• Explains the use of variables, mathematical operators, logical operators, and
Boolean operators.
6. Hands-on Pseudocode Exercise:

• In pairs, learners create pseudocode algorithms for different everyday processes.


• Emphasize the use of variable names, mapping values, and different operators.
Learning Objective: Understand the program development life cycle.

Activities:

Introduction to Program Development Life Cycle (PDLC):


1. Teacher explains the four stages of PDLC: Analysis, Design, Coding, and Testing.

• Explanation:

• The teacher provides an overview of PDLC, emphasizing that it is a systematic


process used to develop software.
• Breakdown of each stage:
• Analysis: Understanding the problem and requirements.
• Design: Planning the solution using diagrams and pseudocode.
• Coding: Writing the actual program.
• Testing: Ensuring the program works as intended.
• Engagement:

• Encourage questions to ensure students grasp the basic concepts.


• Provide real-world examples to illustrate the importance of each stage.

2. Briefly defines each stage.

• Explanation:

• Analysis involves understanding the problem, breaking it down, and defining what
the software needs to accomplish.
• Design is the planning phase, involving the creation of diagrams and pseudocode to
represent the solution.
• Coding is the implementation of the designed solution in a programming language.
• Testing ensures the code functions correctly by using various test cases.
• Engagement:

• Use relatable examples to make each stage more understandable.


• Discuss how each stage builds upon the previous one.

Analysis:
3. Teacher explains analysis, emphasizing identification, abstraction, decomposition of the
problem, and identification of requirements.

• Explanation:

• Identification: Recognizing the nature and scope of the problem.


• Abstraction: Focusing on essential details while ignoring irrelevant ones.
• Decomposition: Breaking down the problem into smaller, manageable parts.
• Requirements: Identifying what the software needs to achieve.
• Engagement:

• Conduct a simple problem analysis together to illustrate the concepts.


• Use visuals and examples to enhance understanding.

Design:
4. Teacher demonstrates decomposition using structure diagrams, flowcharts, and
pseudocode.

• Explanation:

• Structure Diagrams: Visual representation of how a system is organized.


• Flowcharts: Diagrams that represent processes or workflows.
• Pseudocode: A high-level description of an algorithm using a mixture of natural
language and programming constructs.
• Engagement:

• Walk through the creation of a structure diagram for a simple system.


• Show examples of flowcharts and pseudocode to represent solutions.

5. Discusses the importance of structure diagrams in representing systems.

• Explanation:

• Structure diagrams help in visualizing the components and relationships within a


system.
• They provide a blueprint for the design phase, aiding in a systematic approach to
problem-solving.
• Engagement:

• Have students discuss the benefits of using structure diagrams.


• Connect the importance of clear design to effective problem-solving.

Coding:
6. Teacher explains the coding stage, emphasizing writing program code and iterative testing.

• Explanation:

• Coding involves translating the designed solution into a programming language.


• Iterative testing means testing the code in increments to catch and fix issues early.
• Engagement:

• Walk through a simple coding example, explaining each step.


• Emphasize the importance of testing throughout the coding process.

Testing:
7. Teacher discusses the testing stage, explaining how program code is tested using test data.

• Explanation:

• Testing ensures the software behaves as expected and catches errors or bugs.
• Test data includes various inputs to verify different scenarios.
• Engagement:

• Provide examples of common testing scenarios.


• Encourage students to think critically about potential issues and test cases.
Case Study: Library Management System
Background:
A local library wants to implement a computerized system to manage its book inventory, track
borrowing and returning of books, and maintain user information. The library currently relies on
manual methods, and they aim to improve efficiency and accuracy through automation.

Analysis:
Identification:

• Problem: Manual book management is time-consuming and prone to errors.


• Scope: Develop a computerized system for book inventory and user information.

Abstraction:

• Essential Details:
• Book details (title, author, ISBN, quantity).
• User information (name, ID, contact details).
• Borrowing and returning procedures.

Decomposition:

• Breakdown:
• Inventory management.
• User information management.
• Borrowing and returning processes.

Requirements:

• System Requirements:
• User-friendly interface.
• Search and update functionality.
• Record borrowing and returning transactions.

Design:
Structure Diagram:

• Components:
• Book Inventory
• User Database
• Transaction Log

Flowchart:

• Process Flow:
1. Search for a book.
2. Update book information.
3. Add a new user.
4. Record book borrowing.
5. Record book return.

Pseudocode:
function searchBook(title):
// Search book in inventory
// Display book details

function updateBookInfo(isbn, newQuantity):


// Update book quantity in inventory

function addUser(name, id, contact):


// Add new user to the database

function borrowBook(userId, bookId):


// Record book borrowing transaction

function returnBook(userId, bookId):


// Record book return transaction

Coding:
Implementation (partial Python example):
class Book:
def __init__(self, title, author, isbn, quantity):
self.title = title
self.author = author
self.isbn = isbn
self.quantity = quantity

class User:
def __init__(self, name, user_id, contact):
self.name = name
self.user_id = user_id
self.contact = contact

class LibrarySystem:
def __init__(self):
self.books_inventory = {}
self.users_database = {}
self.transactions_log = []

def search_book(self, title):


# Implementation for searching a book in inventory
pass
def update_book_info(self, isbn, new_quantity):
# Implementation for updating book quantity
pass

def add_user(self, name, user_id, contact):


# Implementation for adding a new user
pass

def borrow_book(self, user_id, book_id):


# Implementation for recording book borrowing transaction
pass

def return_book(self, user_id, book_id):


# Implementation for recording book return transaction
pass

Testing:
Test Data:

• Scenarios:
• Searching for a book.
• Updating book quantity.
• Adding a new user.
• Borrowing a book.
• Returning a book.

Test Cases:
1. Search for a book by title.
• Expected outcome: Display book details.
2. Update the quantity of a book.
• Expected outcome: Inventory reflects the updated quantity.
3. Add a new user.
• Expected outcome: User is added to the database.
4. Borrow a book.
• Expected outcome: Record the borrowing transaction.
5. Return a book.
• Expected outcome: Record the return transaction.

You might also like