you are a professor at SFU teaching the courses CMPT276. Give me practice questions for…
- User
you are a professor at SFU teaching the courses CMPT276. Give me practice questions for the upcoming midterm. Show the answer below and explain your process
Assistant
Here are some practice questions for your CMPT 276 (Software Engineering) midterm:
Question 1: Software Development Life Cycle
Question: Compare and contrast the Waterfall and Agile methodologies. Describe a scenario where each would be most appropriate, and explain the key risks associated with each approach.
Answer: Waterfall is a linear, sequential approach where each phase must be completed before moving to the next (Requirements → Design → Implementation → Testing → Deployment → Maintenance). Agile is iterative and incremental, with short development cycles called sprints that incorporate continuous feedback.
Waterfall is most appropriate for projects with well-defined, stable requirements, such as developing software for medical devices or aerospace systems where regulatory compliance is critical. Agile works best for projects with evolving requirements, like web applications or mobile apps where user feedback drives development.
Key risks:
- Waterfall: Late discovery of issues, difficulty accommodating changes, potential for delivering obsolete products
- Agile: Scope creep, potential lack of documentation, difficulty with fixed-price contracts
Question 2: Requirements Engineering
Question: You're developing a university course registration system. Write 3 functional requirements and 2 non-functional requirements. Explain the difference between these requirement types.
Answer: Functional Requirements:
- The system shall allow students to search for courses by department, course number, or instructor name
- The system shall prevent students from registering for courses that conflict with their current schedule
- The system shall send email confirmation when a student successfully registers for a course
Non-functional Requirements:
- The system shall respond to user queries within 2 seconds under normal load
- The system shall be available 99.9% of the time during registration periods
Functional requirements describe what the system should do (specific behaviors and functions), while non-functional requirements describe how well the system should perform (quality attributes like performance, reliability, usability).
Question 3: Design Patterns
Question: Explain the Observer pattern and provide a concrete example of where it would be useful in software development. Include a simple class diagram.
Answer: The Observer pattern defines a one-to-many dependency between objects so that when one object changes state, all dependents are notified automatically. It consists of a Subject (Observable) that maintains a list of Observers and notifies them of state changes.
Example: A weather monitoring system where multiple display devices (temperature display, humidity display, forecast display) need to update when weather data changes.
Subject (WeatherStation) ├── attach(Observer) ├── detach(Observer) ├── notify() Observer (Display) ├── update() ConcreteSubject (WeatherData) ├── getTemperature() ├── getHumidity() ├── notify() when data changes ConcreteObserver (TemperatureDisplay, HumidityDisplay) ├── update() - receives new data and refreshes displayThis pattern promotes loose coupling between the weather station and display components.
Question 4: Testing
Question: Explain the difference between unit testing, integration testing, and system testing. For a simple calculator application, provide one example test case for each type.
Answer:
- Unit Testing: Tests individual components/methods in isolation
- Integration Testing: Tests interaction between integrated components
- System Testing: Tests the complete system against requirements
Calculator Examples:
- Unit Test: Test the add() method with inputs (5, 3) expecting output 8
- Integration Test: Test that the calculator display correctly shows results when the add() method is called through the user interface
- System Test: Test complete user workflow: user enters "5 + 3 =", system displays "8", and calculation history is properly stored
Each level tests different aspects and catches different types of defects, forming a comprehensive testing strategy.
My Process: I focused on core CMPT 276 topics that typically appear on midterms: SDLC methodologies, requirements engineering, design patterns, and testing strategies. Each question tests both theoretical understanding and practical application, which reflects the nature of software engineering as both a technical and process-oriented discipline. The questions progress from high-level concepts to more detailed technical knowledge.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.