SOLID principles and Testability

Learn about good testing design and testability in this hands-on course

SOLID principles and Testability background

One-day hands-on training

Good object-oriented design and testability are closely related concepts, and this training gives you an opportunity to learn more about them both. We will be doing a lot of hands-on exercises, it really makes a difference to understand a design principle to see it in code.

If you have a unit test for every unit in your software, then it follows that you must have a design that allows units to be isolated for testing purposes. Highly cohesive units with loose coupling between them was identified as a desirable design characteristic. Code that has unit tests is more likely to contain isolated units.

SOLID is a mnemonic invented by Robert C. Martin to help developers to remember some important design principles that help you to achieve high cohesion and loose coupling:

  • Single Responsibility Principle
  • Open-Closed Principle
  • Liskov Substitution Principle
  • Interface Segregation Principle
  • Dependency Inversion Principle

In this training course, we’ll go through these principles and work through some exercises. All the exercises start with a piece of code that has poor adherence to one or more design principles. The idea is to try to write an automated test for the code without changing it, and discover how difficult that is. When you’ve understood the testability problem, you can more easily identify the design problem and the underlying principle(s) that are not being followed.

Planned learning outcomes:

  • Understand each of the SOLID principles and how they relate to one another
  • Be able to point out SOLID principle violations in sample code and discuss alternative solutions to these violations
  • Understand how a violation of a design principle can impact the testability of a design, as well as extensibility
  • Understand when to use a Stub or a Fake to control dependencies when testing well-designed code.

Attendees are welcome to bring questions or challenges from their own background.

Course Facts

Watches icon

Duration

One day

A Graduation Hat

Type

Mix of theory and hands-on exercises

Two People Icon

Audience

Developers, Lead developers, Architects - some experience of unit testing and object-oriented design

Google Pin Icon

Location

Copenhagen, Stockholm, Oslo, Gothenburg, Aarhus, Malmö, or on-site.

Want to book a training course?

Contact: Adam Henriques

ah@praqma.net+45 2812 9094