Skip to content
  • Sign In
  • Try Now
View all events
Continuous Delivery

Refactoring for Continuous Delivery

Published by O'Reilly Media, Inc.

Intermediate content levelIntermediate

A trunk-based approach

Refactoring can often seem like a daunting task, particularly considering the time it can take and the perils of multiple people working on the same code base. An understandable concern for development teams is the possibility that someone could inadvertently make things worse.

Join expert Clare Sudbery to learn how you and your team can refactor often, deliberately, and without having other work grind to a halt. You’ll explore the benefits of a trunk-based approach to refactoring, so that the process happens during daily work, allowing for continuous delivery, facilitating feedback among team members, and helping avert merge issues. You’ll learn how to avoid changes that break other people’s code, how to consider your colleagues’ needs, and how refactoring in small chunks can benefit a team’s efforts to maintain clean, concise code.

What you’ll learn and how you can apply it

By the end of this live online course, you’ll understand:

  • Why you should be mindful of your colleagues when refactoring a shared code base
  • How to avoid changes that break other people’s code
  • The benefits of refactoring in small chunks

And you’ll be able to:

  • Avoid negative impacts of refactoring
  • Plan how to fit refactoring around other work
  • Ensure that refactoring doesn’t derail “business as usual”
  • Persuade your team members and stakeholders of the benefits of continual refactoring

This live event is for you because...

  • You’re a developer who’s working with a code base that needs refactoring.
  • You’re a developer who’d like to coordinate your team’s refactoring efforts.
  • You’re a developer who wants to make the case for continual refactoring.

Prerequisites

  • A computer with both the tooling necessary to write code in your language of choice and an IDE installed (Visual Studio Code, Rider, IntelliJ or Visual Studio)
  • Experience with refactoring large code bases
  • The ability to write code in at least one of the languages listed here
  • Some experience of writing unit tests
  • Experience using a source control tool such as Git

Recommended preparation:

Recommended follow-up:

Schedule

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

Refactoring with tests (40 minutes)

  • Presentation: Workshop structure
  • Group discussion: Where are you from and what would you recommend a visitor to your environs do?; How confident do you feel about your refactoring skills?; the benefit of tests when refactoring
  • Hands-on exercise: Refactor the tennis game, with unit tests provided
  • Demonstration: Sample solution to tennis refactoring exercise
  • Break

Refactoring in branches (70 minutes)

  • Presentation and demo: Recap of the Gilded Rose Kata; introduction of code to merge from another branch; Git merge solution
  • Hands-on exercises: Execute a Git merge; solve the Gilded Rose Kata with unit tests provided; merge code from a separate branch
  • Discussion: What problems did the merge cause?; What could be done to ameliorate those problems?
  • Break

Many and much smaller steps (45 minutes)

  • Presentation and demo: How to avoid merges (small steps, always run the tests, commit moves separate from code changes, use a trunk-based approach, merge after every change, nonbreaking changes, backward compatibility)
  • Q&A
  • Break

Trunk-based development—Part I (45 minutes)

  • Presentation: Redoing the refactoring exercise
  • Hands-on exercises: Solve Gilded Rose Kata in small steps, pushing every change; merge with another branch
  • Group discussion: What difference did the new approach make?; What challenges did you face?
  • Break

Trunk-based development—Part II (30 minutes)

  • Presentation and demo: Working with feature flags; example solution
  • Hands-on exercise: Use feature flags in Gilded Rose Kata
  • Group discussion: What might you do differently as a result of this class?

Wrap-up and Q&A (10 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