Software Development Notes Overview
Software Development Notes Overview
Table of Contents
1. Programming Paradigms
2. Software Requirements
3. Design Patterns
4. Software Testing
5. Pseudocode for Data Structures
The imperative programming paradigm is based on the concept of procedural programming, where programs are composed of statements that change a program's
state.
Key Concepts:
Principles:
Examples of Languages:
C
Pascal
FORTRAN
Python (supports imperative style)
Use Cases:
System programming
Performance-critical applications
Simple scripts and utilities
Functional programming treats computation as the evaluation of mathematical functions and avoids changing state and mutable data.
Key Concepts:
Principles:
Examples of Languages:
Haskell
Lisp
Erlang
F#
JavaScript (supports functional style)
Use Cases:
Object-oriented programming organizes software design around data, or objects, rather than functions and logic.
Key Concepts:
Principles:
Examples of Languages:
Java
C++
Python
C#
Ruby
Use Cases:
System programming, embedded systems, Direct control over hardware, Can lead to complex state
Imperative
performance-critical code predictable performance management, harder to reason about
Data processing, concurrent systems, Easier to reason about, better for Steeper learning curve, potential
Functional
mathematical computations parallel processing performance overhead
Object- Large applications, GUI development, Good for modeling real-world Can lead to over-engineering, steeper
Oriented systems with complex relationships concepts, code reusability learning curve
Historical Shifts:
Emerging Paradigms:
Future Considerations:
Mis-specified requirements can have significant financial and operational impacts on software projects.
Types of Costs:
Impact Statistics:
Studies show that correcting requirements errors after implementation can cost 100 times more than fixing them during requirements gathering
Up to 40% of development budget is often spent on rework due to requirement issues
Projects with unclear requirements are 2-3 times more likely to fail
Incomplete requirements
Misunderstanding user needs
Changing requirements without proper change management
Ambiguous language and specifications
Prototyping involves creating simplified, incomplete versions of the system to gather feedback and clarify requirements.
Types of Prototypes:
Benefits of Prototyping:
Prototyping Techniques:
Paper prototypes
Wireframes and mockups
Interactive prototypes
Minimum Viable Products (MVPs)
Best Practices:
User Stories: User stories are short, simple descriptions of a feature told from the perspective of the person who desires the new capability.
Format: "As a [type of user], I want [some goal] so that [some reason]."
Components:
Example: "As a customer, I want to save items to a wishlist so that I can purchase them later."
Acceptance Criteria: Conditions that must be met for the user story to be considered complete.
Types of Specifications:
Security Requirements: Define how the system should protect information and resources.
User Requirements: Define what users need to accomplish with the system.
Hardware requirements
Software dependencies
Integration requirements
Budget constraints
Timeline constraints
Regulatory constraints
Technical constraints
The "Gang of Four" (GoF) refers to the four authors of the book "Design Patterns: Elements of Reusable Object-Oriented Software" (Erich Gamma, Richard Helm, Ralph
Johnson, and John Vlissides). They categorized 23 design patterns into three types:
Creational Patterns
1. Singleton: Ensures a class has only one instance and provides a global point of access.
2. Factory Method: Defines an interface for creating an object but lets subclasses decide which class to instantiate.
3. Abstract Factory: Provides an interface for creating families of related objects without specifying their concrete classes.
Structural Patterns
9. Decorator: Adds new functionality to objects dynamically without altering their structure.
11. Flyweight: Reduces memory usage by sharing as much data as possible with similar objects.
12. Proxy: Provides a surrogate or placeholder for another object to control access to it.
Behavioral Patterns
13. Chain of Responsibility: Passes a request along a chain of handlers until it's processed.
20. State: Allows an object to alter its behavior when its internal state changes.
21. Strategy: Defines a family of algorithms, encapsulates each one, and makes them interchangeable.
22. Template Method: Defines the skeleton of an algorithm, deferring some steps to subclasses.
Martin Fowler, in his book "Patterns of Enterprise Application Architecture," documented patterns specific to enterprise applications:
Domain Logic Patterns
1. Transaction Script : Organizes business logic by procedures where each procedure handles a single request from the presentation.
2. Domain Model: An object model of the domain that incorporates both behavior and data.
3. Table Module : A single instance that handles all the business logic for a table.
8. Identity Field: Saves a database ID field in an object to maintain identity between an in-memory object and a database row.
9. Foreign Key Mapping : Maps an association between objects to a foreign key reference between tables.
10. Association Table Mapping : Saves an association as a table with foreign keys to the tables that are linked by the association.
11. Dependent Mapping : Has one class in a pair of classes perform the database mapping for both.
12. Embedded Value: Maps an object into several fields of another object's table.
13. Serialized LOB: Saves a graph of objects by serializing them into a single Large Object field.
14. Single Table Inheritance : Represents an inheritance hierarchy of classes as a single table that has columns for all the fields of the various classes.
15. Class Table Inheritance : Represents an inheritance hierarchy of classes with one table for each class.
16. Concrete Table Inheritance: Represents an inheritance hierarchy of classes with one table per concrete class in the hierarchy.
17. Inheritance Mappers: A structure that organizes inheritance mappers.
18. Identity Map: Ensures that each object gets loaded only once by keeping every loaded object in a map.
19. Lazy Load : An object that doesn't contain all of the data you need but knows how to get it.
20. Virtual Proxy : An object that looks like the real object but actually loads the real object when first used.
21. Value Holder: An object that wraps another object and is used to lazy load the wrapped object.
22. Ghost: An object that is loaded in a partial state.
23. Unit of Work: Maintains a list of objects affected by a business transaction and coordinates the writing out of changes.
27. Model View Controller: Separates user interface modeling into three separate roles.
28. Page Controller: An object that handles a request for a specific page or action on a Web site.
29. Front Controller: A handler that receives all incoming requests and delegates to other handlers.
30. Template View: Renders information into HTML by embedding markers in an HTML page.
31. Transform View: A view that processes domain data into HTML using a transform-based approach.
32. Two Step View: A two-stage transformation that turns domain data into HTML.
33. Application Controller: A centralized point for handling screen navigation and the flow of an application.
Distribution Patterns
34. Remote Facade: Provides a coarse-grained facade over fine-grained objects to reduce the number of remote calls.
35. Data Transfer Object: An object that carries data between processes in order to reduce the number of method calls.
36. Optimistic Offline Lock: Prevents conflicts between concurrent business transactions by detecting them and aborting transactions.
37. Pessimistic Offline Lock: Prevents conflicts by locking data for the duration of a business transaction.
38. Coarse-Grained Lock: Locks a group of objects together.
39. Implicit Lock: Uses a framework or persistence tool to handle locking automatically.
UML (Unified Modeling Language) Class Diagrams are structural diagrams that describe the static structure of a system by showing system's classes, their
attributes, operations (or methods), and the relationships among objects.
Basic Components:
Class Notation:
+----------------------+
| ClassName |
+----------------------+
| - attribute1: type |
| - attribute2: type |
+----------------------+
| + operation1() |
| + operation2(param) |
+----------------------+
Visibility Modifiers:
+ Public
- Private
# Protected
~ Package
Relationships:
2. Aggregation: A "has-a" relationship where the child can exist independently of the parent
3. Composition: A strong "has-a" relationship where the child cannot exist without the parent
Architectural Patterns: High-level patterns that define the overall structure of a software system.
Behavioral Patterns: Patterns that deal with object communication and responsibility assignment.
User Interface Patterns: Patterns that deal with user interface design.
SOLID Principles:
1. Single Responsibility Principle (SRP): A class should have only one reason to change.
2. Open/Closed Principle (OCP): Software entities should be open for extension but closed for modification.
3. Liskov Substitution Principle (LSP): Subtypes must be substitutable for their base types.
4. Interface Segregation Principle (ISP): Clients should not be forced to depend on interfaces they don't use.
5. Dependency Inversion Principle (DIP) : High-level modules should not depend on low-level modules; both should depend on abstractions.
Low Coupling: Modules are independent, changes in one don't affect others
High Coupling: Modules are tightly connected, changes in one may require changes in others
Goal: Minimize coupling to improve maintainability and reusability
High Cohesion: Elements in a module are strongly related and serve a single purpose
Low Cohesion: Elements in a module are unrelated or serve multiple purposes
Goal: Maximize cohesion to improve understandability and maintainability
Encapsulation: Bundling data and methods that operate on that data within a single unit.
Abstraction: Hiding complex implementation details and showing only essential features.
You Ain't Gonna Need It (YAGNI): Implementing only features that are needed now, not anticipating future needs.
Definition of Software Quality: Software quality refers to the degree to which a software product meets specified requirements, customer needs, and implicit
expectations. It encompasses various attributes including reliability, efficiency, maintainability, and user satisfaction.
Reliability: The ability of the software to perform its required functions under stated conditions for a specified period.
Performance: The responsiveness and stability of the software under various workloads.
Usability : The ease with which users can learn and use the software.
Maintainability: The ease with which the software can be modified to correct defects, improve performance, or adapt to changes in the environment.
Security: The ability of the software to protect information and data from unauthorized access.
Compatibility: The ability of the software to operate in different environments.
Correctness : The extent to which the software performs its intended functions accurately.
Customer Satisfaction: High-quality software leads to satisfied customers who are more likely to continue using the product and recommend it to others.
Reduced Costs: Identifying and fixing defects early in the development process is significantly less expensive than fixing them after release.
Competitive Advantage: Quality can be a key differentiator in the marketplace.
Reputation: Poor quality can damage a company's reputation and affect future business.
Maintenance Efficiency: High-quality software is easier and less expensive to maintain.
Risk Mitigation : Quality software reduces the risk of security breaches, data loss, and system failures.
Business Logic:
Data Management:
Integration Points:
API endpoints
Third-party service integrations
Database connections
Authentication and authorization
Payment processing
Security Features:
Authentication mechanisms
Authorization controls
Data encryption
Input sanitization
Session management
Performance Aspects:
Load times
Response times
Throughput
Resource utilization
Scalability under load
Error Handling:
Exception handling
Error messages
Recovery mechanisms
Logging functionality
Graceful degradation
Report generation
Data visualization
Export functionality
Analytics calculations
Filtering and sorting
4.3 Types of Testing
Functional Testing: Verifies that each function of the software application operates in conformance with the requirement specification.
Performance Testing: Evaluates speed, responsiveness, and stability under various workloads
Load Testing : Tests system performance under expected load conditions
Stress Testing : Tests system performance under extreme conditions
Usability Testing : Evaluates ease of use and user satisfaction
Security Testing : Identifies vulnerabilities and security risks
Compatibility Testing: Verifies software works in different environments
Reliability Testing: Measures the ability of the system to perform without failure
Regression Testing: Re-running existing tests to ensure that changes haven't broken existing functionality.
Mutation Testing: A technique to evaluate the quality of test cases by modifying the program's source code.
Code Quality : Identifying code smells, dead code, and complex code
Security Vulnerabilities: Finding potential security issues
Standards Compliance: Checking adherence to coding standards
Complexity Metrics : Measuring code complexity
Black-Box Testing: Testing without knowledge of the internal structure or code of the software.
Characteristics:
Advantages:
Disadvantages:
Techniques:
Equivalence Partitioning
Boundary Value Analysis
Decision Table Testing
State Transition Testing
Use Case Testing
White-Box Testing: Testing with knowledge of the internal structure or code of the software.
Characteristics:
Advantages:
Thorough testing of code paths
Helps optimize code
Can identify hidden errors
Early detection of issues in development phase
Disadvantages:
Techniques:
Statement Coverage
Branch Coverage
Path Coverage
Condition Coverage
Loop Testing
Characteristics:
Comparison:
Knowledge
No knowledge of internal code Knowledge of internal code
Required
Requirements and
Basis Code structure
specifications
Principles of Testing:
1. Testing Shows Presence of Defects : Testing can prove the presence of defects, but cannot prove their absence.
2. Exhaustive Testing is Impossible : It's not possible to test all possible inputs and conditions.
3. Early Testing: Testing should start as early as possible in the development process.
4. Defect Clustering: A small number of modules contain most of the defects.
5. Pesticide Paradox: Repeating the same tests will eventually stop finding new defects.
6. Testing is Context Dependent: Testing approaches vary based on the context of the software.
7. Absence of Error Fallacy: Finding and fixing defects doesn't guarantee a successful system.
Quality Assurance: A systematic process to ensure quality standards are met throughout the development process.
Defect Detection: The process of identifying and documenting defects in the software.
Test Coverage: The degree to which the software has been tested.
Error Fallacy: The misconception that finding and fixing many defects guarantees a successful system.
Reality : A system can be defect-free but still fail to meet user needs
Solution: Focus on both defect detection and user satisfaction
Considerations: Usability, performance, and business value
Test Plans: A document describing the scope, approach, resources, and schedule of testing activities.
Pseudocode is a simplified, informal programming language that uses natural language and programming constructs to describe algorithms. It serves as a bridge
between natural language descriptions and actual code.
Sequential Statements:
Conditional Statements:
IF condition THEN
PERFORM action1
ELSE
PERFORM action2
END IF
Loops:
WHILE condition DO
PERFORM action
END WHILE
REPEAT
PERFORM action
UNTIL condition
Functions/Procedures:
Input/Output:
READ variable
DISPLAY "message"
Arrays:
DECLARE arrayName[size]
SET arrayName[index] TO value
GET value FROM arrayName[index]
Error Handling:
TRY
PERFORM operation
CATCH error
HANDLE error
END TRY
Audience Considerations:
Mixed Audience:
Scope Considerations:
High-Level Pseudocode:
Low-Level Pseudocode:
Context-Specific Pseudocode:
Arrays: A collection of elements of the same type stored in contiguous memory locations.
Characteristics:
Pseudocode Example:
FOR i FROM 0 TO 4 DO
DISPLAY numbers[i]
END FOR
Linked Lists: A linear data structure where elements are not stored in contiguous memory locations.
Characteristics:
Dynamic size
Sequential access
Each element contains data and a pointer to the next element
Efficient insertion and deletion
Pseudocode Example:
CLASS Node
DECLARE data
DECLARE next
END CLASS
CLASS LinkedList
DECLARE head
PROCEDURE insert(data)
CREATE newNode AS Node
SET [Link] TO data
SET [Link] TO null
Characteristics:
Elements are added and removed from the same end (top)
Operations: push (add), pop (remove), peek (view top element)
Used in function calls, expression evaluation, and backtracking
Pseudocode Example:
CLASS Stack
DECLARE top
DECLARE size
PROCEDURE push(item)
CREATE newNode AS Node
SET [Link] TO item
SET [Link] TO top
SET top TO newNode
INCREMENT size
END PROCEDURE
FUNCTION pop()
IF top IS null THEN
RETURN "Stack is empty"
ELSE
DECLARE item AS [Link]
SET top TO [Link]
DECREMENT size
RETURN item
END IF
END FUNCTION
FUNCTION peek()
IF top IS null THEN
RETURN "Stack is empty"
ELSE
RETURN [Link]
END IF
END FUNCTION
END CLASS
Queues: A FIFO (First In, First Out) data structure.
Characteristics:
Elements are added at the rear and removed from the front
Operations: enqueue (add), dequeue (remove), front (view front element)
Used in scheduling, resource management, and breadth-first search
Pseudocode Example:
CLASS Queue
DECLARE front
DECLARE rear
DECLARE size
PROCEDURE enqueue(item)
CREATE newNode AS Node
SET [Link] TO item
SET [Link] TO null
FUNCTION dequeue()
IF front IS null THEN
RETURN "Queue is empty"
ELSE
DECLARE item AS [Link]
SET front TO [Link]
IF front IS null THEN
SET rear TO null
END IF
DECREMENT size
RETURN item
END IF
END FUNCTION
END CLASS
Trees: A hierarchical data structure with a root node and child nodes.
Characteristics:
Non-linear structure
Each node can have multiple child nodes
Used in file systems, organization charts, and search algorithms
CLASS BinaryTree
DECLARE root
PROCEDURE insert(data)
CREATE newNode AS TreeNode
SET [Link] TO data
SET [Link] TO null
SET [Link] TO null
Characteristics:
Pseudocode Example:
CLASS Map
DECLARE buckets[SIZE]
FUNCTION hash(key)
DECLARE hashValue TO 0
FOR each character IN key DO
SET hashValue TO (hashValue * 31 + ASCII(character)) MOD SIZE
END FOR
RETURN hashValue
END FUNCTION
FUNCTION get(key)
DECLARE index TO hash(key)
DECLARE bucket TO buckets[index]
Array Insertion:
PROCEDURE insertAtEnd(array, size, element)
IF size < CAPACITY THEN
SET array[size] TO element
INCREMENT size
ELSE
DISPLAY "Array is full"
END IF
END PROCEDURE
Array Deletion:
Tree Search:
FUNCTION searchTree(root, key)
DECLARE current AS root
Array Traversal:
PROCEDURE traverseLinkedList(head)
DECLARE current AS head
PROCEDURE inOrderTraversal(node)
IF node IS NOT null THEN
inOrderTraversal([Link])
DISPLAY [Link]
inOrderTraversal([Link])
END IF
END PROCEDURE
Bubble Sort:
Quick Sort:
PROCEDURE quickSort(array, low, high)
IF low < high THEN
DECLARE pivotIndex TO partition(array, low, high)
quickSort(array, low, pivotIndex - 1)
quickSort(array, pivotIndex + 1, high)
END IF
END PROCEDURE
Stack Operations:
FUNCTION pop(stack)
IF [Link] > 0 THEN
DECLARE item TO [Link][[Link]]
DECREMENT [Link]
DECREMENT [Link]
RETURN item
ELSE
DISPLAY "Stack underflow"
RETURN null
END IF
END FUNCTION
Queue Operations:
PROCEDURE enqueue(queue, item)
IF [Link] < [Link] THEN
SET [Link][[Link]] TO item
SET [Link] TO ([Link] + 1) MOD [Link]
INCREMENT [Link]
ELSE
DISPLAY "Queue is full"
END IF
END PROCEDURE
FUNCTION dequeue(queue)
IF [Link] > 0 THEN
DECLARE item TO [Link][[Link]]
SET [Link] TO ([Link] + 1) MOD [Link]
DECREMENT [Link]
RETURN item
ELSE
DISPLAY "Queue is empty"
RETURN null
END IF
END FUNCTION
Conclusion
This comprehensive guide covers the fundamental aspects of software development, from programming paradigms to data structures and algorithms. Understanding
these concepts is essential for anyone pursuing a career in computing and information systems.
By mastering these topics, learners will be well-equipped to make informed decisions in software development projects, from initial requirements gathering to final
testing and implementation.
References
1. Gamma, E., Helm, R., Johnson, R., & Vlissides, J. (1994). Design Patterns: Elements of Reusable Object-Oriented Software. Addison-Wesley.
2. Fowler, M. (2002). Patterns of Enterprise Application Architecture. Addison-Wesley.
3. Pressman, R. S., & Maxim, B. R. (2020). Software Engineering: A Practitioner's Approach. McGraw-Hill Education.
4. Sommerville, I. (2016). Software Engineering (10th ed.). Pearson.
5. Martin, R. C. (2017). Clean Architecture: A Craftsman's Guide to Software Structure and Design. Prentice Hall.
6. Myers, G. J., Sandler, C., & Badgett, T. (2011). The Art of Software Testing (3rd ed.). Wiley.
7. Knuth, D. E. (1997). The Art of Computer Programming, Volume 1: Fundamental Algorithms (3rd ed.). Addison-Wesley.
8. Sedgewick, R., & Wayne, K. (2011). Algorithms (4th ed.). Addison-Wesley.