TDD Mistake #1: Tests without Pipeline
Is your company jumping straight into Automated Testing, but you don't even have a proper Pipeline yet? You'll face a disaster.
👋 Hello, this is Valentina with the free edition of the Optivem Journal. I help Engineering Leaders & Senior Software Developers apply TDD in Legacy Code.
Many companies make the mistake of jumping straight into automated testing initiatives, but without having a Pipeline (or having a poorly designed Pipeline). The mistake they make is seeing the Pipeline as somehow belonging to the DevOps team, and disconnected from Automated Testing initiatives. Sometimes these initiatives might even be run in parallel.
You do NOT need a Pipeline to write Tests.
We could start writing Tests, but WITHOUT a Pipeline.
Because we do NOT need a Pipeline to be able to write Tests.
The Pipeline is a prerequisite for CI/CD, but NOT a prerequisite for Testing.
But if you have no Pipeline, it’s a recipe for Disaster!
You’ll face these problems when running tests, if you don’t have a Pipeline
We’d have to manually deploy the system to be able to run Acceptance Tests & E2E Tests (manual deployment is time-consuming & error prone)
We don’t know whether the Unit Tests & Component Tests run on our local machine but can’t run anywhere else (i.e., “But it works on my machine“)
That’s why you should setup the Pipeline before writing tests.
I know, most TDD books & courses don’t even mention the Pipeline. You’d have to get a book on Continuous Delivery to learn about Pipelines. Then you’ll have to face the problem of trying to join that knowledge together. Furthermore, you might be overwhelmed - you might not even know what kind of Pipeline you need to minimally get started with writing tests.
This is why, in the TDD in Legacy Code series, we setup the Pipeline (with placeholders for tests) before writing the tests themselves. It provides us with automated execution of tests on an “independent“ machine, so that we have assurance that our tests work.
📖 Pipeline (Summary)
CI/CD isn't just for DevOps!
We need to separate CI from CD. For effective testing we need a CI Pipeline. But to take the pipleline all the way to CD without a complete test suite is to continuously deliever crap.