Software Engineering Notes1,2,6,8, Videos
Software Engineering Notes1,2,6,8, Videos
Chatgpt notes:
● A comprehensive plan is created before any coding begins.
● The project manager defines all phases—requirements, design, implementation,
testing, and maintenance.
● Detailed documentation is produced for each phase of the development lifecycle.
● Progress is measured strictly against the predefined plan.
● Any changes to the project (e.g., scope or requirements) must be:
● Updated in the documentation.
● Possibly reflected in a revised plan.
● Emphasizes predictability, control, and traceability in development.
● Suitable for projects with well-defined requirements and low tolerance for change
(e.g., defense, aerospace, regulated industries).
Powerpoint notes:
● Before coding, project manager makes plan
● Write detailed documentation all phases of plan
● Progress measured against the plan
● Changes to project must be reflected in documentation and possibly to plan
1. WaterFall:
2. Spiral:
3. RUP:
1. Inception
2. Elaboration
3. Construction
4. Transition
● Business Modeling
● Requirements Engineering
● Analysis and Design
● Implementation
● Testing
● Deployment
Development Processes:
• Waterfall
• Agile
▪ Agile has become so broad that it is generally clarified into subcategories including:
• Scrum
• Kanban
1. Agile:
"That is, while there is value in the items on the right, we value the items on the left
more."
○ Customer requirements are captured as User Stories, which are simple, informal
descriptions of software features from the user’s perspective.
○ User Stories validate whether customer needs are being met throughout
development.
○ Tests are written before code to prevent mistakes and ensure functionality.
○ Early error detection ensures that the software meets requirements from the
start.
3. Velocity
○ Velocity measures how much work the team can handle in each iteration, helping
to gauge progress.
○ Provides insight into team capacity and helps predict future work.
○ Continuous interaction with the customer during each iteration ensures the
software is aligned with their expectations and needs.
Advantages of Agile
Challenges of Agile
1. Silo:
Silo – Definition
● A silo is a separate subsystem within a larger system that operates independently from
other subsystems.
● It often leads to separation of data and processes within a system or organization.
● Subsystems in a siloed architecture typically don’t easily share data unless explicitly
designed to interact.
● Internal subsystems can share data directly: While silos imply separation, subsystems
can still interact through shared data or APIs.
● Access to user profiles: Each subsystem, like Review or Buying, might manage user
profile data independently but can still reference or access shared information.
SOA – Definition
● Independent Subsystems: Services like Review Service, User Profile Service, and
Buying Service operate independently but interact through APIs.
● Interoperability: Services can be hosted in different datacenters and still communicate
through APIs, ensuring data sharing across different environments.
For example:
● Review Service accesses the User Service API to retrieve user information for reviews.
● Buying Service interacts with Credit Card Processing Service to handle payments.
Advantages of SOA
● Silo
Key Differences:
● Data Sharing: Siloed systems might not share data easily without additional integration.
In SOA, sharing data between services is a core feature, enabled by standardized
communication protocols.
● No installation worries: Users don't have to worry about hardware capability, operating
system, or device compatibility. SaaS works on any device with internet access.
● Data storage: Data is safely and persistently stored on centralized servers, reducing the
risk of data loss.
● Simplified collaboration: Groups can easily interact with the same data, which is
stored centrally, without worrying about local versions.
● Centralized updates: Developers only need to maintain one copy of the software in a
single environment. This eliminates compatibility issues and simplifies upgrades.
○ Beta testing can be done on a small percentage of users, allowing developers to
test new features without disrupting the whole user base.
○ Users no longer need to request upgrades or worry about compatibility with new
versions.
● No compatibility issues: With SaaS, developers don't have to worry about ensuring the
software works across multiple hardware, OS, or library versions.
● Centralized data: It’s easier to manage and maintain one copy of the software and data
in a central location, ensuring consistency for all users.
● Simplified upgrades: With SaaS, software is updated in the cloud, so users don’t need to
install new versions or worry about manual updates.
● Pros:
○ Can utilize hardware features not available in web apps (e.g., camera, sensors).
○ Performance can be superior in some cases (though many native apps are simply
containers for web-based applications).
○ The app appears directly on the user's home screen, providing easy access.
● Cons:
○ Harder to maintain: Native apps need to be updated frequently, and upgrades
become the user's responsibility.
○ Compatibility issues: Native apps require updates for each OS version and
device, making maintenance complex.
● Easier to maintain: With SaaS, users don’t need to worry about updates or installation.
The latest version is always accessible from the web.
● No compatibility issues: As SaaS is web-based, there’s no need for separate versions for
different operating systems or devices.
1. Communication
2. Scalability
◦ Fluctuations in demand
3. Dependability
Services on Clusters
Clusters: Commodity computers connected by commodity Ethernet switches
Cloud Computing:
● Services on Clusters:
■ Microsoft Azure
● Scalability: Offers infinite scalability, with users able to adjust resources as needed.
● Cost Efficiency: Provides cost-effective solutions by using commodity hardware and
clustering, reducing costs significantly (up to 20x cheaper than traditional setups).
● Redundancy & Reliability: Built-in redundancy ensures high reliability with minimal
risk of downtime or failure.
● On-Demand Access: Users can access resources on an on-demand basis without
worrying about hardware investments.
Legacy Software
● Legacy Software refers to older software that still meets customer needs but is often
difficult to evolve or maintain due to its design inelegance or the use of outdated
technology.
● Common characteristics:
Beautiful Software
● Common characteristics:
○ Tested and validated: Beautiful software is verified (tested for functionality) and
validated (in production and meeting real-world needs).
○ Evolvable: Easy to modify, improve, and extend over time, allowing for
continuous improvement without the need for major rewrites.
○ Designed with clean code principles, following best practices for software
design, structure, and readability.
○ Focus on decoupling the user interface (UI) and business logic from legacy
systems.
○ Gradually replace or modernize the business logic and other parts of the code as
needed without completely rewriting the entire system.
Ease of Evolution Difficult to evolve and maintain Easy to modify and extend
Maintenance High (60% for new features, 17% Low (efficiency and scalability)
Cost for bugs)
Focus Meets customer needs, but hard to Meets customer needs and is
update flexible
Rewrite Extremely difficult and costly New features can be added with
Difficulty minimal risk
Software Quality Assurance: Testing
● Software Quality Assurance (QA) refers to the processes, standards, and activities that
ensure the quality of the software product and its development lifecycle.
○ Goal: Improve the quality of the product and ensure that it meets customer needs
and requirements.
○ Key Focus Areas:
● Software Quality:
○ Defined as the fitness for use, meaning the product must meet business needs, be
easy to use, get correct results, and remain stable without crashing.
○ Software Quality Assurance aims to:
■ Ensure products meet customer needs (easy to use, reliable, and correct).
■ Make it easy for developers to debug, maintain, and enhance the software.
● Testing is a critical part of the software development lifecycle, ensuring that the software
functions as expected and meets the specified requirements. Since exhaustive testing is
often impractical, testing is performed at different stages to optimize coverage.
Types of Testing:
● Automated Testing:
● Performance Testing:
Objective Ensure high-quality software and Validate the functionality and reliability
improve processes of the software
Focus Product meets customer needs; Conduct tests at various stages (unit,
easy to debug and enhance integration, system, etc.)
Verification Did we build the thing right Ensures correct implementation and
(based on specifications)? behavior of individual components
Validation Did we build the right thing Ensures the software meets real-world
(based on customer needs)? business and user needs
Productivity
○ Over the decades, Moore's Law has driven hardware advancements, increasing
performance by doubling processor speeds and memory capacities approximately
every 18 months.
○ As hardware improved, software designs grew larger and more complex,
necessitating innovations to boost software productivity.
○ Techniques to improve software productivity include:
Conciseness
○ Common tools:
■ Example: Excel 2013 Flash Fill, which learns patterns from user input to
automatically fill in the data.
Reuse
● Reuse focuses on leveraging existing code to minimize the need for developing new
solutions, improving efficiency and maintainability.
○ Types of Reuse:
4. Design patterns: Reuse general strategies for solving problems, even if
the implementation varies.
○ The key idea is that every piece of knowledge in a system should have one,
unambiguous, authoritative representation.
○ Refactoring code to extract commonalities helps in avoiding repetitive code,
making it easier to maintain and extend.
● Tools and Automation in software development help replace repetitive manual tasks
with automated systems that improve efficiency and accuracy.
○ Examples:
Per topic, will practice Agile way to learn but will also see Plan and Document perspective
◦ Note: you will see new lifecycles in response to new opportunities in your career, so expect to
learn new
ones
Waterfall vs Iterative vs Agile
◦ Large teams
However, with software development lifecycle improvements like Scaled Agile (SAFe) it is
often still viable/beneficial to choose Agile over Iterative or Waterfall.
Service Oriented Architecture makes it easy to reuse current code to create new apps
Scale led to savings/CPU => reduced cost of Cloud Computing => Utility Computing
Testing to assure software quality, which means good for customer and developer
Scrum
○ Daily Standups: Short daily meetings to share progress, blockers, and plans.
○ Continuous Improvement: Ongoing effort to enhance team processes and
outcomes.
○ Retrospectives: Meetings at the end of each sprint to reflect and identify
improvements.
Scaled Agile Framework (SAFe)
● SAFe (Scaled Agile Framework) is a methodology designed to scale Scrum and Agile
practices across large organizations and complex projects.
● It provides structure to coordinate multiple Agile teams, align goals, and ensure
continuous delivery across the organization.
XP & Agile:
Extreme Programming (often referred to as simply “XP”) has become a common term that
describes Agile engineering practices including:
▪ Coding standards
▪ Pair programming
Slide set 2:
● Client:
● Server:
Supporting Systems
● Client-Server:
● Peer-to-Peer (P2P):
Design Patterns
IP (Internet Protocol)
Cookies
● HTTP is stateless, so cookies were introduced to preserve per-user state across requests.
● Cookies store small amounts of data on the client and are sent with every request.
● Handled automatically by frameworks like Rails using tamper-evident techniques.
Uses of Cookies:
Element Syntax:
● CSS is used to separate content from presentation, enabling cleaner HTML and
centralized styling.
CSS Selectors:
● Used to apply styles to specific HTML elements.
Examples:
○ By tag name: h1
○ By class: .pageFrame
○ By id: #pageHead
○ Combined: div.pageFrame, img#welcome
○ Descendant: div .custName (any .custName inside a div)
Rules:
Best Practices:
We will be focusing on the JavaScript / Express / Node.js combination with the possible addition
of Bootstrap and TypeScript. The cloud hosting service used is Microsoft Azure.
Web 1.0 SaaS (Software as a Service) – Sites That Are Really Programs
SaaS websites are web applications that run server-side programs in response to user
requests, rather than just serving static content.
● Frameworks like Ruby on Rails automate and abstract common SaaS tasks using:
○ Rack (middleware)
○ Adapters for databases (e.g., SQLite, MySQL)
○ Webrick/Thin servers for local or light deployment
○ Apache with mod_rails for production
Deployment Environments
● Sharding:
○ Data is split across different servers based on criteria (e.g., users A–J, K–R).
○ Pros: Highly scalable.
○ Cons: Complex for operations involving multiple shards.
● Replication:
● Relies on client-server model, HTTP, HTML/CSS, and cookies for session handling.
◦ In SaaS, most URI's cause a program to be run, rather than a static file to be fetched
◦ That's why some sites don't work if cookies are completely disabled
Frameworks make all these abstractions convenient for programmers to use, without sweating
the details
Core Components
● Model
● View
● Controller
● Movie → Model
● MoviesController → Controller
● movies/show.html.erb → View
● Structure is repeated for each entity: Moviegoers, Reviews, etc.
Alternatives to MVC
● Represents models (like Movie) as Ruby objects that map to database tables.
● Each row = one object, and each column = one attribute (e.g., name, rating).
CRUD Operations
◦ Each row has unique value for primary key (by convention, in Rails this is an
integer and is called id)
● The schema is the structure of all tables and columns in the database.
Example: /movies/3 is a URI that identifies a movie resource, and the HTTP method
determines what action is taken (e.g., GET for retrieving, POST for creating).
Controllers in MVC
● Controllers handle user requests, interact with models, and render views.
● Each controller action corresponds to a user interaction.
○ Action: A Ruby method in the controller that processes the user's request.
Routers in Rails
● RESTful Design: Focuses on resources and operations (GET, POST, PUT, DELETE)
using URIs.
● Routers: Define mappings between HTTP methods, URIs, and controller actions.
● Rails automatically generates RESTful routes for resources with the resources
method in routes.rb.
HAML is a markup language used to cleanly and efficiently write HTML code. It serves as a
replacement for traditional HTML syntax.
HAML simplifies the writing of HTML templates by reducing the amount of boilerplate code
and using indentation instead of closing tags.
Summary: Architecture and Rails
Views are Haml w/embedded Ruby code, transformed to HTML when sent to browser
Controllers tie views and models together via routes and code in controller methods
Slide set 6:
6.1 Introduction
● JavaScript is a core web technology used alongside HTML and CSS to create dynamic,
interactive client-side web applications.
● Client-Side Scripting: Runs on the user's browser, enabling dynamic behavior like form
validation, animations, interactive UI, etc.
● Interactivity: JavaScript is responsible for making web pages interactive, enabling things
like dropdowns, buttons, and pop-ups.
● Ruby developers can easily transition to JavaScript since both are high-level, interpreted
languages.
● Syntax Differences: JavaScript has some syntactic differences compared to Ruby, such
as using var, let, or const for variable declaration, and curly braces {} for blocks
and functions instead of do/end in Ruby.
● Dynamic Typing: Like Ruby, JavaScript is dynamically typed, which means variables do
not require explicit type declaration.
● Functions: JavaScript functions are blocks of code designed to perform a specific task
when called.
Example:
javascript
CopyEdit
function greet(name) {
return "Hello, " + name;
}
greet("Alice"); // Output: Hello, Alice
○
● Constructors: Functions that are used to create objects in JavaScript.
Example:
javascript
CopyEdit
function Person(name, age) {
this.name = name;
this.age = age;
}
let person1 = new Person("John", 25);
○
● DOM: The DOM represents the HTML structure of a page as a tree of objects, where
each node is an element or attribute in the HTML document.
● DOM Manipulation: JavaScript can interact with and manipulate the DOM to
dynamically change the content and structure of a page.
Example:
javascript
CopyEdit
document.getElementById("myElement").innerHTML = "New content!";
○
● jQuery: A JavaScript library that simplifies DOM manipulation, AJAX requests, and
event handling.
Example:
javascript
CopyEdit
$("#myElement").hide();
○
● Events: Events represent user interactions like clicks, key presses, or mouse movements
that JavaScript can listen for and respond to.
Example:
javascript
CopyEdit
document.getElementById("myButton").onclick = function() {
alert("Button clicked!");
}
○
● Callbacks: Functions passed as arguments to other functions that are executed once a
task is complete.
Example:
javascript
CopyEdit
function fetchData(callback) {
setTimeout(() => {
console.log("Data fetched");
callback();
}, 1000);
}
fetchData(function() {
console.log("Callback executed!");
});
○
● AJAX enables web pages to fetch data from a server asynchronously, without reloading
the entire page.
● Typically used to create dynamic web applications like single-page apps.
Example:
javascript
CopyEdit
const xhr = new XMLHttpRequest();
xhr.open("GET", "data.json", true);
xhr.onload = function() {
if (xhr.status === 200) {
console.log(xhr.responseText);
}
};
xhr.send();
○
6.7 Testing JavaScript and AJAX
○ Tools like Jest, Mocha, or Jasmine are commonly used for unit testing
JavaScript code.
●
● Testing AJAX: Test AJAX requests by mocking server responses using tools like Jest or
Sinon to ensure that AJAX calls are made and handled correctly.
● Single-Page Applications (SPA): SPAs load a single HTML page and dynamically
update content as the user interacts with the app, using AJAX to request data.
● JSON APIs: SPAs typically communicate with the server via JSON APIs, fetching data
asynchronously and updating the page without full reloads.
○
● JavaScript Pitfalls:
○ Global Variables: Too many global variables can lead to naming conflicts and
unexpected behavior.
○ Asynchronous Issues: Managing asynchronous code with callbacks or promises
can be challenging.
○ Type Coercion: JavaScript can automatically convert types, which may lead to
unexpected results (e.g., "5" - 2 results in 3).
● Best Practices:
○ Use let and const instead of var to limit scope and avoid unintended global
variables.
○ Handle asynchronous operations carefully using Promises or async/await.
● JavaScript is a powerful and essential language for developing dynamic client-side web
applications.
● Mastery of concepts like the DOM, AJAX, events, and callback functions is crucial for
building interactive web pages.
● Best practices like modularization, asynchronous handling, and testing are important for
writing clean, maintainable JavaScript code.
Slide set 7: Behavioral driven design and user stories
● Collaboration-Focused:
Encourages active collaboration among developers, QA engineers, and business
stakeholders.
● Executable Specifications:
These behavior descriptions double as automated tests, ensuring the system behaves as
expected.
User Stories
● Definition: Short, simple descriptions of a feature told from the perspective of the user.
● Format:
"As a [type of user], I want [some goal] so that [some
reason]."
● Story Points:
A unit of measure for expressing the effort required to implement a user story (not
time-based).
● Velocity:
The number of story points a team can complete in a sprint; used for capacity planning.
● Pivotal Tracker:
A project management tool used to:
○ Use Case Points and Function Points are more traditional sizing techniques
(used in Waterfall or early project estimation).
Story Points
● Not exact time—just a relative size (like saying “this task is twice as hard as that one”).
● Based on use cases (scenarios of how users interact with the system).
● Counts how many actors and actions there are, and how complex they are.
Function Points
2. SMART Stories improve clarity and effectiveness, ensuring that teams understand
what’s being asked and how to deliver it.
○ Should be considered early in the design and planning process to maximize user
satisfaction.
Slide set 8:
Definition:
Test-Driven Development (TDD) is a software development approach where you write tests
before writing the code that fulfills those tests. The cycle follows three key phases:
3. Refactor: Improve the design of the code without changing its functionality while
ensuring it still passes the test.
TDD helps ensure that the software works as expected, and provides a foundation for easy
refactoring and ongoing development.
● Verification: Ensures the software was built according to the specifications and is
functioning as expected.
● Validation: Ensures that the software meets the user's or customer's needs.
● Early detection of defects is significantly cheaper than fixing defects later in the
development lifecycle. The further a defect goes without being discovered, the more
expensive and time-consuming it becomes to resolve.
The triangle represents the three key components of successful software development:
1. People & Organizations: Focus on collaboration, roles, and organizational culture.
2. Process & Roles: Clear and efficient processes, methodologies, and role definitions.
3. Technology & Tools: The tools and technologies used to develop and test the software.
Balance across these three components is critical for achieving high-quality software.
Software Testing
● Goal: The objective of testing should not just be "better testing," but rather avoiding
defects in the first place. Once defects occur, it’s important to identify and fix them as
quickly as possible.
● FIRST Principles: These principles guide TDD practices to ensure that tests are
effective:
1. Fast: Tests should be fast to run, allowing for quick feedback.
2. Isolated: Tests should be independent of each other, allowing for pinpointing
defects.
3. Repeatable: Tests should produce consistent results when run repeatedly.
● Red-Green-Refactor Cycle:
1. Red: Write a test that fails (as the feature or functionality isn't implemented yet).
2. Green: Write the minimum code to make the test pass.
3. Refactor: Clean up the code while keeping the test passing.
8.3 Seams, Doubles, and the Code You Wish You Had
● Seams: Points in your code where you can modify or replace functionality, often used for
testing purposes.
● Doubles: Test doubles are objects that stand in for real objects during testing (e.g.,
mocks, stubs).
The goal is to design your code to have "seams" where testing and modification are easy. It helps
in isolating parts of the system to make testing more manageable.
8.4 Expectations, Mocks, Stubs, and Example Setup & Teardown
● Expectations: Describes how an object should behave during a test (e.g., method calls).
● Mocks: Simulated objects that mimic real objects in tests, often used to verify if certain
methods were called.
● Stubs: Pre-programmed responses to method calls, often used to control a particular
scenario during testing.
Setup & Teardown: Preparing the test environment before each test and cleaning it up afterward
to maintain consistency.
● Fixtures: Predefined data that is loaded into the test environment before running the
tests. It helps in creating a consistent starting state for tests.
● Factories: Functions or methods that generate test data dynamically, often used to create
different variations of test objects.
● Implicit Requirements: Assumptions that are made during development but may not be
explicitly documented. These assumptions should be validated through testing.
● Stubbing the Internet: Using mock objects or services to simulate interactions with
external systems, like web services or APIs, during tests.
● Coverage: Measures how much of the code is tested by the tests. It helps identify
untested parts of the codebase.
Both testing types are important, as unit tests ensure the functionality of individual pieces, and
integration tests ensure that those pieces work together.
● Static Analysis: Analyzing code for potential issues without executing it.
● End-to-End Testing: Testing the entire application flow, from user input to final output.
● Performance Testing: Testing how well the system performs under load or stress.
Other terms include mock testing, regression testing, and exploratory testing.
● This approach emphasizes detailed upfront planning and documentation of tests, which
can sometimes create a disconnect between developers and the actual needs of the
system.
In contrast to TDD, this approach tends to create more rigid test plans and can sometimes result
in tests that aren't as relevant or adaptable.
Final Thoughts:
○ Web services and APIs should be tested for both functionality and reliability.
Mocking and stubbing techniques are commonly used for testing APIs.
2. Test Data:
○ Use consistent test data to ensure your tests are repeatable and reliable.
○ Automated tests can be a time-saver, but false positives can still occur. It’s
crucial to make sure the test environment is set up correctly.
4. Logging:
○ Proper logging during testing helps to capture the necessary information for
debugging failed tests.
○ TDD is not a rigid methodology, but rather a spectrum. It can evolve depending
on the project and the team, adapting to the development flow as needed.
Slide set : Software Maintenance and Support
Definition:
Software maintenance is the process of modifying and updating software applications after
delivery to correct faults, improve performance or other attributes, or adapt to a changed
environment. It ensures that software continues to meet user needs and performs efficiently over
time.
1. Software Enhancements
● What it means: Adding new features or improving existing ones based on user feedback,
market demands, or business needs.
● Activities involved:
○ Planning: Identify enhancement goals and align them with business objectives.
○ Estimating: Evaluate the time, resources, and cost required to implement
enhancements.
○ Prioritizing: Rank tasks based on importance, urgency, and impact.
2. Re-engineering or Refactoring
3. Testing
● Purpose: Ensure that modifications don’t break existing functionality and meet the new
requirements.
○ Regression Testing: Verifies that existing functionality still works after changes.
○ Unit and Integration Testing: Confirms that individual components and their
interactions behave as expected.
○ User Acceptance Testing (UAT): Ensures changes meet user needs before
deployment.
4. Redeployment
Summary
Software maintenance is a continuous process crucial for extending the life of a software
product. It involves:
● Enhancing functionality,
● Re-engineering for performance and scalability,
● Rigorously testing for quality assurance,
● Redeploying updates efficiently.
Each component plays a vital role in maintaining reliable, scalable, and user-friendly
software.
Definition:
Software support refers to the set of services provided to help end-users effectively use software
and resolve any problems they encounter. It ensures smooth operation and satisfaction by
addressing user questions, fixing issues, and coordinating across systems when necessary.
● Many systems are interconnected; issues may span multiple apps or services.
● Support must:
○ When a problem can't be solved at the first level, it's escalated to higher technical
tiers or developers.
○ Ensures critical or unresolved issues receive appropriate attention.
Summary
● Software support plays a critical role in user satisfaction and system reliability.
● Includes:
● Effective support improves product trust, reduces downtime, and feeds insights back into
development.
1. Waterfall Model
○ Enhancements
○ Bug fixes
○ Re-engineering
○ Redeployment
Support
Video notes:
2. Agile Model
● Iterative and incremental development with frequent delivery (e.g., every 2–4 weeks).
● Maintenance and support are integrated into ongoing development cycles.
Maintenance
Support
Video notes:
🔄 Comparison Table
Feature Waterfall Agile
The cost grows exponentially when fixing errors in the further testing.
Testing Terms:
- Behavioral testing: verifying that the correct functions were called with the correct
parameters
- State testing: focuses on the results of those calls
Automated Testing:
Pros:
- Repeated tests that are quick to run and can support iterative and agile development
- Very effective in validating environments and doing smoke tests to make sure a new build
meets a minimal set of requirements
- Supports performance testing very effectively
- Finds range defects
- Very inexpensive and quick to repeat testing and validate fixes
- Various implications include UI,API and unit automation tests
- Smoke testing is a type of software testing that verifies whether the basic and critical
functionalities of an application work correctly after a new build or deployment. It is
also known as "build verification testing".
Slide set : Engineering metrics