0% found this document useful (0 votes)
2 views27 pages

Program Development Life Cycle (PDLC) : Analysis Design

The document outlines the Program Development Life Cycle (PDLC), which includes stages such as analysis, design, coding, testing, and maintenance, emphasizing the importance of clear problem definition and documentation. It also discusses various programming concepts, including data types, algorithms, validation, and verification, as well as the significance of test data and trace tables in ensuring program functionality. Additionally, it covers file handling and the use of library routines to streamline programming tasks.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views27 pages

Program Development Life Cycle (PDLC) : Analysis Design

The document outlines the Program Development Life Cycle (PDLC), which includes stages such as analysis, design, coding, testing, and maintenance, emphasizing the importance of clear problem definition and documentation. It also discusses various programming concepts, including data types, algorithms, validation, and verification, as well as the significance of test data and trace tables in ensuring program functionality. Additionally, it covers file handling and the use of library routines to streamline programming tasks.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 27

1

Program Development Life


Cycle (PDLC)
 Analysis
 Design
 Coding
 Testing
 Maintenance
 Before solving a problem, it is essential to define and document the problem clearly,
known as the "requirements specification" for the program.
 The ANALYSIS DESIGN involves using tools like abstraction and decomposition to
identify the specific requirements for the program.
 Abstraction focuses on the essential elements needed for the solution while
eliminating unnecessary details and information.
 Decomposition involves breaking down complex problems into smaller, more
manageable parts that can be solved individually.
 Daily tasks can be decomposed into constituent parts for easier understanding and
solving.
 The program specification derived from the analysis stage is used as a guide for
program development.
 During the DESIGN STAGE, the programmer should clearly understand the tasks to
be completed, the methods for performing each task, and how the tasks will work
together.
 Documentation methods such as structure charts, flowcharts, and pseudocode can
be used to document the program's design formally.
 The program or set of programs is developed based on the design.
 Each module of the program is written using a suitable programming language.
 TESTING is conducted to ensure that each module functions correctly.
 Iterative testing is performed, which involves conducting modular tests, making code
amendments if necessary, and repeating tests until the module meets the required
functionality.
 The completed program or set of programs is executed multiple times using various
test data sets.
 This testing process ensures that all the tasks within the program work together as
specified in the program design.
 Running the program with different test data can identify and address potential
issues and errors.
 The testing phase aims to verify the overall functionality and performance of the
program by evaluating its behaviour with various inputs.

Structure Diagrams
2

 Every computer system is made up of sub-systems, which are in turn


made up of further sub-systems.
 Structure Diagrams – The breaking down of a computer system into
sub-systems, then breaking each sub-system into smaller sub-systems
until each one only performs a single action. A structure diagram
diagrammatically represents a top-down design. Example below.

Pseudocode & Flowcharts


 Pseudocode - Verbal representation of an algorithm (a process or set
of steps) and flowcharts are a diagrammatic representation.
 Flowcharts: A flowchart shows diagrammatically the steps required
to complete a task and the order that they are to be performed
 Algorithm: These steps, together with the order, are called an
algorithm
3

An example of a flowchart is given below from a past paper question in


which all of the functions of a flowchart are shown:
4

This flowchart’s task is to check if a rider’s height is more the requirement (1.2) in this
case. It then counts until the accepted riders are 8. After they are 8, it outputs the number
of rejected riders and tells the rest that they are ready to go!

Pseudocode
 Declaration & Usage of Variables & Constants
o Variable – Store of data which changes during execution of the
program (due to user input)
o Constant – Store of data that remains the same during the
execution of the program
 Basic Data Types
INTEGER – Whole Number e.g. 2; 8; 100
o REAL – Decimal Number e.g. 7.00; 5.64
o CHARACTER– Single Character e.g. a; Y
o STRING – Multiple Characters (Text) e.g. ZNotes; COOL
o BOOLEAN – Only 2 Values e.g. True/False; Yes/No; 0/1
 Input & Output (READ & PRINT) – Used to receive and display data
to the user respectively. (It is recommended to use input and output
commands)

 Declaration of variable - A variable/constant can be declared by the


following manner

 Array: Array is similar to variable but it can store multiple values of


same datatype under single name
5

 Assignment - Each variable is assigned using a left arrow.

 Conditional Statements: CASE…OF…OTHERWISE…ENDCASE –


Multiple IF…THEN…ELSE…ENDIF conditions and corresponding
consequences

 Loop Structures:
6

REPEAT… UNTIL – Will run WHILE…DO…ENDWHILE – May not


ever at least once till condition is satisfied; run; Verification is done before
running Verification is done after running code code

Note: When using conditions in these loop structures and conditional


statement, it has to be kept in mind that it can be done in two ways.
1. use of a Boolean variable that can have the value TRUE or FALSE
2. comparisons made by using coparison operators, where comparisons
are made from left to right

 Totalling :Totalling means Counting: Keeping a count of the


number keeping a total that values of times an action is
performed is are added to . another
standard method.
7

 Maximum, minimum and average : Finding the largest and smallest


values in a list are two standard methods that are frequently found in
algorithms

 Linear Search: In a linear search, each item in the list is inspected


sequentially until a match is found or the entire list is traversed.
8

 Bubble Sort: Iteratively compare and swap adjacent elements in a


list to sort them. Start from the first element and continue until the
second-to-last element. After each pass, the last element is in its
correct place. However, other elements may still be unsorted. Repeat
the process, excluding the last element, until only one element
remains or no swaps are needed.
9

Test Data

 Test data refers to input values used to evaluate and assess the
functionality and performance of a computer program or system.
 It helps identify errors and assess how the program handles different
scenarios
 Normal data is the test data which accepts values in acceptible range
of values of the program
 Normal data should be used to work through the solution to find the
actual result(s) and see if they are the same as the expected result(s)
 e.g. in a program where only whole number values ranging from 0 to
100 (inclusive) are accepted, normal test data will be : 23, 54, 64 , 2
and 100
 Test data that would be rejected by the solution as not suitable, if the
solution is working properly is called abnormal test data / erroneous
test data.
10

 e.g. in a program where only whole number values ranging from 0 to


100 (inclusive) are accepted, abnormal data will be: -1, 151, 200,
67.2, “Sixty-Two” and -520
 Extreme data are the largest and smallest values that normal data
can take
 e.g. in a program where only whole number values ranging from 0 to
100 (inclusive) are accepted, extreme data will be: 0 and 100
 This is used to establish where the largest and smallest values occur
 At each boundary two values are required: one value is accepted and
the other value is rejected.
 e.g. in a program where only whole number values ranging from 0 to
100 (inclusive) are accepted, one example of boundary data will be:
100 and 101. 100 will be accepted and 101 will not be accepted

Trace Tables
 A trace table is utilized to document the outcomes of every step in an
algorithm. It is employed to record the variable's value each time it
undergoes a change.
 A dry run refers to the manual process of systematically executing an
algorithm by following each step in sequence.
 A trace table is set up with a column for each variable and a column
for any output e.g.

Test data is employed to execute a dry run of the flowchart and document
the outcomes in a trace table. During the dry run:
 Whenever a variable's value changes, the new value is recorded in the
respective column of the trace table.
 Each time a value is outputted, it is displayed in the output column.
An example of trace table is given below using a past paper question:
Q: The flowchart below inputs the height of children who want to ride on a
rollercoaster. Children under 1.2 metres are rejected. The ride starts when
eight children have been accepted.
11

Complete the trace table for the input data: 1.4, 1.3, 1.1, 1.3, 1.0, 1.5, 1.2,
1.3, 1.4, 1.3, 0.9, 1.5, 1.6, 1.0
12

 Trace tables can be used to trace errors in a program. For example, if


the requirement for the previous question would be to accept riders that
are of height 1.2 too, rather than rejecting them, then the error would
have been caught in the trace table as when 1.2 is entered, it would
increment rejected which it shouldn’t in our example

How to write an algorithm?


13

The ability to write an algorithm is very important for this syllabus


and paper. Some key steps/points to be known in-order to write
the perfect algorithm are as follows:
1. Make sure that the problem is clearly understood which includes
knowing the purpose of the algorithm and the tasks to be completed
by the algorithm.
2. Break the problem into smaller problems (e.g. in a program which
outputs average values, divide the problem into multiple ones i.e. how
to count the number of iterations and how to count the total of all
values)
3. Identify the data that is needed to be saved into
variables/constants/arrays and what datatype it is, and declare all the
variables/constants/arrays accordingly, with meaningfull names
4. Decide on how you are going to construct your algorithm, either using
a flowchart or pseudocode. If you are told how to construct your
algorithm, then follow the guidance.
5. Construct your algorithm, making sure that it can be easily read and
understood by someone else. Take particular care with syntax e.g.
when conditions are used for loops and selection.
6. Use several sets of test data (Normal, Abnormal and Boundary) to dry
run your algorithm and check if the expected results are achieved (a
trace table can be used for this purpose) . If error is found, find the
point of error in the trace table and fix it in the code.
Note: The algorithms that you have looked at so far in these notes were
not designed with readability in mind because you needed to work out
what the problem being solved was.

Validation And Verification


14

To ensure the acceptance of reasonable and accurate data inputs,


computer systems must thoroughly examine each data item before
accepting it, and this is where Validation and Verification come into play!
Validation in computer systems involves automated checks to ensure the
reasonableness of data before accepting it. If the data is invalid, the
system should provide an explanatory message for rejection and allow
another chance to enter the data.
There are many types of it.
A range check verifies that a numerical value falls within specified upper
and lower limits.

This can either ensure that data consists of a precise number of characters.

It can also check if the data entered is a reasonable number of characters


or not
15

A type check verifies that the entered data corresponds to a specific data
type.

A presence check checks to ensure that some data has been entered and
the value has not been left blank
16

A format check checks that the characters entered conform to a pre-


defined pattern.
 A check digit is the final digit included in a code; it is calculated from
all the other digits.
 Check digits are used for barcodes, product codes, International
Standard Book Numbers (ISBN), and Vehicle Identification Numbers
(VIN).
Verification is checking that data has been accurately copied from one
source to another
There are 2 methods to verify data during entry ( there are other
methods during data transfer, but they are in paper 1)
 Data is inputted twice, potentially by different operators.
 The computer system compares both entries and if they differ, an
error message is displayed, prompting the data to be reentered.
 A screen/visual check involves the user manually reviewing the
entered data.
 After data entry, the system displays the data on the screen and
prompts the user to confirm its accuracy before proceeding.
 The user can compare the displayed data against a paper document
used as an input form or rely on their own knowledge to verify
correctness.
17

Programming Concepts

 Data use – variables, constants and arrays


 Sequence – order of steps in a task
 Selection – choosing a path through a program
 Iteration – repetition of a sequence of steps in a program
 Operators use arithmetic for calculations and logic and Boolean for
decisions.
 A variable within a computer program refers to a named storage unit
with a value that can be modified throughout the program's
execution. To enhance comprehension for others, it is advisable to
assign significant names to variables.
 A constant within a computer program represents a named storage
unit that holds a value which remains unchanged throughout the
program's execution. Similar to variables, it is recommended to assign
meaningful names to constants to enhance comprehensibility for
others.
18

 Different data types are assigned to computer systems for effective


processing and storage.
 Data types allow data, such as numbers or characters, to be stored
appropriately.
 Data types enable effective manipulation using mathematical
operators for numbers and character concatenation.
 Some data types provide automatic validation.
 The types of datatypes are told in Chapter 1 already!
 Programs require input and output statements to handle data.
 In IGCSE Computer Science, algorithms and programs are designed to
take input from a keyboard and output to a screen.
 Prompting the user with clear instructions for input is necessary for
the user to understand what is expected.
 Input data in programming languages must match the required data
type of the variable where it will be stored.
 By default, inputs are treated as strings, but commands can convert
input to integer or real number data types.
 Users should be provided with information about the output/results for
a program to be useful.
 Each output should be accompanied by a message explaining the
result's meaning or significance.
 If an output statement has multiple parts, they can be separated by a
separator character.

File Handling
 Computer programs store data that will be needed again in a file.
 Data stored in RAM is volatile and will be lost when the computer is
powered off.
 Data saved to a file is stored permanently, allowing it to be accessed
by the same program at a later date or by other programs.
 Stored data in a file can be transferred and used on other computers.
 The storage of data in files is a commonly used feature in
programming.
Key point: When writing in a file, the program is outputing the
data to the file, and when reading a file, the program in inputing
the data from the file
There are 3 ways a file can be opened in a program i.e. to write, to read
and to append
19

Library Routines

 Programming language development systems often provide library


routines that can be readily incorporated into programs.
20

 Library routines are pre-tested and ready for use, making


programming tasks easier.
 Integrated Development Environments (IDEs) typically include a
standard library of functions and procedures.
 Standard library routines perform various tasks, including string
handling.
 MOD – returns the remainder of a division
 DIV – returns the quotient (i.e. the whole number part) of a division
 ROUND – returns a value rounded to a given number of decimal places
 RANDOM – returns a random number.
Examples:
 Value1 <--- MOD(10,3) returns the remainder of 10 divided by 3
 Value2 <---- DIV(10,3) returns the quotient of 10 divided by 3
 Value3 <--- ROUND(6.97354, 2) returns the value rounded to 2
decimal places
 Value4 <--- RANDOM() returns a random number between 0 and 1
inclusive

Creating a Maintainable
Program

A maintainable program should:


 always use meaningful identifier names for variables, constants,
arrays, procedures and functions
 be divided into modules for each task using procedures and functions
 be fully commented using your programming language’s commenting
feature
Commenting in pseudocode:
21

Programming Languages
There are many high-level programming languages to choose
from. We will only be treating Python, Java and Visual Basic.
 Python is an open-source, versatile programming language that
encourages quick program development and emphasises code
readability. The integrated development environment (IDE) showcased
in this chapter is referred to as IDLE.
 Visual Basic is a popular programming language that is extensively
used for Windows development. The integrated development
environment (IDE) featured in this chapter is known as Visual Studio,
which is utilised for capturing screenshots.
 Java is a widely adopted programming language utilised by numerous
developers. The integrated development environment (IDE) employed
for capturing screenshots in this chapter is known as BlueJ.

Basic Concepts
When writing the steps required to solve a problem, the following concepts
need to be used and understood:
 Sequence
 Selection
 Iteration
22

 Counting and totalling


 String handling
 Use of operators.
The ordering of the steps in an algorithm is very important. An incorrect
order can lead to incorrect results and/or extra steps that are not required
by the task.
Selection is a very useful technique, allowing different routes through the
steps of a program. The code of this is explained in the notes of previous
chapters.
As explained in the previous chapter, we already
As explained in the previous chapter, we already
 Strings are used to store text and can contain various characters.
 An empty string has no characters, while the programming language
specifies the maximum number of characters allowed.
 Characters in a string can be identified by their position number,
starting from either zero or one, depending on the programming
language.
 String handling is an important aspect of programming.
 In IGCSE Computer Science, you will need to write algorithms and
programs for the following string methods:
o Length: Determines the number of characters in a string,
including spaces.
o Substring: Extracts a portion of a string.
o Upper: Converts all letters in a string to uppercase.
o Lower: Converts all letters in a string to lowercase.
 These string manipulation methods are commonly provided in
programming languages through library routines.
Finding the length of a string:

Extracting a substring from a string:


23

Converting a string to upper case

Converting a string to lowercase

As explained in the previous chapter, we already


 Selection and iteration statements can be nested, meaning one
statement can be placed inside another.
 Nested statements help reduce code duplication and simplify testing
of programs.
 Different types of constructs can be nested within each other, such as
selection statements within condition-controlled loops or loops within
other loops.
 A procedure refers to a collection of programming statements
organized under a single name, invoked at any given point in a
program to execute a specific task.
 A function is a compilation of programming statements consolidated
under a singular name, invoked at any moment within a program to
accomplish a particular task. Unlike a procedure, a function also has
the capability to return a value back to the main program.
 Parameters refer to variables that store the values of arguments
passed to a procedure or function. While not all procedures and
functions require parameters, some utilize them to facilitate their
operations.
Procedures without parameters:
24

The procedure with parameters:

Function:

 When defining procedures and functions, the header is the first


statement in the definition.
 The header includes:
o The name of the procedure or function.
o Parameters passed to the procedure or function, along with their
data types.
o The data type of the return value for a function.
 Procedure calls are standalone statements.
25

 Function calls are made as part of an expression, typically on the


right-hand side.
 Any part of a program can use a global variable – its scope covers the
whole program
 A local variable can only be used by the part of the program it is
declared in – its scope is restricted to that part of the program.
Note: Any variables/arrays made in this procedure and functions
will be local and cannot be used out of these. To be made available
all over the program, they must be declared globally in the
following way.

Arrays
 An array is a data structure containing several elements of the same
data type; these elements can be accessed using the same identifier
name.
 The position of each element in an array is identified using the array’s
index.
 There are two types of arrays
Explained in the previous chapter in detail
 A two-dimensional array can be referred to as a table with rows and
columns.
26

 When a two-dimensional array is declared in pseudocode, the first and


last index values for rows and the first and last index values for
columns alongside the data type are included.
Declaring a 2D Array:

Filling a 2-D array using a loop:


27

You might also like