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

CodeSignal

Refactoring by Leveraging Tests with C++ & Google Test

via CodeSignal

Overview

This course focuses on the Refactor step in TDD, teaching developers to spot code smells and resolve them through refactoring. Using real-world examples, you'll identify common issues, apply refactoring techniques, and ensure functionality is preserved with existing tests.

Syllabus

  • Unit 1: Eliminating Code Duplication and Refactoring Magic Numbers in C++
    • Improving Test Code Maintainability in Shopping Cart Application
    • Refactor ShoppingCart Tests to Parameterized Google Tests
    • Refactoring ShoppingCart to Eliminate Code Duplication
    • Refactoring ShoppingCart to Eliminate Code Duplication
    • Refactor Magic Numbers into Constants in ShoppingCart
  • Unit 2: Refactoring Long Methods in C++ for Improved Code Maintenance and Readability
    • Refactoring User Validation in UserRegistrationService
    • Extract Address Validation Logic into AddressValidator Class
    • Data Normalization and Validation Refactoring in User Registration
    • User Registration and Data Validation Refactoring
  • Unit 3: Refactoring Complex Function Signatures in C++ with Parameter Objects
    • Refactor to Use ScoreWeights Parameter Object
    • Refactor ProcessExamScore Method Using Parameter Object Technique
    • Reorder Parameters for Clarity in ExamProcessor
    • Refactoring ProcessExamScore Method for Default Parameter Values
  • Unit 4: Refactoring Feature Envy in C++ with the Move Method Pattern
    • Refactoring Feature Envy in GradeAnalyzer
    • Refactoring CalculateFinalGrade Method from GradeAnalyzer to Student Class
    • Refactoring GetFailedAssignments Method into Student Class
    • Refactoring Student Grade Management with Feature Envy Resolution
  • Unit 5: Refactoring Large Classes in C++ Using the Extract Class Pattern
    • Refactor Shopping Cart Code with CartItemCollection
    • Refactor ShoppingCart Price Calculation with PriceCalculator Class
    • Refactoring ShoppingCart to Use DiscountCalculator for Discounts
    • Implement Tests for DiscountCalculator and PriceCalculator

Reviews

Start your review of Refactoring by Leveraging Tests with C++ & Google Test

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.