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

CodeSignal

Using Sprout and Wrap Techniques

via CodeSignal

Overview

Sprout techniques involve creating new methods or classes to encapsulate additional functionality or refactored behavior. These techniques help to safely introduce changes while preserving existing behavior, minimizing risks, and improving testability. In this course we will use sprout techniques with methods and objects to refactor or expand capabilities.

Syllabus

  • Unit 1: Using the Sprout Method for Safe Code Refactoring in C++
    • Implementing Order Processing with Surcharges
    • Testing the Order Surcharge Logic
    • Testing Surcharge Processing with Empty Orders
    • Implementing Parameterized Tests for Negative Surcharge Validation
    • Parameterized Tests for Valid Surcharges
  • Unit 2: Refactoring Overloaded Methods in C++ Using the Sprout Method
    • Extract Customer Data Method in OrderProcessor
    • Extract Order Total Calculation Method
    • Refactoring Payment Logic to a Private Method
    • Extract Update Order Status Method
    • Extract Order Confirmation Email Logic
  • Unit 3: Using the Wrap Method for Safe Code Refactoring in C++
    • Implementing the Wrap Method Pattern for Order Processing
    • Adding Fraud Detection to the Order Processor
    • Implement Fraud Detection in Order Processing
    • Testing Fraud Detection in Order Processing
    • Testing Successful Order Processing Path
  • Unit 4: Refactoring Overburdened Classes in C++ Using the Sprout Class Technique
    • Creating a Metrics Collector Using the Sprout Pattern
    • Implement Order Metrics Collection Logic
    • Adding OrderMetricsCollector Dependency to OrderProcessor
    • Replacing Hardcoded Metrics with the Collector Service
  • Unit 5: Implementing the Sprout Class Technique for Adding New Functionality in C++
    • Preparing Models for Order Discount Processing
    • Implementing a Discount Calculator for Customer Loyalty
    • Sprouting the DiscountedOrderProcessor Class
    • Implementing the Process Order with Discount Method
  • Unit 6: Using the Wrap Class Technique for Safe Code Refactoring in C++
    • Creating the IOrderProcessor Interface
    • Creating the LoggingOrderProcessor Class
    • Implementing Process Order Method with Logging
    • Implementing the cancel_order Method in LoggingOrderProcessor

Reviews

Start your review of Using Sprout and Wrap Techniques

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.