Home / Companies / Luciq / Blog / February 2019

February 2019 Summaries

2 posts from Luciq

Filter
Month: Year:
Post Summaries Back to Blog
You're working on a new feature and suddenly an old feature stops working even though you wrote unit tests. Or you're refactoring legacy code and you think it's done, but suddenly you find a lot of bugs. This is a common problem that can happen when testing software, where the test results give a false positive about the software, indicating that it's working when it's not. To solve this problem, Test-Driven Development (TDD) is employed, which involves writing tests first and then writing code to make those tests pass. This approach forces developers to see their failing tests and understand how to turn them into green by fixing the problems. TDD turns testing into a design activity, helping to keep code as simple as possible so it's easier to understand and modify. It also provides feedback on both implementation and design quality.
Feb 28, 2019 1,711 words in the original blog post.
The text discusses Test-Driven Development (TDD), emphasizing its role in preventing bugs and ensuring software quality by writing tests before code. Unlike traditional unit testing, where tests are written after the code, TDD requires developers to write tests first, which helps clarify the intended functionality and maintain simplicity in code design. The process involves creating user stories with clear acceptance criteria, writing end-to-end, integration, and unit tests, and iteratively developing code to pass these tests while keeping the design straightforward and understandable. The text provides an example of a TDD project, where an app displaying a list of movies is developed, highlighting the steps of writing tests, setting up a mock network layer, and implementing the code to satisfy various testing levels. It also mentions using tools like Swifter for stubbing network requests and underscores the importance of separating responsibilities in code, such as parsing and fetching data in distinct classes. The conclusion stresses that TDD not only aids in new feature development but also provides quick feedback on code issues, ensuring robust integration without backend dependencies.
Feb 28, 2019 2,276 words in the original blog post.