Day 3: Implementing MVP for Recipe Searching using TDD 🧐

19 Jun 2023

Hi everyone! πŸ‘‹ Let’s catch up on my coding journey.

Before today, I set up some basics:

1️⃣ Swiftlint for neat code. πŸ› οΈ

2️⃣ I split the project into parts: recipe searching, shared UI, and network stuff. 🎯

3️⃣ I also used Dependencies to keep track of my DI (short for Dependency Injection). 🧩

After that, I was ready to jump into the real work!

My Task Today πŸ“

My goal was to build the first version of recipe searching with Test-Driven Development (or TDD). πŸ§ͺ Here’s what I did:

πŸ” I made a simple UI with a search bar and a list of recipe suggestions.

πŸ§ͺ I wrote two unit tests:

πŸ”„ With Dependencies, I can choose the version I need for preview, test, or live run.

What Did I Learn? πŸŽ“

βš™οΈ Start TDD from the outside (the dependencies) and move inward (toward the ViewModel).

πŸ“ Drawing the flow and functionalities on paper helps me understand what to test.

πŸ”Ž I should write down all the tests I need before adding testing logic.

And here are my sketches and plans:

Project Structure Project Structure Project Structure

That’s all for today, folks! Can’t wait to share more soon. Happy coding! πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’»