Four Pillars of a Good Test (Khorikov) (2024)

In his book “Unit Testing Principles, Practices and Patterns”, Vladimir Khorikov outlines four pillars of unit test design. This learning hour introduces them.

Summary

  • 5 min connect: test design principles
  • 10 min concept: Four pillars
  • 15 min concrete: Review sample tests
  • 20 min concrete: Write tests for WordWrap
  • 5 min conclusions: discuss which pillar your tests have most trouble with

Connect - web hunt test design principles

What test design principles do you know already?

For example people might talk about the test pyramid, or white box testing, or “don’t mock what you don’t own”.

Concept - Four pillars of a good test

Vladimir Khorikov describes these pillars of a good test in his book “Unit Testing Principles, Practices and Patterns”:

  • Protection against regressions
  • Resistance to refactoring
  • Fast feedback
  • Maintainability

Explain them.

Concrete - examine sample tests

Have them review the example test cases for MessageRenderer. For each one, which pillar(s) are in trouble?

Concrete - write tests for WordWrap

One of the pillars is “Resistance to refactoring”. That means the design of the code could change without the test needing to change. Take a look at WordWrap-TestDesign-Kata. In this exercise there are several designs for the same functionality. Write some test cases that work for any of the implementations. Aim to cover all the interesting functionality and edge cases.

Evaluate your tests against all the four pillars. In particular, “Resistance to refactoring”. What is it about this code that makes it easy to score well on that pillar?

Conclusions - how about your test code?

In your team, which of these test design pillars do you have the most trouble with? Discuss in pairs. Look for examples in your sourcecode that are particularly bad.

Four Pillars of a Good Test (Khorikov) (2024)
Top Articles
Challenging a PIP decision - the tribunal hearing
How to close your Crypto.com Exchange account | Crypto.com Help Center
Beaufort Mugshots Last 30 Days
Infodog Entry
Select Truck Greensboro
Retroarch Bios Pack Steam Deck
Dmitri Wartranslated
Pnc Bank History Wikipedia
Book a Cruise | Search Cruise Holidays | P&O Cruises
Ups Cc Center
Tmj4 Weather Milwaukee
MBTA officially announces Sept. 30 date for partial reopening of Winchester Center Commuter Rail Station
Avis sur le film Sleepers
Oracle Ttec Direct Deposit
Molly Mae Scheider
Genesis 1 Mission Loot Table
Lolalytics Aram
Combat Rogue Bis Phase 2
Kilroy Realty (KRC) Earnings Date and Reports 2024
Ifate Yes Or No
Ww2 Solarmovie
Votes Of Opposition Daily Themed Crossword
Watch Mexico Vs Poland Free
Beauty Supply Store Clinton Nc
2003 Chevrolet Corvette Z06 Coupe On for sale - Portland, OR - craigslist
Qdoba Gull Road
G 037 White Oblong Pill
Matthew 14 Nasb
5 Things You Didn’t Know About Your Belly Button
شيراز كرم تويتر
Lucki White House Lyrics
Face Split Diving Accident 2022
Arre St Wv Srj
Hot Rod Dreamworks & Collision Repair Llc
R/Sellingsunset
[PDF] fmj 1900 02 - Free Download PDF
Sailboat - sailing yacht - for sale
North Jersey Creiglist
Saint Frances Cabrini West Bend Wi
Victoria Medlin Cause Of Death
Utah Veterinarian Dr Artz
Missing 2023 Showtimes Near Cinemark Beaumont 15 And Xd
New York Health Commerce
Narrative - Examples and Definition of Narrative
Select Truck Greensboro
Vidant My Chart Login
First Lady Nails Patchogue
Tsc Boots Sale
2021 GMC Sierra 2500HD AT4 4x4Crew diesel for sale - Kernersville, NC - craigslist
Frbo Properties
Log in or sign up to view
Latest Posts
Article information

Author: Amb. Frankie Simonis

Last Updated:

Views: 6234

Rating: 4.6 / 5 (56 voted)

Reviews: 95% of readers found this page helpful

Author information

Name: Amb. Frankie Simonis

Birthday: 1998-02-19

Address: 64841 Delmar Isle, North Wiley, OR 74073

Phone: +17844167847676

Job: Forward IT Agent

Hobby: LARPing, Kitesurfing, Sewing, Digital arts, Sand art, Gardening, Dance

Introduction: My name is Amb. Frankie Simonis, I am a hilarious, enchanting, energetic, cooperative, innocent, cute, joyous person who loves writing and wants to share my knowledge and understanding with you.