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…




A new tech publication by Start it up (

Recommended from Medium

REST API for Cisco ASA



Single Choice Dialog with Jetpack Compose

C dynamic memory allocation and free

Omnichannel Product Using AWS Services

Intro to Raspberry Pi Projects — Video Transcript

[New Coin Listing] Major(MJR) to Be Listed on DigiFinex

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.

More from Medium

How Does Sequence Diagram Help in Software Development?

Pure Functions in Software Development

How to create deterministic tests

Test Driven Development Primer