P4E Lecture 1 - Software Design(1) (2)
P4E Lecture 1 - Software Design(1) (2)
Programming for
Engineers
Lecture 1
Module introduction, become a
programmer
Dr James Whiting
Lecturer in Electronic Engineering
University of the West of England
Lecture topics
How the module is structured
Program design
• Pseudocode
• Flow charts
• Structure charts
Debugging/testing
Module introduction
Module Team:
Module Leader
Contact hours (labs and lectures): Self study hours: 114 hours
1hr Lecture + 2hr Lab Tutorial
Module introduction
Module Learning Outcomes:
MO1 Create appropriate software based solutions to a variety of mathematical and engineering
problems.
MO2 Develop and document computer code to meet appropriate codes of practice and industry
standards in relation to software development.
MO3 Apply fundamental programming principles and a system approach to the design, development and
testing phases of software development.
MO4 Use a variety of information sources including technical literature to inform software development
applications.
Module Assessment
Digital Logbook (Portfolio of Evidence) marks breakdown
Progress submission 1 (binary mark, 5%):– due 25th February 2pm (no grace period)
Expected submission, Lab Exercises 1 and 2.
Progress submission 2 (binary mark, 5%):– due 10th March 2pm (no grace period)
Expected submission, Lab Exercises 3 and 4
Logbook of exercises (scaled mark, 20%):- due 19th April (48 hour grace period
applies)
Expected submission, Lab Exercises 5, 6 and 7
Mini Coursework
Report, Development Log: 30% - due 2th May (48 hour grace period applies)
Oral Exam, Viva & Demo: 40% - To be scheduled in UWE Weeks 38 & 39
(between 6th and 17th May). Controlled conditions assessment.
• It is FAST!
Let’s start with software design
How do we begin Coding/Programming designing software?
• Most real-world software engineering design problems are complex and difficult to solve (e.g.
avionics, robot controllers, operating systems, communication systems).
i.e. break down the complex system into components (modular decomposition), solve
each one separately and then integrate the components.
Software need
Benefits?
Combined solution
Software design
Benefits:
• Distributed development
• Module/Code reusability
• Maintainability –Easier to locate and fix bugs –Easier to make changes to one module without
affecting other modules
• Improved robustness
Key issues in modular Software design
Abstraction
A technique for managing complexity of software systems. Used to hide certain details and only
show the essential features of modules.
• abstract entity: module is described by what it does and what its interfaces are (and not its
implementation)
Information Hiding
• Module hides the internal details of its data and processing activities
• Modules limit access to internal data only to internal operations that need it. Communication
occurs only through well-defined interfaces.
Key issues in modular Software design
Coupling
Coupling should be minimised i.e. modules should be independent of each other making it easier to
• Reuse module
• Test module
Cohesion:
The degree to which all elements of a component (module) are directed towards a single
task
and all elements directed towards that task are contained in a single component.
• High cohesion makes modules easier to use and makes the entire program easier to understand
Further reading:
https://www.geeksforgeeks.org/software-engineering-coupling-and-cohesion/
Top Down design
Break down a complex problem into subproblems to develop solutions.
• In attempting to solve a subproblem at one level, introduce new subproblems at lower levels.
• The process proceeds from the origin problem at the top level to the subproblems at each lower
level.
Process
I/O
Terminal
Decision
State Transition Diagrams
• A state transition diagram is a technique to depict
1. The states of an entity
2. The transitions of states of the entity
3. The events that cause the transitions of states of the entity
• In principle the entity could be
1. a physical device such as a light switch or button
2. a software system or component such as a communications system or an
operating system
3. a more complicated machine such as a robot
• The generic name for such an entity is a Finite State
Machine (FSM)
State Transition Diagrams
• States are usually represented as labelled circles, boxes etc.
(according to design notation in use).
• Transitions are represented as directed lines or arcs.
• Events are represented as line/arc labels. e.g.
State Transition Diagrams – Phone call example
States:
Idle, Dialling, Ringing,
Remote End
Ringing,
Connected.
Events:
Pick-Up, Incoming Call,
Receive Ring Tone,
Remote End Answers,
Hang Up.
https://www.onlinegdb.com/online_c_compiler
Optional
Test Execution Provide instructions on how to execute the test
Test Dependencies List any dependencies or external factors that may impact the test
Test Environment Specify the environment in which the test will be conducted, including software versions, hardware, etc.
Software Design
We have learned about: