Geek Culture
Published in

Geek Culture

Writing a GOOD Test in TDD

Lets recap Test Driven Development or TDD process.

RED- A new test will initially fail.

GREEN- We work to get the test to pass. In other words we write minimum code/business logic required to pass the test.

REFACTOR- We finally optimize our code/ business logic and run tests again.

So what should we consider when we write a test?

Rule #1

Each test should test one item of functionality only. This means test methods should normally have a single assert…

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Ishan Liyanage

Ishan Liyanage

Passionate Technical Lead, Senior Software Developer and free and open source software advocate. Based in Singapore.