Skip to content

Instantly share code, notes, and snippets.

@stevebrownlee
Last active October 9, 2025 18:41
Show Gist options
  • Save stevebrownlee/4a60abbf83a3bb82a26df6e4899ec2e2 to your computer and use it in GitHub Desktop.
Save stevebrownlee/4a60abbf83a3bb82a26df6e4899ec2e2 to your computer and use it in GitHub Desktop.
Outline for testing and debugging large scale codebase

Exploring a Large Codebase

Week 1: Docker Containers and API Testing Introduction

Overall Goals

  • Get students comfortable with Docker containers as a development environment
  • Introduce the concept of unit testing in the context of APIs
  • Teach the fundamentals of mocking in unit tests
  • Integrating agentic AI to help with code generation and testing
  • Have students write their first unit tests for the learn-ops-api

Specific Tasks

  1. Docker Container Introduction (Day 1)

    • Provide pre-built Docker containers for the learn-ops-api project
    • Explain what Docker is and why it's beneficial for development (consistency, isolation, etc.)
    • Walk through the docker-compose.yml and Dockerfile in the config directory
    • Demonstrate how to start, stop, and interact with the containers
    • Help students troubleshoot any Docker setup issues
    • Ensure all students have a working development environment
  2. API Testing Introduction (Day 2)

    • Explain the importance of testing in professional development
    • Discuss the Django testing framework and how it integrates with DRF
    • Introduce the concept of test isolation and why it matters
    • Explain what mocking is and why it's necessary for testing
    • Demonstrate how to use the unittest.mock library
    • Show how to test API endpoints without hitting external dependencies

Group Work

  • Have students pair up to help each other get their Docker environments running
  • Create small groups to discuss what parts of an API should be tested and why
  • Have students collaborate to identify which methods in the API would benefit most from unit tests
  • Conduct a group code review of the tests.py file to understand existing test patterns

Instructor Guidance

You will be providing the students with pre-built Docker containers. Provide an overview of Docker, why it is being used, and how to start them. Once each attendee has their local Dockerized development environment working, provide an overview of what unit testing is. Then provide an overview of mocking, and why it will be used to unit test the methods in the API project.

You will demonstrate how to write a unit test for 1 or 2 methods in the API and then instruct the students to pick a few to write themselves with the appropriate mocking needed. Focus on the LearningAPI app's views.py file, as it contains several methods that would benefit from unit testing.

Week 2-3: API Testing Implementation

Overall Goals

  • Deepen understanding of unit testing principles
  • Have students implement comprehensive test coverage for the API
  • Teach students how to handle complex testing scenarios
  • Introduce test-driven development concepts

Specific Tasks

  1. Expanding Test Coverage (Week 2)

    • Review the tests written in Week 1
    • Identify gaps in test coverage
    • Demonstrate testing more complex API endpoints
    • Show how to test authentication and permissions
    • Introduce test fixtures for test data
  2. Advanced Testing Techniques (Week 3)

    • Teach students how to test edge cases and error conditions
    • Demonstrate how to test asynchronous operations
    • Discuss test organization and best practices for maintainability

Group Work

  • Form testing teams responsible for different parts of the API
  • Have groups perform code reviews of each other's tests
  • Organize a "bug hunt" where groups try to find edge cases that aren't covered by tests
  • Have teams present their testing strategies to the class

Instructor Guidance

Weeks 2-3 focus on deepening the students' understanding of unit testing by having them implement comprehensive test coverage for the learn-ops-api. Start by reviewing the tests written in Week 1 and identifying gaps in coverage.

Demonstrate testing more complex scenarios such as authentication, permissions, and edge cases. Introduce test fixtures and factories to make test data creation more efficient. Show students how to measure test coverage using tools like coverage.py.

By the end of Week 3, students should have implemented tests for most of the API endpoints and model methods. Emphasize the importance of testing edge cases and error conditions. Introduce the concept of test-driven development by having students write tests before implementing new features.

Week 4-6: Observability Implementation

Overall Goals

  • Introduce the concept of observability in software systems
  • Teach students how to implement logging, monitoring, and tracing
  • Have students implement observability features in the team builder component
  • Show how observability helps with debugging and performance optimization

Specific Tasks

  1. Observability Introduction (Week 4)

    • Define observability and its three pillars: logs, metrics, and traces
    • Explain the importance of observability in production systems
    • Introduce logging frameworks and best practices
    • Demonstrate how to set up basic logging in Django
  2. Implementing Logging and Metrics (Week 5)

    • Have students implement structured logging throughout the team builder component
    • Introduce metrics collection using Prometheus or a similar tool
    • Show how to create custom metrics for business-relevant events
    • Demonstrate how to set up dashboards for monitoring
    • Discuss log aggregation and analysis
  3. Advanced Observability (Week 6)

    • Introduce distributed tracing concepts
    • Show how to implement request tracing across services
    • Demonstrate performance profiling using observability data
    • Have students optimize parts of the application based on observability insights
    • Discuss alerting and incident response

Group Work

  • Have teams design logging strategies for different parts of the application
  • Create cross-functional groups to implement observability across the stack
  • Organize a "war room" exercise where teams use observability tools to diagnose simulated issues
  • Have groups present their observability implementations and findings

Instructor Guidance

Weeks 4-6 focus on implementing observability features in the team builder component. Start by introducing the concept of observability and its importance in modern software systems.

Demonstrate how to implement proper logging in Django applications, focusing on structured logging that can be easily parsed and analyzed. Show students how to use the Django Debug Toolbar for local development and how it can help identify performance issues.

In Week 5, have students implement logging throughout the team builder component. Introduce metrics collection using Prometheus or a similar tool. Show how to create custom metrics for business-relevant events and how to set up dashboards for monitoring.

By Week 6, introduce more advanced observability concepts like distributed tracing. Have students implement request tracing across services and use the observability data to identify and fix performance issues. Discuss alerting and incident response strategies.

Week 7-9: React Component Testing

Overall Goals

  • Introduce testing principles for frontend React components
  • Teach students how to write unit tests for React components
  • Have students implement comprehensive test coverage for the frontend
  • Show how to test complex interactions and state management

Specific Tasks

  1. React Testing Introduction (Week 7)

    • Introduce React testing libraries (Jest, React Testing Library)
    • Explain the differences between unit, integration, and end-to-end tests for frontend
    • Demonstrate how to set up a testing environment for React
    • Show how to write basic tests for simple components
    • Discuss the testing pyramid and what to test in React applications
  2. Component Testing Implementation (Week 8-9)

    • Have students write tests for more complex components
    • Show how to test components with state and hooks
    • Demonstrate testing user interactions and events
    • Introduce mocking for API calls and external dependencies
    • Discuss snapshot testing and its benefits/drawbacks

Group Work

  • Form frontend testing teams responsible for different parts of the UI
  • Have groups perform code reviews of each other's component tests
  • Organize a component testing workshop where teams collaborate on testing strategies
  • Have students pair program to implement tests for complex components

Instructor Guidance

Weeks 7-9 focus on testing React components. Start by introducing the testing libraries commonly used for React (Jest and React Testing Library) and explaining the differences between unit, integration, and end-to-end tests for frontend applications.

Demonstrate how to set up a testing environment for React and how to write basic tests for simple components. Discuss the testing pyramid and what to prioritize when testing React applications.

In Weeks 8-9, have students write tests for more complex components with state and hooks. Show how to test user interactions and events, and how to mock API calls and external dependencies. If the application uses Redux or another state management solution, demonstrate how to test those aspects as well.

By the end of Week 9, students should have implemented tests for most of the React components in the application. Discuss snapshot testing and its benefits and drawbacks, and have students implement snapshot tests where appropriate.

Week 9-10: Systems Thinking and Microservices

Overall Goals

  • Introduce systems thinking principles
  • Teach students about microservice architecture
  • Explain event-driven systems and message brokers
  • Prepare students for implementing a microservice

Specific Tasks

  1. Systems Thinking Introduction (Week 9)

    • Define systems thinking and its relevance to software development
    • Discuss the characteristics of complex systems
    • Explain how to analyze system behavior and identify feedback loops
    • Show how to model systems using diagrams and other tools
    • Relate systems thinking to software architecture decisions
  2. Microservices and Event Brokers (Week 10)

    • Introduce microservice architecture principles
    • Compare monolithic vs. microservice architectures
    • Introduce event-driven architecture and message brokers
    • Demonstrate how services communicate through events
    • Prepare for the Slack channel microservice implementation

Group Work

  • Have teams analyze the current architecture and identify potential microservice boundaries
  • Create groups to design event schemas for service communication
  • Organize a systems thinking workshop where teams model complex interactions
  • Have students collaborate on designing the Slack channel microservice

Instructor Guidance

Week 9 introduces systems thinking principles and their application to software development. Define systems thinking and discuss how it helps developers understand complex interactions in software systems. Show how to analyze system behavior and identify feedback loops, and how to model systems using diagrams and other tools.

In Week 10, transition to microservice architecture and event-driven systems. Compare monolithic and microservice architectures, discussing the benefits and challenges of each approach. Introduce event-driven architecture and message brokers, explaining how they enable loose coupling between services.

Demonstrate how services communicate through events and prepare students for implementing the Slack channel microservice in the following weeks. Have students collaborate on designing the microservice architecture and event schemas.

Week 10-12: Slack Channel Microservice

Overall Goals

  • Implement a microservice that integrates with Slack
  • Apply event-driven architecture principles
  • Practice working with external APIs
  • Gain experience with real-world integration challenges

Specific Tasks

  1. Microservice Setup and Design (Week 10)

    • Set up the project structure for the Slack microservice
    • Design the service interfaces and event schemas
    • Implement the basic service skeleton
    • Set up the message broker (RabbitMQ, Kafka, etc.)
    • Configure the development environment
  2. Slack API Integration (Week 11)

    • Introduce the Slack API and its capabilities
    • Set up authentication and permissions
    • Implement channel creation and management
    • Handle Slack events and webhooks
    • Implement error handling and retry mechanisms
  3. Integration and Testing (Week 12)

    • Connect the microservice to the main application
    • Implement end-to-end testing for the integration
    • Set up monitoring and observability for the microservice
    • Perform load testing and optimize performance
    • Document the microservice architecture and API

Group Work

  • Form cross-functional teams to implement different aspects of the microservice
  • Have groups design and implement different event handlers
  • Organize integration testing sessions where teams verify their components work together
  • Have students collaborate on documentation and knowledge sharing

Instructor Guidance

Weeks 10-12 focus on implementing a microservice that integrates with Slack. Start by setting up the project structure and designing the service interfaces and event schemas. Implement the basic service skeleton and set up the message broker (RabbitMQ, Kafka, etc.).

In Week 11, introduce the Slack API and its capabilities. Help students set up authentication and permissions, and implement channel creation and management. Show how to handle Slack events and webhooks, and implement error handling and retry mechanisms.

By Week 12, focus on integrating the microservice with the main application and implementing end-to-end testing for the integration. Set up monitoring and observability for the microservice, and perform load testing to optimize performance. Have students document the microservice architecture and API.

Week 13: Bug Fixing and Feature Implementation

Overall Goals

  • Apply all learned skills to real-world problems
  • Practice identifying and fixing bugs
  • Implement new features based on requirements
  • Prepare for professional development work

Specific Tasks

  1. Bug Fixing and Feature Implementation
    • Provide students with a list of real bugs and feature requests
    • Teach debugging strategies for complex systems
    • Show how to reproduce and isolate issues
    • Demonstrate how to implement features in a maintainable way
    • Guide students through the complete development lifecycle

Group Work

  • Form bug-squashing teams to tackle different issues
  • Create feature teams to implement new functionality
  • Organize code reviews and knowledge sharing sessions
  • Have students present their solutions and explain their approach

Instructor Guidance

Week 13 serves as a capstone for the workshop, where students apply all the skills they've learned to fix bugs and implement new features. Provide students with a list of real bugs and feature requests from the learn-ops-api project.

Teach debugging strategies for complex systems and show how to reproduce and isolate issues. Demonstrate how to implement features in a maintainable way, following the best practices covered throughout the workshop.

Guide students through the complete development lifecycle, from understanding requirements to testing and deployment. Form bug-squashing teams and feature teams to tackle different issues, and organize code reviews and knowledge sharing sessions.

By the end of the workshop, students should have gained valuable experience working with a large codebase and be prepared for professional development work.

@stevebrownlee
Copy link
Author

stevebrownlee commented Oct 9, 2025

Content Strategy

Overview

We will be developing markdown content and video content for this experince. We want to simulate an onboarding experience for Talmidge Academy of Coding. Need to explore branding standards.

Chapter and Section Layout

Section: Getting Started

  1. Summary of course (learning objectives)
    1. System thinking for beginners
    2. How to explore and learn a large system
    3. Using AI agent to assisting explore and document the system as you learn
    4. Using the debugger
    5. Testing complex API features incl. intro to mocking
    6. Introduction observability—logging, metrics, tracing, dashboard
    7. React component testing
    8. Intro to microservice architecture
    9. Intro to containerization
    10. Event driven systems
  2. Technical overview of system—includes list of app, system diagram, etc.
  3. Installation and launching of dev environment

Section: Complex API Testing

  1. Testing overview/pyramid graph
  2. Chapter on unit testing with actual code and tests they can run. Mention this is TDD and then never mention it again.
  3. Integration testing—overview and code example from API that includes mocking of Slack API
  4. Instructor will do live workshop
  5. Instructions to work on implementing integration test for Github repo creation for group project teams with Github class mocking

Section: Observability

  1. Why do dev orgs need observability?
  2. Logging (to stdout for start)
  3. Logging published
  4. Metrics overview (show Prometheus here)
  5. Custom metrics (create Prometheus graphs for custom metrics)
  6. Grafana and create custom dashboard widgets

Section: React Testing

  1. How is it different from API testing?
  2. Intro to Jest.
  3. for dave to fill out from here....

Section: Systems Thinking (Microservice)

🧨There is risk in this first version. It is possible that it is beyond the capabilities of a fresh grad. May have to adjust heavily on the fly.

Notes

  1. Give them a starter repo for Hashtagger with commented algorithm in place
  2. Chapter content to provide overview of Monarch and ask them to read specific bits in it that are relevent to building Hashtagger
  3. Chapter content for general process of extracting code from API and moving to Hashtagger. Includes guidance on what the event k/v structure will be without giving it to them.

Chapters

  1. Intro to microservice architecture (pros and cons)
  2. Intro to event-driven systems
  3. Reading technical docs: Have learners read https://www.geeksforgeeks.org/system-design/what-is-pub-sub/
  4. Reading technical docs: Have learners read https://valkey.io/topics/pubsub/
  5. Overview of Monarch and sequence diagram of data/event flow
  6. Guidance on specific parts of monarch code to read and review
  7. Chapter content for general process of extracting code from API and moving to Hashtagger. Includes guidance on what the event k/v structure will be without giving it to them.

Section: Working on backlog

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment