Midterm Flashcards

(36 cards)

1
Q

What are design patterns, and how do they improve software development?

A

Reusable solutions to common problems.

KEY: reusability, maintainability and scalability.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Explain the difference between creational, structural, and behavioral design
patterns. Provide an example of how to use them in software architecture.

A

Creational: object creation (singleton, factory)

Structural: relationship between entities (adapter, bridge, composite)

Behavioral:how objects interact and communicate (iterator, observer)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Provide examples of at least five different design patterns, specifying whether they
belong to creational, structural, or behavioral categories.

A

Creational: Singleton, Factory

Structural: Adapter, Bridge, Composite

Behavioral: Iterator, Observer

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are some common violations of the MVC architecture? Provide an example
of how an application could break the MVC pattern

A

MVC: separate concerns of data management, user interface, an app logic

  1. fat controller: controller does way too much handling logic and data
  2. model handling UI
  3. controller updating view directly
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Case Study: Online Food Delivery. A company is building an online food delivery
system. The system needs to:
* Allow customers to browse restaurants and place orders.
* Notify restaurants when a new order is placed.
* Provide real-time order tracking for customers.
Based on this scenario, answer the following questions related to MVC:
a) How would you structure this system using the MVC pattern?
b) Identify the Model, View, and Controller components and describe their roles.
c) How does the MVC pattern help in decomposition, cohesion and coupling in
this system?

A

a) Model → manages data (menu, orders, tracking)
View → display restaurant list, order details
Controller → handle customer actions (browsing, ordering, tracking)

c) Decomposition: separate features into layers
Cohesion: each layer has a dedicated role
Coupling: loose coupling

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What are the SOLID principles, and why are they important in software design?

A

S: Single Responsibility → 1 class 1 responsibility
O: Open-Close Principle → extend without modifying
L: Liskov Substitution → subtypes should be suitable for their base types
I: Interface Segragation → avoid unwanted dependencies
D: Dependency Inversion: High-level modules are independent on low-level details

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Explain the Single Responsibility Principle and provide an example of a violation
and its refactored solution.

A
  • Class should be well defined / specific. Easier to understand and maintain.

Ex: Vehicle class is separate from the navigation class.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

How does the Open-Closed Principle contribute to software evolution? Provide an
example.

A

Open for extension. Closed for Modification.

Prevents breaking old functionality. Reduces bugs and makes future updates smoother.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is the Liskov Substitution Principle? Why is it important for maintaining
correct software behavior?

A

Subclasses should be replaceable for their base classes without altering program behavior.

Prevents unexpected bugs by ensuring derived classes maintain expected behavior.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Explain the Interface Segregation Principle and the Dependency Inversion
Principle. How do these two principles complement each other in software design?

A

ISP → split large interfaces into smaller specific ones

Dependency Inversion → Depend on ABSTRACTIONS not CONCRETE IMPLEMENTATION

They reduce coupling and increase flexibility.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

How does violating SOLID principles impact software maintainability?

A

Leads to tightly coupled, rigid, and hard-to maintain code.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is software quality, and how is it different from software testing?

A

Quality: degree to which a product meets requirements / expectations

Testing: identifying defects

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is collaborative quality, and how does teamwork help improve software
quality?

A

Multiple individuals/teams work together to create and maintain products.

Look at each other’s blind spots and support each other.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What are the differences between black box, white box, and grey box testing?
Provide an example for each.

A

Black: Test without knowing internal structure

White: tests internal structure

Grey: leverage both black and white

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Describe the four primary levels of testing (Unit, Integration, System, and
Acceptance Testing)

A

Unit → individual code components

Integration → interaction between components like data exchange

System → test ENTIRE system as a whole

Acceptance → validating from a USER’s perspective

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is the difference between system testing and acceptance testing?

A

System → tests ENTIRE system

Acceptance → ensuring the system meets business/user requirements

17
Q

What is the difference between regression testing and retesting?

A

Regression → new changes don’t break existing functionality

Retesting → checking if a specific bug has been fixed

18
Q

Case Study: Verification vs. Validation. A company is developing a fitness tracking
mobile app. The app must:
* Allow users to log workouts and track calories burned.
* Provide personalized fitness recommendations.
* Work seamlessly on both iOS and Android.
a) What is the difference between verification and validation?
b) Which activities in the software development lifecycle would fall under
verification?
c) Which activities would fall under validation?

A

a) Verification → ensures software is built correctly
Validation → ensuring software meets user needs

b) Requirement reviews, design reviews, code reviews, unit testing

c) User acceptance testing, beta testing

19
Q

What is the difference between load testing and stress testing? Provide an
example for each

A

Load → how system performs under expected user traffic

Stress → Pushes system BEYOND its limits for extreme conditions

20
Q

What are the key differences between beta testing and A/B testing?

A

Beta → release entire product to a small group of real users before launch

A/B → compare 2 different versions to see which performs better

21
Q

What is the difference between usability, accessibility and fairness testing?

A

Usability → ensure software is easy to user, intuitive

Accessibility → ensure software is usable by people with disabilities
Fairness → Ensure software doesn’t discriminate

22
Q

What is the role of fairness testing in detecting bias and discrimination in software

A

Fairness testing ensures software treats all users equally. By detecting bias and discrimination.

23
Q

When is manual testing preferred over automated testing? Provide examples.

A
  • Usability and UI testing
  • cost effective
  • When it requires human judgement and intuition
24
Q

What are the key advantages of automated testing in large-scale software
projects?

A
  • testing efficiency, accuracy and coverage
  • faster and reliable for repetitive tasks
25
What is the difference between structure-based testing and path-based testing?
Structure → test to check each part of the code. (only checked once) Path → all possible execution paths are taken, may repeat.
26
Explain how error cases, common cases, and boundary cases are identified in requirements-based testing.
Error → test invalid inputs / unexpected conditions Common → test typical inputs Boundary → test values at the limits
27
Compare scripted testing and exploratory testing. How do their approaches differ?
Scripted → predefined test cases followed step by step. Exploratory → unscripted, testers can actively explore the system.
28
How does exploratory testing add structure to ad-hoc testing?
- Focusing on a specific area - Exploratory documents and plans for some tracability
29
How does software project management help ensure on-time and high-quality software delivery?
Process of planning, coordinating and overseeing activities. Ensures successful, on-time, high quality.
30
What are the risks of delivering a complete system only at the end of development, as in the Waterfall model?
- Late bug detection - Lack of feedback - High costs to rework - Risk of failing the entire project
31
List at least three advantages and three disadvantages of iterative and incremental development.
Deployment through repeated cycles and smaller portions. Pros: - find bugs early - early feedback - guarantees value before completion Cons: - Higher resource needs due to frequent testing - can cause compatibility issues - documentation hard to maintain
32
Explain why Agile values “working software over comprehensive documentation.”
- faster feedback - adaptability - efficient
33
What are the challenges of Agile development?
- dependency on client availability - lack of predictability - documentation hard to maintain
34
How does Scrum organize work differently from Kanban?
Scrum → split work into FIXED-LENGTH iterations. Work is planned in advance Kanban → visual workflow management, no fixed lengths
35
A company is developing a large-scale financial management system that requires strict regulatory compliance and well-documented processes. Would Agile or Waterfall be the better approach? Justify your answer.
Waterfall is the better approach 1. predictable 2. stability over flexibility 3. clear documentation
36
A startup wants to develop a social media app with evolving features based on user feedback. Should they use Waterfall, Incremental, or Agile development? Explain your reasoning.
Agile is the best approach 1. user feedback driven 2. fast iterations 3. adaptable 4. early market entry