Class Central is learner-supported. When you buy through links on our site, we may earn an affiliate commission.

CodeSignal

Breaking Dependencies to Improve Code

via CodeSignal

Overview

Breaking dependencies is crucial in existing systems to make them more testable, maintainable, and extensible. By reducing coupling and isolating functionality, developers can introduce changes incrementally while minimizing risks. In this course, we focus on removing coupling with interfaces and dependency injection techniques for testability.

Syllabus

  • Unit 1: Breaking Dependencies to Improve Code in C++
    • Understanding and Reviewing the Order Processing System
    • Improving Object Management in OrderProcessor
    • Creating Interfaces for Database and Payment Dependencies
    • Refactoring OrderProcessor to Use Interfaces
  • Unit 2: Dependency Injection in C++: Enhancing Flexibility and Testability
    • Implementing Dependency Injection with the Null Object Pattern
    • Preparing Mock Objects for OrderProcessor Tests
    • Testing Failed Payment Handling in Order Processing
    • Testing Order Processing with Missing Products
    • Testing Exception Handling in OrderProcessor
    • Testing Order Processor with Varied Product Prices
  • Unit 3: Method Dependency Injection in C++: Enhancing Flexibility and Testability
    • Add Optional Dependencies to Process Order Method
    • Testing Order Processing with Mock Dependencies
    • Testing Order Processing with Non-Existent Customer
    • Testing Non-Existent Product Handling in OrderProcessor
    • Add Test for Payment Processing Failures
    • Testing Exception Handling in Order Processing
  • Unit 4: Refactoring Global State in C++: Enhancing Modularity and Testability
    • Creating Order Configuration Interface and Implementation
    • Integrating OrderConfiguration with OrderProcessor
    • Add Configuration Injection Constructor to OrderProcessor
    • Unit Testing the OrderProcessor with GoogleMock
    • Testing Bulk Order Discounts with Mock Configuration
    • Testing Orders Below Bulk Threshold

Reviews

Start your review of Breaking Dependencies to Improve Code

Never Stop Learning.

Get personalized course recommendations, track subjects and courses with reminders, and more.

Someone learning on their laptop while sitting on the floor.