CPSC 310 Final Review || with 100% Error-free Solutions.
Software processes correct answers 1. waterfall
2. spiral
3. extreme programming (xp)
4. agile development
5. TDD
6. Scrum
waterfall correct answers Requirements -> Design -> Implement -> Verify -> Maintain
Pros: Clear hand-off, explicit criteria
Cons: Inflexible, no revisiting after hand-off, value can't be validated until completion
TDD (Test Driven Development) correct answers test-first software development practice in
which test cases are defined and created first, and subsequently executable code is created to
make the test pass. The failing tests are constructed to pass as development proceeds and tests
succeed.
Coupling issues correct answers Strong coupling is problematic because it negatively influences
the evolvability and maintainability of a program.
Data coupling > Stamp coupling > Control coupling > Global (common) coupling > Content
coupling
How to decrease coupling correct answers Minimize interfaces between elements
Minimize complexity of interfaces (no god classes)
Avoid control flow coupling
, Cohesion correct answers Cohesion measures how well the elements within a class belong
together, minimal variety of tasks.
Single Responsibility Principle (SRP) correct answers a class should do one thing and do it well -
which is to say it should be cohesive
Open/Closed correct answers Open to extension but closed to modification.
APIs
Implemented in most design patterns
Liskov Substitution Principle (LSP) correct answers Any object can be interchanged with any
other object that has the same parent type.
Interface Segregation Principle (ISP) correct answers No client should be forced to depend on
methods it does not use. (No god interfaces/classes).
Pros: less coupling
Dependency Inversion Principle (DIP) correct answers High-level modules should not depend on
low-level modules. Both should depend on abstractions.
Abstractions should not depend on details. Details should depend on abstractions.
Decouples dependencies between high-level and low-level layers through shared abstractions.
Implemented by adapter pattern
eg of violation
public class Project {
private BackEndDeveloper backEndDeveloper = new BackEndDeveloper();
private FrontEndDeveloper frontEndDeveloper = new FrontEndDeveloper();
public void implement() {
backEndDeveloper.writeJava();
frontEndDeveloper.writeJavascript();
}
}
DIP issues correct answers 1. Simply implementing an interface over a class isn't sufficient and
generally does not reduce coupling, only thinking about the potential abstraction of interactions
can lead to a less coupled design.
2. Implementing generic interfaces everywhere in a project makes it by far harder to understand
and maintain. At each step the reader will ask themself what are the other implementations of
this interface and the response is generally: only mocks.
The benefits of buying summaries with Stuvia:
Guaranteed quality through customer reviews
Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.
Quick and easy check-out
You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.
Focus on what matters
Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!
Frequently asked questions
What do I get when I buy this document?
You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.
Satisfaction guarantee: how does it work?
Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.
Who am I buying these notes from?
Stuvia is a marketplace, so you are not buying this document from us, but from seller FullyFocus. Stuvia facilitates payment to the seller.
Will I be stuck with a subscription?
No, you only buy these notes for $11.69. You're not tied to anything after your purchase.