SWE Summary AW
SWE Summary AW
Software engineering.
• The process of taking an idea and turning it into a program.
• OR an organized, analytical approach to the design, development, use, and
maintenance of software.
SWE steps:
1) Requirement gathering.
• Finding out what the customer wants & needs.
4) Development.
• Programmers refine LLDs until they know how to implement them.
• They should also work on the previous steps (req gathering, HLD, LLD).
• They should test code as they write it.
5) Testing.
• Pieces might not work properly together.
• Programmers should test their own code.
• Testers should write code tests.
• Pieces that pass those tests can be integrated into the project.
• Testing should be done after each step of the development.
o Because ” The longer a bug stays undetected, the harder it’s fixed”.
Testing techniques:
• Exhaustive testing.
o Testing with every possible input.
• Black-box testing.
o You know what a method does, but not how.
• White-box testing.
o You know how a method works and you pick difficult test cases.
o Some people skip some important test cases.
• Gray-box testing.
o Combination of both (black & white).
6) Deployment.
Difficult, time-consuming, and expensive.
May involve:
• New computers for backend database.
• New network.
• New computers for the users.
• User training.
• Parallel use (using new & old system).
• Special data maintenance.
o To synchronize between old & new database.
• Massive bug fixing.
7) Maintenance.
• Fixing user discovered bugs.
• Adding user suggestions (enhancements).
8) Wrap-up.
• Evaluate the project.
o Figure what went wrong & right.
o Figure how to prevent the things that went wrong.
o Figure how to increase the occurrence of the things that went right.
E-mails:
• Create an email for your project.
• Every message should be copied to the email.
• Prefix your email about your project to make it easier to find.
• Add different classes to the email subject.
Project management.
Ensures the goals are set, tracked, and met.
Project management roles:
1) Executive support || sponsor (champion).
The Lack of a champion is one of the top reasons why software projects fail.
• Provides necessary resources (budgets, hardware, personnel).
• Makes “go/no-go” decisions.
• Decides when to cancel the project.
• Helps in navigating administrative obstacles.
• Defines the business case (evaluates benefits, cost, risk, etc.).
• Works with users & other stakeholders to persuade them to buy-in.
• Isolating the project from external distractions.
• Provides feedback to devs about finished features.
• Chooses between managers, users, devs, and others interested in the
project.
• Gives guidance on high-level issues.
2) Project manager.
• The highest-ranking member of the project team.
• Works on all stages of development.
• Doesn’t need to be an expert in the users’ field || in programming.
• Their duties:
o Helps define the project requirements.
o Tracks/monitors project tasks.
o Keeps users & champion up to date on the progress.
o Provides an interface between customers & devs.
o Manages resources (time, people, budget, hardware, software).
o Manages delivery of services/products.
o Responds to unexpected problems.
o Manages risk.
• You can add the start & finish tasks as a predecessor for any task (that
doesn’t have predecessors).
Critical path methods.
PERT charts are used to find the critical paths through the network.
Critical path: the longest possible paths through the network.
• moving through every node and finding the longest path.
• There can be multiple paths with the same length.
2) Gantt Charts.
• a horizontal bar chart.
o Bars represent task activities.
o Bars’ lengths indicate tasks duration.
o Bars are placed on a horizontally on a calendar to show their start &
stop times.
• Shows a schedule for a collection of related tasks.
• Arrows show the relationships between tasks & their predecessors.
• Weekends extend the project’s total duration.
Steps:
1- List the tasks, their duration, and predecessors (on the left).
4) Predicting times.
• Other methods depend on time estimated being accurate.
• Hardest part is predicting how long each task takes.
• Tasks are either:
o Short & well known.
o Long & highly uncertain.
o Importance.
▪ Can users live without this feature.
▪ Can you cancel this feature or add it later (update).
o Consequences.
▪ Will problems with this task affect other tasks.
o Solutions.
For each solution consider:
▪ Difficulty.
▪ Impact (does it affect usability || extra work for the users).
▪ Pros (advantages).
▪ Cons (disadvantages).
Chapter 2: requirement gathering.
Requirements: features that your app must provide.
• Used to verify that the finished app does what it’s supposed to.
Requirement properties.
• Clear.
o Needs to be clear, brief, easy to understand.
o Common abbreviations & terms are okay.
• Unambiguous.
o Avoid requirements that have more than one meaning.
• Consistent.
o Requirements can’t contradict each other.
o Requirement shouldn’t provide a lot of constraints.
o “Fast, good, cheap. Pick two”.
▪ Quick app with high quality & high cost (Fast & good & !cheap).
▪ Quick app with low quality & low cost (Fast & !good & cheap).
▪ High quality & low cost but takes long time ( !Fast & good & cheap).
o Rewrite older requirements if needed.
• Prioritized.
o Prioritize requirements with high cost as low priority.
o “Must” & “Should” features should be assigned costs.
MOSCOW method:
o Required features (M-Must).
▪ Could you remove the requirement?
▪ Will the app be usable without that feature?
▪ Will the users give bad reviews (0 || 1 stars)?
• Verifiable.
o Requirements must be limited & precisely defined to be verifiable.
o Requirements can’t be open ended.
o Words to avoid:
▪ Comparatives (faster, better, more, etc.) replaced with quantities.
▪ Imprecise adjectives (fast, robust, user-friendly, etc.).
▪ Vague commands (minimize, improve, etc.) replaced with numbers.
Requirement Categories.
Audience-oriented requirements.
• Focus on audiences & their different POVs.
Audiences:
• Business requirements.
o Lays the project’s high-level goals.
o Explains the customers’ hopes.
o Hopes might be too far-fetched.
• Non-functional requirements.
o Focuses on the quality of the app’s behavior.
o OR constraints on how it produces results.
o Specify:
▪ Application’s performance.
▪ Reliability.
▪ Security characteristics.
• Implementation requirements.
o Temporary features.
o Needed to transition to a new system (how to move from one system to
another).
o Hiring new people || training users.
FURPS.
• Functionality.
o What the application should do.
o Describe the system’s general features (What is does, how it interfaces
with other systems, Security).
• Usability.
o What the program should look like.
o Describe user-oriented features (app’s general appearance, ease of use,
navigation, responsiveness).
• Reliability.
o How reliable the system should be.
o Indicate when system is available, how often it can fail, how accurate is
the system.
• Performance.
o How efficient the system should be.
o Describe app speed, memory usage, disk usage, database capacity.
• Supportability.
o How easy it is to support the app.
o Include how easy it is to maintain, how easy to test the code, how
flexible is the app.
FURPS+.
An extended version of FURPS.
• Design constraints.
o Hardware platform.
o Software platform.
o Network characteristics.
o Database.
• Interface requirements.
o Constraints on the system’s interfaces (with other systems).
o Identify which other systems will exchange data with our system.
o Describe (interaction kinds, when interactions occur, data format).
• Physical requirements.
o Constraints on the hardware & physical devices.
Common requirements.
• Screens (what type is needed).
• Menus.
• Navigation (how the user navigates through different parts).
• Workflow (how does data move through the system).
• Login (how login info is stored & validated, password rules).
• User types (different privileges).
• Audit tracking & history (does the sys track who changed data).
• Archiving (archiving old data, moving data for analysis).
• Configuration/settings (config screens for admins).
Gathering requirements.
How to extract the requirements from the customers.
Techniques:
• Listen to customers (& users).
• Use Five Ws & H.
o Who will use the software.
o What the customer needs the app to do.
o When is the app needed.
o Where is the app used.
o Why the customers need the app.
o How does the customer want the app to function/look.
• Study cases.
o Studying users as they work to learn about their needs & how they
currently deal with those needs.
o Better than interviewing because the users will often leave/forget
important details.
o Withhold criticism.
▪ Criticism can make people stop contributing & bad ideas can lead to
better ideas.
Recording requirements.
• Requirements should be written as a sequence of English instructions.
User Stories.
• A short story explaining how the system will let the user do something.
Use Cases.
• A description of a series of interactions between actors.
• Actors can be users || application parts.
• Has a larger scope than a user story.
• Follow a template more than user stories.
• Use case template:
o Title: name of the goal (includes action name + main actor).
o Main success scenario: a sequence of steps describing the most normal
scenario to achieve goal.
o Extensions: sequence of steps describing other scenarios.
Prototypes.
• A mockup of some or all of the application.
• Gives the customer a feel of how the app will look like & how it will behave.
• Used to get text descriptions from the user (user stories || use cases).
• Different prototypes:
o Non-functional prototype.
▪ Elements (buttons, menus, etc.) don’t do anything.
o Functional prototype.
▪ Looks & acts close to how the finished app will.
o Throwaway prototype.
▪ Any prototype that starts from scratch.
o Evolutionary prototype.
▪ A prototype that starts with simple code & fake data that then get
replaced by quality code & real data.
▪ Eventually becomes the finished application.
Security:
• HLD should sketch all security needs.
• All forms of security interact with each other.
• Security needs:
o Operating system security.
▪ Login procedure type (password, pin, …).
▪ Password expiration policies.
▪ Password standards.
o Application security.
▪ Users should have the right access level.
▪ Some apps rely on the OS’s security.
o Data security.
▪ Make sure data doesn’t reach hackers (ex. credit card info).
o Network security.
▪ Protect data against cyber hackers.
o Physical security.
▪ Protect devices in case they are stolen.
Hardware.
• HLD specifies what hardware will be used.
• Hardware specifications:
o Printers.
o Network components.
o Servers.
o Specialized hardware (scales, microscopes, …).
o Audio & video hardware.
External interfaces.
• Easier to specify than internal interfaces.
o You don’t control both ends (you must meet the other end’s
requirements).
Architecture.
• The architecture describes how modules fit together.
• Some architectures attempt to simplify development.
Architecture types:
1) Monolithic.
• A single program does everything.
• Disadvantages:
o System pieces are tied closely together.
o Not flexible.
• Advantages:
o Doesn’t need complicated communication.
3) Component-based (CB).
• Used in component-based software engineering (CBSE).
• The system is a collection of loosely coupled components.
• Separates pieces of code (same as multi-tier client/server).
o All pieces are in the same program.
6) Event-driven (ED).
• Pieces respond to events as they occur.
7) Rule-based (RB).
• Uses a collection of rules to decide what to do next.
• Sometimes referred to as expert systems || knowledge-based systems.
• Needs the programmer to identify the necessary rules for each job.
• Has trouble handling unexpected situations.
8) Distributed.
• Pieces run on different processors & can run concurrently.
• Processors are on different computers on the same network.
o Processors can be different cores on a single computer.
• SO, CB, & multi-tier are often distributed.
• Disadvantages:
o Extremely confusing.
o Hard to debug.
o Processor competition (Race condition).
Reports.
• business apps might include reports (about costumers, products, users, …).
Other outputs.
• include:
o printouts.
o Webpages.
o Data files.
o Image files, Audio, Video.
o Output to special devices.
o Email or text messages.
Database.
• Decide what kind of database is needed & how data is going to be stored.
• Sketch out the tables for relational databases.
Database normalization:
• The process of decomposition (breaking tables into small tables & linking
them).
• Advantages:
o Avoids redundant data in tables.
o Ensures that separate tables data can be maintained & updated
separately.
o Facilitates a distributed database.
• Steps:
o Remove multiple value cells.
o Move repeating values into different tables.
o Create new tables to reduce redundancy.
Relationship types:
• One-to-one relationship:
o one record (table 1) is related to one record (table 2).
• One-to-many relationship:
o One record (table 1) is related to many records (table 2).
• Many-to-one relationship:
o Many records (table 1) are related to one record (table 2).
• Many-to-many relationship:
o Many records (table 1) are related to many records (table 2).
Database issues:
• Audit trails.
o Audit trail: keeps track of each user who modifies a record.
o Not needed in every application.
o Simple version:
▪ Create history table.
▪ Containing user’s name, link to the record, and the data.
o Advanced version:
▪ Stores copies of the original data in the original table.
▪ Might have notes section (to explain the changes).
• User access.
o Providing users with different access levels (to the data).
o Simple version:
▪ Create an access level table.
▪ List the users & their access levels.
o Some databases have it built in.
• Database maintenance.
o Removing old data (increases responsiveness).
o Re-indexing key tables (restores peak performance).
o Designing a database backup & recovery scheme.
o Move older data into a secondary database (improves responsiveness &
the data can be used for analysis).
Configuration data.
• Provide configuration screens to users.
• Reduces the need to write new code.
• Provide different access levels to these configurations.
Structure diagrams:
• Describes things/objects that will be in the system.
Types:
• Class diagram:
o Most basic structure diagram.
o Describes things/objects that make the system using classes, attributes,
methods, and relationships.
o Class: a collection of related properties.
▪ Class name is a noun.
o Objects: an instance of a class.
o Method: a routine that makes an object do something.
o Access modifiers symbols: a symbol that is used to represent access
modifiers.
o Relationships are represented using a line, an arrow, and a label.
▪ Label is a verb.
o Multiplicity: a number placed at both ends of a relationship
that indicates now many objects are involved in the
relationship.
o Can get complicated and devs separate it into different diagrams.
• Object diagram:
o Shows how objects interact with each other and what values they
contain at specific times.
• component diagram:
o Shows how components form larger parts of the system.
o Each component provides at least one interface.
▪ Used by other interfaces to interact with it.
o Complex components: components that include other
components.
o Components/symbols (go to page 76 for a full list):
▪ Structured classifier: represents a class.
▪ Part: represents a role played at runtime by one or more instances.
▪ Port: an interaction point used to connect classifiers with parts &
the environment.
▪ Connector: binds two or more entities together.
▪ Collaboration: more abstract than a classifier.
• composite diagram:
o Shows the class’s internal structure & the collabs that the
class allows.
• package diagram:
o Describes relationships among the system packages.
• deployment diagram:
o Describes the deployment of artifacts on nodes that can execute those
artifacts.
▪ Application artifacts (files, scripts, exe files, …).
▪ Framework artifacts.
• profile diagram:
o allows the designer to extend the basic UML notations
(adding labels & comments).
Behavior diagrams.
Activity diagram.
• Represents workflows for activities/tasks.
• Uses symbols & arrows to show the workflow.
Interaction diagrams.
• A subset of activity diagrams.
• Include:
o Sequence diagrams.
o Communication diagrams.
o Timing diagrams.
o Interaction overview diagrams.
Sequence diagram.
• Shows how objects/actors collab in a specific scenario.
o Includes the interactions & their order.
• Represents the collab as a series of messages.
• Focuses on the message sequence.
• Representation:
o Objects = rectangles.
o Actors = stick figures (with class name and/or actor name).
o Execution = white || gray rectangle on top of lifeline.
o Synchronous messages = arrows with solid heads.
o asynchronous messages = arrows with open heads.
o Return messages = dashed arrows with open heads.
• Lifeline: a vertical dashed line that shows the active time of objects.
• execution: represents the actor/object doing something.
Communication diagram.
• Shows the communications between objects during a collab.
• Focuses on the objects.
• Representation:
o Lines to connect objects.
o Messages = labeled arrows.
▪ Messages are numbered.
Timing diagram.
• Shows state changes of multiple objects over time.
• Looks Like the sequence diagram (rotate the sequence 45
degree).
• Gives a sense of how long objects in a scenario will take.
• Advanced versions show multiple objects stacked over each
other.
Interaction overview diagram.
• An activity diagram where nodes can
contain other diagrams.
• Shows more details for nodes with
complicated tasks.
Chapter 4: Low-Level Design (LLD).
• LLD focuses on how to implement what HLD specified.
• Provides more details to start implementation.
Object-oriented design.
• HLD specified the major classes, LLD identifies specific extra classes.
• New classes include properties, methods, and events (that they provide).
Defining new classes:
• Identifying classes.
o Look for nouns in feature descriptions.
o For each class think about:
▪ What info it needs (properties).
▪ What will it do (methods).
▪ Does it notify the system (events).
• Object composition.
o Using existing classes to build more complex classes.
▪ existing classes are attributes in the complex classes.
▪ Increases code reuse.
Database design.
• The most popular type is the relational database.
• Bad DB problems/anomalies:
o Duplicate data (waste space & slows updating).
o May be unable to delete some data without deleting another data
that’s unrelated.
o Some data require other data to be usable.
o DB may not allow multiple values when you need them.
• DB normalization: process of re-arranging a DB & using a standard form.
o Prevents anomalies.
• Normalization levels:
o First Normal Form (1NF) rules:
▪ Relational DBMS enforce them automatically.
▪ Each column must have a unique name & a single datatype.
▪ Each record must be unique.
▪ Each column must have a single value.
▪ Each table cell shouldn’t be null.