# Test methods coupling

DevFeed: [Test methods coupling](<https://devfeed.tech/articles/test-methods-coupling-27262.md>)

Original publisher: [Read original article](<https://blog.pchudzik.com/201610/test-methods-coupling/>)

Published: 2016-10-29T00:00:00Z

Content type: opinion

Language: en

Sources: [Paweł Chudzik](<https://devfeed.tech/sources/pawe-chudzik.md>)

Topics: [unit tests](<https://devfeed.tech/topics/unit-tests.md>), [maintenance](<https://devfeed.tech/topics/maintenance.md>), [Code](<https://devfeed.tech/topics/code.md>)

Tags: [change](<https://devfeed.tech/tags/change.md>), [complexity](<https://devfeed.tech/tags/complexity.md>), [maintenance](<https://devfeed.tech/tags/maintenance.md>), [unit-tests](<https://devfeed.tech/tags/unit-tests.md>), [verify](<https://devfeed.tech/tags/verify.md>)

## AI overview

The article explains how shared, complex setup in unit tests creates coupling and shared state across test methods. It argues that this shortcut makes tests harder to understand and maintain, especially when requirements change or bugs are investigated.

## Source excerpt

Sometimes when unit tests setup is complex we are tempted to take shortcuts and write single setup for all tests which will save as few keystrokes. In the time of writing the test it might feel like a good idea to configure complex unit test setup and reuse it in all test. This way we avoid code duplication and we create a more condensed test. This approach looks good only in the time of the writing tests. Then there is a time when unit tests must be maintained. This is the time when you usually realize that saving few keystrokes wasn't such a good idea. Read more