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

CodeSignal

Increasing Code Test Coverage in C++

via CodeSignal

Overview

This course explores how to improve code test coverage and foster a more testable codebase. Increasing code test coverage is essential for ensuring confidence in modifying existing systems. It allows developers to make changes with minimal risk of introducing bugs by providing a safety net of tests that document existing and desired behaviors.

Syllabus

  • Unit 1: Refactoring Techniques in C++
    • Initial Version of OrderProcessor Class
  • Unit 2: Increasing Code Test Coverage in C++
    • Add Unit Test for OrderProcessor in C++
    • Verify Order Total Calculation with Multiple Items
    • Testing Order Processor with No Items
    • Complete Test Case for OrderProcessor Class in C++
  • Unit 3: Characterization Tests in C++ for Legacy Code
    • Order Processor Characterization Test for Item Limit
    • Verify Bulk Order Discount Functionality in OrderProcessor
    • Shipping Method Determination Logic Testing
    • Verify Express Shipping for High Quantity Orders
    • Creating Characterization Tests for Shipping Method Precedence
    • Handling Zero-Value Orders in Order Processing System
  • Unit 4: Increasing Testability in C++ with Abstract Classes and Mocks
    • Refactoring OrderProcessor for Dependency Injection
    • Preparing EmailService for Mocking in OrderProcessor
    • Order Processing System with Google Mock for Email Service Testing
    • Adding Error Handling Test for Email Service Failure in Order Processing
  • Unit 5: Integrating Test Writing and Mocking Techniques in C++
    • Implementing an Interface for Database Operations in Order Processing System
    • Implement Dependency Injection in OrderProcessor for Testability
    • Setting Up a Google Test Environment for OrderProcessor Class
    • Unit Test for OrderProcessor UpdateOrderDate Method Using gmock
    • Verifying Order Absence in Database with Mock Testing
    • Unit Test for Handling Database Exceptions in OrderProcessor

Reviews

Start your review of Increasing Code Test Coverage in C++

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.