B.Tech-3 Sem (CSE) Subject:: Principles of Programming Languages
B.Tech-3 Sem (CSE) Subject:: Principles of Programming Languages
Subject: Principles of
Programming Languages
By:
Kajal Tiwari
Assistant Professor (CSE)
Syllabus
Unit- 1
Program Design
Introduction Design Techniques
Fundamental design concepts Step wise refinement
Modules Levels of abstraction
Modularization Criteria Top Down
Design Notation: Test Plans- Design guidelines
Procedure Template
Pseudo code
Structured flow chart decision
Tables-
Introduction to Program Design
Having a common understanding of the terms that we use in program design and development can
contribute to successful processes and outcomes.
Terms such as organization, program, system, or intervention are often used inter-changeably.
Program design is the process that an organization uses to develop a program.
It is most often an iterative process involving research, consultation, initial design, testing and redesign.
A program design is the plan of action that results from that process.
Five reasons to do program design and development:
1. There is really a need for the program
2. The design you are considering actually meets the needs of the intended participants
3. The program you are considering has been shown to be effective
4. The program has been appropriately adapted to fit your context
5. The program is actually working for the participants.
Fundamental design concepts
Program design includes
1. Need for the program : assesses what a population needs, what is available in community and the gap
between what is needed and what is available
2. Program objectives and outcomes : what the program is intended to accomplish for the particular target
population.
3. Program principles : the fundamental norms, rules and values that guide the program (e.g. being
inclusive, client-focused).
4. Program components : a specific set of inter-connected activities
5. Budget/cost : what it will cost to implement the program.
6. Funding strategy : how the program will be funded. Can it be done within the current organizational
budget? The funding strategy needs to include start-up and long-term funding.
7. Governance : some programs are set within an existing organization or some programs may be a
collaboration among two or more organizations. The design needs to include the process for decision-
making
Steps for designing and developing a program
Cntd…
1. Identify a potential need – often organizations see that people using their programs have
additional needs that are not being addressed. This may create an opportunity for new
programming which will usually require additional resources.
2. Conduct a needs assessment – in order to determine the needs of a specific target population,
gather and analyze data taken from different sources in a systematic way, looking at the needs of
the population and the existing programs in order to determine whether there are gaps.
3. Research potential programs for filling need – deciding on how best to address an identified
need requires searching for and reviewing existing programs.
4. Select an evidenced-based design –This means the design has been previously implemented
and evaluated and has demonstrated some ability to produce a desired outcome for the target
group. If such a program does not exist or is not suitable for the context, components of a
program may be selected and adapted or a new program may be designed.
5. Develop the program design – using a logic model as a tool, create a detailed plan that specifies
program activities, resource allocations and expected outcomes. Program design consolidates all
of the information gathered during the development process and sets out the program’s
outcomes, outputs, activities and resources.
Cntd…
Advantage of modularization:
1. Smaller components are easier to maintain
2. Program can be divided based on functional aspects
3. Desired level of abstraction can be brought in the program
4. Components with high cohesion can be re-used again
5. Concurrent execution can be made possible
6. Desired from security aspect
Design Notation
Design notations are used when planning and should be able to communicate the
purpose of a program without the need for formal code. Commonly used design
notations are:
1. Pseudocode
2. Flow charts
3. Structure chart
1) Pseudocode:
Cntd… When designing a program, it is useful to lay out how the program might work, before writing it in
a programming language,.
Pseudocode is a design notation that is closely related to the logic of how a program will work.
It lets you detail what your program will do without having to worry about the particular syntax of
your chosen programming language.
There is no specific standard for pseudocode and programmers often have their own version.
Pseudocode can look a lot like code but it does not need to be implemented as strictly.
Programming languages like python, reference language (used by the SQA) and visual basic will
have specific rules around syntax and structure, whereas pseudocode gives more freedom.
Pseudocode can be used to plan out programs. It is similar to actual code.
A programmer who uses pseudocode as part of their planning is able to take time to think about
how their program will work, what variables they might need and what inputs and outputs there
are.
There is no strict set of rules for pseudocode, but some of the most widely recognized are:
INPUT – indicates a user will be inputting something
OUTPUT – indicates that an output will appear on the screen
WHILE – a loop (iteration that has a condition at the beginning)
FOR – a counting loop (iteration)
REPEAT – UNTIL – a loop (iteration) that has a condition at the end
IF – THEN – ELSE – a decision (selection) in which a choice is made
Cntd…
2) Flow charts :
Flow charts show what is going on in a program
and how data flows around it.
Flow charts can represent everyday processes,
show decisions taken and the result of these
decisions.
The diamond shape explains when there is a
choice to make.
The flow chart shows what happens depending
on the decision made at this point.
Flow charts visualize the results of decisions,
showing what will happen in a program, and also
when, for example an if statement, is required to
make a decision.
3) Structure diagrams :
Another way of representing a program design is to use a structure
diagram. Structure diagrams break down a problem into smaller
sections.
These smaller sections can then be worked on one at a time.
This can be good for big projects where a large problem can be
split into smaller tasks for separate groups, or individuals, to work
on.
Here is an example of how a structure diagram might be used to
break a large problem down.
This shows how you can take a complex problem and start
breaking it down into more manageable chunks.
In reality, a complex project like building a house would have
many more stages, but this example shows that structure diagrams
can help to break down problems when designing a program.
You would most likely use a structure diagram if you were
designing a game and wanted to break down the overall design
problem into individual elements.
Tables
Decision table is a good way to deal with combinations of things (e.g. Inputs).
This technique is sometimes also referred to as a ‘ cause-effect’ table.
The reason for this is that there is an associated logic diagramming technique called ‘ cause-
effect graphing’ which was sometimes used to help derive the decision table.
A decision table is basically an outstanding technique used in both testing and requirements
management. It is a structured exercise to prepare requirements when dealing with complex
business rules. Also, used in model complicated logic.
Design Techniques
Software testing is a process carried out to check and confirm the delivery potential of the
software.
In this procedure, a set of pre-decided inputs are fed into the software and the output produced
is measured against the expected results.
This process helps to ensure that the software is working as desired and can be released into the
market.
Software released without sufficient testing can damage the company’s standing in two ways.
It will generate poor customer reviews
It will lead to more serious problems such as the leakage of the customer’s private data.
This can severely impair the organization’s business prospects.
Software test design refers to the process of designing different tests that validate the eligibility
of a software before its release in the market.
The process of test designing assumes high priority, as a poorly designed test will lead to
improper testing of an application.
This, in turn, leads to failure in identifying defects and consequently, an application containing
errors may be released.
Cntd…
While a developer has to ensure that the software meets the specifications, a business owner
has to ensure that it meets the business’ operational needs.
To satisfy these individual goals and the main aim of the software development process, that
is a high-quality output, one will have to plan, design, and conduct tests in different
environments.
To ensure that the testing strategy checked out is an effective one, following the below-
mentioned steps is essential:
1. Gathering and understanding the requirements of the users
2. Deriving all important business scenarios
3. Designing test scenarios for all the important business scenarios
4. Assigning all the designed test scenarios to different test cases
5. Once done with all the above-mentioned steps, one will have to choose a test design
technique as per the requirements of their business. Some of the most common design
techniques are listed below.
Cntd…
2 Types of Software Test Design Techniques
There are various types of designing techniques, each of which is suitable for
identifying a particular type of error.
Hence, the challenge lies in selecting the right set of relevant test design techniques
for the particular application.
Software test design techniques can be broadly classified into two major categories:
1. Static techniques
2. Dynamic techniques
1. Static Test Design Techniques:
Cntd… Static testing refers to the testing of software manually or with the help of tools.
Static testing is usually carried out during the early phase of software development life cycle.
Static testing is useful for testing multiple aspects of a software, including source code, functional
and requirement specifications, and design documents and models.
Static testing can be further divided into two categories based upon whether it is performed
manually or with the help of tools.
Classes of Static Test Design Techniques:
2. Top Down-Test: Now that you know what you need to accomplish with your program, you
now need to knowhow you can accomplish it. The approach used to do that is called top-down
design and this simply means putting all the important main parts of the program in to a list.
Test Plans- Design guidelines
Test Plan :
A test plan is a detailed document that outlines the test strategy, Testing objectives, resources
(manpower, software, hardware) required for testing, test schedule, test estimation and test
deliverables.
The test plan serves as a blueprint to conduct software testing activities as a defined process which
is minutely monitored and controlled by the test manager.
Test Plan helps us determine the effort needed to validate the quality of the application under test
Help people outside the test team such as developers, business managers, customers understand the
details of testing.
Test Plan guides our thinking. It is like a rule book, which needs to be followed.
Important aspects like test estimation, test scope, test strategy are documented in Test Plan, so it
can be reviewed by Management Team and re-used for other projects.
Cntd…
How to write a Test Plan :