oliverdavies.uk/source/_daily_emails/2023-10-04.md

22 lines
724 B
Markdown
Raw Normal View History

2024-01-03 20:00:00 +00:00
---
title: >
2024-02-07 20:01:19 +00:00
The best solution is the one that gets the tests to pass
2024-01-03 20:00:00 +00:00
pubDate: 2023-10-04
permalink: >-
2024-02-07 20:01:19 +00:00
archive/2023/10/04/the-best-solution-is-the-one-that-gets-the-tests-to-pass
2024-01-03 20:00:00 +00:00
tags:
2024-02-07 20:01:19 +00:00
- software-development
- automated-testing
- test-driven-development
2024-01-03 20:00:00 +00:00
---
As I said yesterday, there is no perfect solution or approach for every situation.
However, when doing test-driven development, there is a best solution.
The simplest thing that gets a failing test to pass.
Whether it's hard-coding a return value or putting the initial logic in a Controller, that's the objective.
Once the test is passing, you can refactor the code or continue writing tests, which will each have their own best solution.