Skip to Content
View all events

Quality Code Boot Camp

Published by O'Reilly Media, Inc.

Beginner to intermediate content levelBeginner to intermediate

Hands-on techniques to improve your code base

Course outcomes:

  • Understand the key components of quality code
  • Learn the importance of incremental change
  • Explore the relationship between testing and refactoring

High-quality code is easy to understand, cheap to modify, and quick to deploy. But all teams face constraints that affect their ability to produce and maintain good code, and typically, these constraints mean that quality degrades over time.

Join expert Clare Sudbery to take a focused look at how to make a difference in your coding—both legacy and greenfield. You’ll learn how to break everything down into achievable steps so that you can apply improvements to your code. You’ll investigate deployability via continuous integration, flexibility via iterative and incremental development, testability via approval testing, mutation testing, and test-driven development (TDD), maintainability via “many more much smaller steps,” and continuous improvement via refactoring.

All demonstrations will be done using C#, but examples will not rely on advanced language features and should be accessible to anyone who can follow object-oriented code. Practical exercises will be available in at least C#, Java, Python, and JavaScript.

Week 1, Day 1: Making Code Deployable, Flexible and Testable

Week 1, Day 2: Making Legacy Code Testable

Week 2, Day 1: Continuous Improvement—Refactoring Legacy Code

Week 2, Day 2: Advanced Refactoring—Breaking Dependencies

NOTE: With today’s registration, you’ll be signed up for all four sessions over two weeks. Although you can attend any of the sessions individually, we recommend participating in all four.

What you’ll learn and how you can apply it

  • Use mocking and test doubles to test your code
  • Break dependencies using dependency injection
  • Refactor your code using a variety of different methods
  • Use code coverage and mutation testing to test legacy code
  • Use tests to refactor legacy code safely

This live event is for you because...

  • You’re a software engineer who wants to improve your skills.
  • You’re a technical leader who wants to improve the skills of your team.
  • You want to become a technical leader and want to know how to lead software engineering teams to better practices.

Prerequisites

  • A computer with a fully functioning integrated development environment for coding in C#, Java, Python, or JavaScript
  • Access to course repositories set up (GitHub links to come)
  • The ability to code in C#, Java, Python, or JavaScript

Recommended follow-up:

Schedule

The time frames are only estimates and may vary according to how the class is progressing.

Day 1: Making Code Deployable, Flexible, and Testable

Definition of quality code (55 minutes)

  • Group discussion: What defines quality code?; What do you prioritize if you're aiming for quality code?
  • Presentation: Key components of quality code (deployable, flexible and achievable, testable, continuously improving, maintainable)
  • Q&A
  • Break

Making your code deployable (70 minutes)

  • Group discussion: What is/isn’t DevOps?
  • Presentation: The DORA DevOps metrics
  • Q&A
  • Break

Making your code flexible (55 minutes)

  • Group discussion: The difference between increments and iterations
  • Presentation: The importance of incremental change; the connection between iterations, increments, and quality
  • Hands-on exercise: Explore how flow and slack are related
  • Q&A
  • Break

Making your code testable (60 minutes)

  • Group discussion: Good code design guidelines
  • Hands-on exercises: Code a simple problem; identify the connection between test-driven development and code design
  • Presentation: The benefits of TDD; Kent Beck’s rules of simple design; optional homework
  • Q&A

Day 2: Making Legacy Code Testable

Tests and refactoring (30 minutes)

  • Group discussion: Preconceptions about refactoring
  • Presentation: Some refactoring ideas; homework feedback; why tests and refactoring go hand in hand
  • Q&A
  • Break

Using requirements to write approval tests (70 minutes)

  • Group discussion: What do you know about approval testing?
  • Presentation: Getting started with approval testing
  • Hands-on exercise: Write an approval test
  • Q&A
  • Break

Using code coverage (60 minutes)

  • Group discussion: Code coverage and related concepts
  • Demonstration: Using coverage to add approval tests to untested code
  • Hands-on exercise: Practice using coverage to add tests to untested code
  • Q&A
  • Break

Mutation testing (55 minutes)

  • Group discussion: Mutation testing and related concepts
  • Demonstration: Using mutation testing to improve your test suite
  • Hands-on exercise: Use mutation testing to improve your test suite
  • Q&A
  • Break

Making quality code achievable (25 minutes)

  • Presentation: Team cohesion (communication and collaboration); optional homework
  • Hands-on exercise: Identify good collaboration techniques
  • Q&A

Day 3: Continuous Improvement—Refactoring Legacy Code

MMMSS (20 minutes)

  • Presentation: Homework feedback; What is “many more much smaller steps”?
  • Q&A
  • Break

Simple refactoring backed by tests (70 minutes)

  • Group discussion: Refactoring vocabulary; new vocabulary
  • Presentation: Making code easier to read by extracting methods
  • Hands-on exercise: Extract method in practice
  • Q&A
  • Break

Replace conditional with polymorphism (70 minutes)

  • Group discussion: Refactoring tools
  • Demonstration: Replacing conditional with polymorphism
  • Hands-on exercise: Replace conditional with polymorphism
  • Q&A
  • Break

The lift up conditional (65 minutes)

  • Group discussion: Challenges involved in parsing different types of if statements
  • Demonstration: Using the lift up conditional
  • Hands-on exercise: Explore the lift up conditional
  • Q&A
  • Break

Benefits of refactoring (15 minutes)

  • Presentation: The benefits of refactoring and the definition of legacy code; optional homework
  • Q&A

Day 4: Advanced Refactoring—Breaking Dependencies

Mocking and test doubles (70 minutes)

  • Presentation: Different types of test doubles
  • Demonstration: When to use test doubles
  • Hands-on exercise: Explore mocking to choose and implement test doubles
  • Q&A
  • Break

Break dependencies using dependency injection (70 minutes)

  • Hands-on exercises: Test existing code; use dependency injection to make existing code more testable
  • Presentation: The dependency inversion principle
  • Q&A
  • Break

Use parallel change to refactor safely (65 minutes)

  • Group discussion: Misconceptions about refactoring
  • Presentation: Parallel change
  • Hands-on exercises: Review code that needs refactoring; implement parallel change
  • Demonstration: Implementing parallel change
  • Q&A
  • Break

The strangler fig pattern (20 minutes)

  • Presentation: The strangler fig approach
  • Q&A
  • Break

Wrap-up and Q&A (15 minutes)

Your Instructor

Clare Sudbery

Clare Sudbery is an independent technical coach with 23 years of software engineering experience. She specialises in TDD, refactoring, continuous integration and other Extreme Programming practices, also known as XP.

In 2009, Clare abandoned IT to retrain as a high school math teacher, but quickly returned to software, gaining new energy via XP. Clare teaches the Coding Black Females’ Return to Tech programme and co-ran Made Tech’s academy. She has a passion for helping under-represented groups to flourish in tech.

Clare hosted Season One of the acclaimed Making Tech Better podcast, and publishes notes and scribbles on her Medium blog called "A Woman in Technology", on her Clare Wiki website and on her blog called "In Simple Terms". She’s also a published novelist and has presented workshops and talks at several national and international events and conferences.

Clare hosted Season One of the acclaimed Making Tech Better podcast, and publishes notes and scribbles on Medium, on her at medium.com/a-woman-in-technology, clare-wiki.herokuapp.com and insimpleterms.blog. She’s also a published novelist and has presented workshops and talks at several national and international events and conferences.`

linkedinXlinksearch

Skill covered

Refactoring