Make Code More Testable

About This Class

This interactive online class looks at the problems we encounter at the code- and design-level, such as code that is hard to read and maintain, and designs that cause the code to be hard to understand and test. We look at finding messy code by their “smell”, ways to tidy up those messes using refactoring. We focus on automated refactorings in IntelliJ IDEA so that we can improve legacy code that isn't well-covered by existing tests. We finish with ways to improve the reliability of your code through well-written Unit Tests and Test-Driven Development.

Prerequisites

You don't need to be a Java expert, but you will need to be able to read and write straightforward Java code as all exercises and code samples are in Java. Since we won't be using any complex Java libraries, if you know C#, you'll also be able to get a lot out of this class. For JavaScript/TypeScript you won't get as much as we'll lean a lot on automated refactorings that can't be easily done in JS/TS, however all of the concepts still apply to object-oriented code.

Class Format & Schedule

This is an online, real-time, interactive class taught through Zoom, starting at 10am PDT (1700 UTC) for 3 hours (including breaks). The class is spread across 4 days to fit in your day, as well as provide lots of sleep cycles in between to improve your learning.

The Content

Code Smell: Long Method

  • What they are, and a long look at the Long Method code smell.
  • Exercise: find code smells

Refactoring & Testing

  • What refactoring really is (and what it's not)
  • Rules of refactoring
  • Four types of refactorings
  • Revealing hidden design by continually applying Tiny Refactorings
  • Exercise: refactor away some code smells

  • Boundaries and refactoring at different levels

  • Tests and how they support refactoring

  • Exercise: run and examine tests

Primitive Obsession Code Smell & Refactoring

This code smell is often overlooked, but it's one of the most common code smells and refactoring away that smell (through encapsulation) is one of the most powerful ways to improve your code's design.

Exercise: identify and refactor Primitive Obsession.

Refactoring Heuristics

A set of a dozen heuristics that you can apply to your code base to improve the readability of the code as well as the testability.

Test-First Thinking

Even when you can't do Test-Driven Development, learning the Test-First Thinking and the Two Test Questions make it easier to write testable code, even in a poorly tested codebase.

Good Unit Tests

What are good unit tests? How to decide what test to write first? And what tests do you write next?

Test-Driven Development

End with a taste of TDD and get an understanding of TDD as a complete process.

Tickets Prices in USD

Schedule

August 31st, 2020

10:00am – 1:00pm PDT
Day 1 (of 4)

This is the first day of class, lasting 3 hours. Starts promptly at 10am PDT (1700 UTC) and goes to 1pm PDT (2000 UTC).

September 1st, 2020

10:00am – 1:00pm PDT
Day 2 (of 4)

This is the second day of class, lasting 3 hours. Starts promptly at 10am PDT (1700 UTC) and ends at 1pm PDT (2000 UTC).

September 2nd, 2020

10:00am – 1:00pm PDT
Day 3 (of 4)

This is the third day of class, lasting 3 hours. Starts promptly at 10am PDT (1700 UTC) and ends at 1pm PDT (2000 UTC).

September 3rd, 2020

10:00am – 1:00pm PDT
Day 4 (of 4)

This is the last day of class, lasting 3 hours. Starts promptly at 10am PDT (1700 UTC) and ends at 1pm PDT (2000 UTC).

Interested in future courses? Enter your Name and Email:

Additional Information