0% found this document useful (0 votes)
8 views31 pages

Detailed Design

The document outlines key concepts in software engineering, focusing on detailed design, algorithms, data structures, and design verification and validation. It emphasizes the importance of creating detailed design specifications, efficient algorithms, and appropriate data structures for effective software development. Additionally, it discusses the processes of design verification and validation to ensure that software meets its requirements and specifications.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views31 pages

Detailed Design

The document outlines key concepts in software engineering, focusing on detailed design, algorithms, data structures, and design verification and validation. It emphasizes the importance of creating detailed design specifications, efficient algorithms, and appropriate data structures for effective software development. Additionally, it discusses the processes of design verification and validation to ensure that software meets its requirements and specifications.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 31

Software Engineering for

Business
Algorithms
Data structures
Design Verification and Validation
Design Documentation
Detailed Design
• A detailed design is the complete specification of the
software and hardware components.
• It defines how the components will be developed to meet
the requirements.
• A detailed design document may include flowcharts, ER
diagrams, database tables, interface definitions etc.
Detailed Design
• Detailed design activities include
- creating a prototype user interface which helps developers and users to visualize the
interface before system development.
- developing detailed hardware and software component specification showing the
hardware, software and connectivity requirements to support the application e.g.
• amount of memory (16 GB RAM)
• processing power (Intel Core i3, 2.5 GHz)
• Storage (8 GB HD available space)
• Operating system (Windows 10, 64 bit)
• Web browser (Microsoft Edge)
• Protocols supported (TCP/IP, FTP, HTTP/HTTPS)
• Internet (Wi-Fi connection required for updates)
• Etc.
Algorithms
• The software specification includes algorithms, data structures.
• An algorithm is a step-by-step procedure for solving a problem.
• A set of well-defined instructions for performing a specific task.
• Algorithms are used to automate and solve complex tasks
• Data science: analyze and extract information from large amounts
of data
• Maths: solve linear equations
• AI: develop intelligent systems that perform tasks like image
recognition, voice recognition
Examples of Algorithms
• Cake recipe
• Finding the nearest restaurant
• Searching for articles on Software Engineering since 2020 up to
date
• Sorting a list of BBC students by CGPA
• Making weather predictions
• Analyzing the relationship between age and social media usage
• Etc.
Characteristics of an Algorithm
• Clear: Each step should be clear and have only one meaning
• Finete-ness: Should terminate after a finite time
• Feasible: Simple and practical
• Language independent: Written in plain instructions that can
be implemented in any programming language
• Input: Accept zero or more inputs
• Output: Should produce at least one output
• Effective: Each step should carry out some work
Example: Add two numbers and
Designing an Algorithm print the sum
1. The problem: Add two
1. Identify the problem to numbers and print the sum
be solved 2. Constraints: The numbers
must be digits not other
2. Identify constraints characters
3. Identify input required 3. Input: Two numbers
4. Identify output expected 4. Output: Sum of two numbers
5. Provide solution to the 5. Adding two numbers
problem
Designing an Algorithm
Step 1: Start
Step 2: Declare three integer variables num1, num2, sum
Step 3: Take the two numbers to be added as input
Step 4: Add the two numbers and store the result in the variable sum
Step 5: Print the value of the variable sum
Step 6: Stop
_____________________________________________________
Test the algorithm
Expressing an Algorithm – Flowcharts and
Pseudocode
• A flowchart is a graphical representation of an a algorithm.
• Easy to understand
• Difficult to present complex tasks
• Pseudocode expresses an algorithm in the form of informal text
written in plain English
• Easy to understand
START Start
Input Input Name
Name Output Hello Name
Output Hello End
Name

STOP
Expressing an Algorithm
Start
START
Declare num1, num2, sum
Read num1, num2
Read num1
Read num2
sum = num1 + num2 sum = num1 + num2
Print sum
Print sum Stop

Stop
Expressing an Algorithm
START
• Enter input of a salary, if
Enter salary
the salary is greater than
100,000 add a bonus of
5000 otherwise add bonus Salary>100,000 N Salary = salary + 2000
of 2000.
Y
Salary = salary + 5000

Output
salary

END
Expressing an Algorithm
• Enter input of a salary, if Start
the salary is greater than Enter salary
100,000 add a bonus of
5000 otherwise add bonus If salary > 100,000 then
of 2000. salary = salary + 5000
else
salary = salary + 2000
Output salary
Stop
Expressing an Algorithm - Practice
1. Write an algorithm for logging into your mubsep
account
2. Input a number and print prime or not prime
3. Draw flowcharts and pseudocode for the algorithms
Types of Algorithms
• Common types of algorithms include;
• Sorting Algorithms: Arrange elements in a specific order such as
numerical or alphabetical.
• Searching Algorithms: Find the position of an element in a collection
of data.
• Graph Algorithms: Solve problems related to graphs.
• Dynamic Programming: Solve complex problems by breaking them
down into simpler sub-problems.
Efficiency of an Algorithm
• If a program uses less CPU time and memory, it is efficient.
• Complexity of an algorithm refers to the measure of the time
that will be needed to execute to get the expected output
and the space required to store all the data.
• Time factor is measured by counting number of operations
e.g. arithmetic operations, if-else, loops, initialization
• Space factor is measured by counting the maximum memory
space required for the algorithm to run to completion.
Efficiency of an Algorithm
• Time complexity: Estimation of total CPU computations required
to execute algorithm. It is measured by counting the number of
times an instruction is executed referred to as frequency count
• Estimating time complexity
• Constant time part: Includes any instruction that is executed just
one e.g. input, output, if-else, switch, arithmetic operations
• Variable time part: Any instruction that is executed more than one
e.g. loops
Efficiency of an Algorithm
• Space complexity: Estimation of main memory space required to
execute an algorithm. Space to store source code, simple
variables, data structures used, recursive algorithms
• Estimating space complexity
• Fixed part: Space required for input and output variables,
constants
• Variable part: Space can be different based on the
implementation of algorithm. Used for temporary variables,
data structures
Data Structures
• Data structure provide a way of organizing and storing data in a
computer. Data is stored depending on the type of data and what is
needed to do with the data.
• Used to categorize and access data quickly and easily.
• Using the appropriate data structure helps develop efficient programs
in terms of execution time and memory usage.
• Enables design of algorithms that can handle large amounts of data.
• Choosing the right data structure involves considering the type and
volume of data, the desired operations and expected performance.
Data Structures
• Primitive data structures: Basic data structures provided by
programming languages to represent single values such as
integers, floating point numbers, Booleans, characters
• Abstract data structures: These are used to store large
amounts of data and provide complex operations e.g. arrays,
linked lists, stacks, queues, hash tables, trees and graphs
Abstract Data Structures
• Array: A collection of elements accessed using indexes.
Elements are stored in contiguous memory locations making
searching for elements in an array easy. However, it is harder
to insert or delete elements in an array.

1 2 3 4 Elements

0 1 2 3 indexes
Abstract Data Structures
• Linked list: Contains a pointer to the address of the next
element in the list.
• Faster at inserting and deleting elements
• To read from a linked list, you have to search from the
beginning making data access slower.
20 21 100 101
1 100 2 290
Abstract Data Structures
• Hash tables: Similar to arrays but instead uses keys to read
elements.
• Each value is paired with a key to identify and search
elements easily.
Kampala Nairobi Kigali

“Uganda” “Kenya” “Rwanda” keys


Abstract Data Structures
• Stack: Adds data on top of the pile and accesses it in the order of
Last-In-First-Out (LIFO). Fast for reading, adding and deleting
data.
• Queue: Elements are added at the back of the line and accessed
or removed from the front. Applies First-In-First-Out. For
example in a YouTube mix list, you will first watch the first video
in the list
Abstract Data Structures
• Trees: Hierarchical data structure with a root node and child
nodes. Easy to search data by eliminating values until the
desired element is found e.g. in a guessing game
• Graphs: Nodes can be connected to many nodes. Edges can
be weighted to help estimate closest path between points.
10
4 B 2
C A
5 5 12
3 1
D Tree
Graph 1 15
Applications of Data Structures
• Hash tables can be used in a web server to store frequently
requested webpages in cache so that the pages are quickly
accessed.
• Graphs are used to determine the shortest route between a
rider and customer on a SafeBoda App.
• Binary search trees are used when finding a specific record
based on a unique identifier in a guessing game.
• Priority queues are used in Oss to schedule high priority
tasks like sorting, searching, updating data to run quickly.
Benefits of DSA in System Design
• Efficient retrieval and storage of data: DSA helps to choose
appropriate data structures to ensure easy access to data
• Improved time complexity: Ensures tasks are executed quickly
• Scalability: Using appropriate DSA enable growth of data without
decreasing performance of application
• Resource optimization: DSA ensures resources like CPU time and
memory are well utilized. E.g. Choosing the right data structure
lowers memory required
• Maintainability: Well designed algorithms make code easy to
modify
Design Verification and Validation
• These processes ensure that a product meets its specifications and
intended use.
• Verification confirms that the design is correct i.e. has been created
following principles a good design. Used to check non-functional
requirements
• Validation confirms that the design meets all customer needs. Checks
functional requirements
• During design V and V, design reviews are done to discuss the design,
find faults and encourage communication in order to improve the
design.
Design Verification and Validation
• Preliminary design review is carried out to validate conceptual
framework and UI design. Involves customers, analysts and
designers
• Critical design review validates the technical design checking if
all proposed requirements have been implemented and to justify
design decisions. Involves analysts, system designers and code
designers
• Code design review checks whether algorithms represent the
tasks defined. Involves analysts, designers and developers
Design Verification and Validation
• The techniques below can be used to help identify improve a
design before implementation.
• Reducing complexity by changing the design structure without altering
functionality e.g. improving UI design
• Using throwaway prototyping to identify faults and address concerns in a
design
• Fault tree analysis is designed to show logical paths from cause to effect to
analyze situations that may cause failure e.g.
C1- username, C2- password C1 E1
E1 – access granted, E2- Access denied
c2
Design Documentation
• This is a set of documents describing the system comprising of
the conceptual and technical designs.
• It also contains the justifications for design decisions that were
taken e.g. the choice architectural patterns, UI design patterns
etc.

You might also like