Detailed Exam Revision Notes for CS2800 Software Engineering
Based on Revision Slides, Topics List, Past Papers, and Lecture Slides (Week 2–Week10)
Exam Structure & Strategy
- Four questions in total:
- Q1: Define and connect two SE concepts (40 marks).
- Q2–Q4: Progressive difficulty, testing practical skills (e.g., Git), design patterns, UML, and software design.
Key Tips:
- Use bullet points for Q1. Aim for 6 lines per definition and 4 lines for connections.
- Prioritize time: Q1 is easiest; avoid overcomplicating later questions.
- Revise Git, TDD, UML, Design Patterns, Scrum, and Test Coverage concepts thoroughly.
Week 2: Version Control Systems (VCS) & Git
VCS Types:
- Centralized VCS (CVCS): Single repository server (e.g., SVN). Risks single-point failure.
- Distributed VCS (DVCS): Local repositories (e.g., Git). Enables offline work, redundancy.
Git Concepts:
- Commit: Snapshot of changes with a unique hash.
- Branch: Independent line of development.
- Merge: Combine branches; resolve conflicts manually.
- Tags: Mark specific commits (e.g., v1.0).
- Staging Area: Intermediate area to prepare commits.
- Remotes: Remote repositories (e.g., GitLab, GitHub).
- .gitignore: Exclude files from tracking.
Agile Manifesto:
- Values:
- Individuals/Interactions > Processes/Tools.
- Working Software > Documentation.
- Customer Collaboration > Contract Negotiation.
- Responding to Change > Following a Plan.
Week 3–4: Writing Maintainable Code
Build Automation (Maven):
- Lifecycle Phases:
clean
,validate
,compile
,test
,package
,install
. - Dependencies: Managed via
pom.xml
.
Testing:
- Unit Testing (JUnit): Test individual components.
- Integration Testing: Test interactions between modules.
- Test-Driven Development (TDD): Red-Green-Refactor-Commit cycle.
Code Quality Tools:
- Checkstyle: Enforce coding standards (e.g., indentation).
- SpotBugs: Detect potential bugs (e.g., null pointers).
- Javadoc: Generate API documentation from comments.
CI/CD (Continuous Integration/Deployment):
- Automate build, test, and deployment using tools like Jenkins.
Code Review Best Practices:
- Modern Code Review: Peer reviews via Git merge requests.
- Code Smells: Long methods, duplicate code, dead code.
Week 5: UML & Software Engineering Principles
UML Diagrams:
- Class Diagram: Classes, attributes, operations, relationships (Association, Aggregation, Composition, Inheritance).
- Sequence Diagram: Object interactions over time.
- Activity Diagram: Workflow/process steps.
Design Principles:
- SOLID:
- SRP (Single Responsibility Principle): One reason to change.
- OCP (Open-Closed Principle): Open for extension, closed for modification.
- LSP (Liskov Substitution Principle): Subtypes replaceable.
- ISP (Interface Segregation): Avoid fat interfaces.
- DIP (Dependency Inversion): Depend on abstractions, not concretions.
- DRY (Don’t Repeat Yourself), KISS (Keep It Simple), YAGNI (You Ain’t Gonna Need It).
Spring Framework:
- Dependency Injection (DI): Invert control of object creation.
- DAO (Data Access Object): Abstract database operations.
- ORM (Object-Relational Mapping): Map objects to database tables (e.g., Hibernate).
Week 6–7: Design Patterns
Creational Patterns:
Singleton: Ensure one instance (use private constructor, static instance).
1
2
3
4
5
6
7
8
9
10public class Singleton {
private static Singleton instance;
private Singleton() {}
public static Singleton getInstance() {
if (instance == null) {
instance = new Singleton();
}
return instance;
}
}Factory: Delegate object creation to subclasses. Better than Singleton: Allows multiple instances, promotes polymorphism.
Structural Patterns:
- Facade: Simplify complex subsystems with a unified interface.
- Adapter: Convert incompatible interfaces (e.g., legacy to modern systems).
- Bridge: Decouple abstraction from implementation.
Behavioral Patterns:
- Observer: Notify dependent objects of state changes (e.g., event listeners).
- State: Change object behavior based on internal state.
Architectural Patterns:
- MVC (Model-View-Controller): Separate data (Model), UI (View), and logic (Controller).
Week 8: Refactoring
Technical Debt:
- Accumulated cost of shortcuts in code. Mitigate via refactoring.
Refactoring Techniques:
- Extract Method: Break down long methods.
- Replace Magic Number with Constant: Improve readability.
Code Smells:
- Long Method: Hard to read/test.
- Feature Envy: Method excessively uses another class’s data.
- Message Chains:
obj.getA().getB().getC()
→ violates Law of Demeter.
Week 9: SDLC & Scrum
SDLC Models:
- Waterfall: Sequential (requirements → design → code → test → deploy).
- Agile: Iterative, incremental (Scrum, Kanban).
Scrum Framework:
- Roles:
- Product Owner: Prioritizes backlog.
- Scrum Master: Facilitates processes.
- Development Team: Delivers increments.
- Artifacts:
- Product Backlog: Prioritized list of user stories.
- Sprint Backlog: Tasks for current sprint.
- Events:
- Sprint Planning: Define sprint goal.
- Daily Standup: 15-minute progress check.
- Retrospective: Reflect on process improvements.
Week 10: Code Metrics & Test Coverage
Control Flow Graph (CFG):
- Visualize code paths (nodes = statements, edges = execution flow).
Cyclomatic Complexity (CC):
- Formula: CC = Edges – Nodes + 2.
- Measures code complexity; higher CC → harder to test.
Test Coverage Criteria:
- Statement Coverage: Execute every statement.
- Branch Coverage: Test all decision outcomes (e.g., if true/false).
- Basic Condition Coverage: Test all atomic boolean conditions.
Past Paper Insights
Q1 Topics (Define & Connect):
User Stories vs. Use Cases:
- User Story: Agile artifact, written as “As a [role], I want [feature] to [benefit]”.
- Use Case: Waterfall artifact, detailed interaction flows.
- Connection: Both capture requirements but differ in granularity and methodology.
Coupling vs. Cohesion:
- Coupling: Interdependence between classes (low coupling desirable).
- Cohesion: How well class methods relate (high cohesion desirable).
- Connection: High cohesion reduces coupling.
Design Pattern Questions (2023 Exam):
- Singleton in Java: Use private constructor, static instance.
- Why Not Extend Singleton? Inheritance violates singleton’s single-instance guarantee; prevent via
final
class. - Adapter vs. Facade:
- Adapter: Changes interface for compatibility.
- Facade: Simplifies a subsystem.
Final Tips:
- Review exam papers: Focus on Q1 topics (e.g., TDD, SOLID, Scrum events).
- Practice UML diagrams (class, sequence) and Git commands.
- Avoid memorizing; focus on understanding connections between concepts.
Best of luck! 🚀
Detailed Exam Revision Notes for CS2800 Software Engineering
https://blog.pandayuyu.zone/2025/05/07/Detailed_Exam_Revision_Notes_for_CS2800_Software_Engineering/