The Hermetic test pattern

The Hermetic test pattern is the polar opposite of the Spaghetti pattern; it states that each test should be completely independent and self-sufficient. Any dependency on other tests or third-party services that cannot be controlled should be avoided at all costs. It is impossible to get a perfectly hermetically sealed test; however, anytime a dependency on anything outside the test is detected, it should be removed as soon as possible.

Note

The Hermetic test pattern can also be referred to as Test is an Island Pattern, which is a play on the word from an old saying no man is an island.

Advantages of the Hermetic test pattern

The Hermetic pattern is especially appealing when trying to flush out test instability. Here are ...

Get Selenium Design Patterns and Best Practices now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.