Dave Farley Profile picture
Apr 14 10 tweets 3 min read
TOP 5 TIPS FOR TDD

Last night's video reminded me that there are a lot of good developers out there still making simple mistakes when it comes to #TDD.

Below are my tips for success and why it WILL work for you.

A THREAD 🧵🪡

#SoftwareDevelopment #SoftwareEngineering
1) Always start with a test.

Writing the test first shapes your design for the better. Starting with a test will set you up to code in an attempt to pass your test, rather than continuously going back to fix code that's tested too late, and failing.

Start as you mean to go on.
2) New project? It's TDD time.

There's no better time to start using a modern software engineering technique like TDD than when you start new work.

It's a clean slate and a chance for you to make better software and reduce wasted time.
3) Focus on the outcome.

When you write a test think about the result. Look at externally visible behaviour, not the implementation.

Results are king.
Before I go on to the final two pieces of advice, I have a FREE TDD work along on my course site.

⭐ It's got some great 5 star reviews, so well worth a look.

FREE TDD TUTORIAL 🔗 courses.cd.training/courses/tdd-tu…

GET 15% OFF FUTURE COURSE PURCHASES WHEN YOU COMPLETE A FREE COURSE. Image
4) What parts of your code REALLY need to change.

When introducing TDD to existing code, focus only on the parts of the code you need to change to get work done.

Don't waste time. Better software, FASTER.
5) Refactor when you pass a test.

Always look for a chance to make the code, and test, better.

Take your opportunities to improve your software wherever you can.
That wraps up my top tips but of course... there is a lot more to TDD than that!

My course 'TDD & BDD: Design Through Testing' is available for pre-order NOW! 👉 bit.ly/3JB5smY

The skills you will learn in this course will lead to... 👇
• Long-lasting tests that are resilient to changes in the code.

• The ability to “Listen to the code” to modify your designs for the better.

• A 60% reduction in bugs in production.

• Better job prospects and more lucrative projects.

ORDER NOW 👉 bit.ly/3JB5smY
TDD is creating some of the best software designs in the world. It's an incredibly powerful technique and one that every developer should be familiar with.

The results can be INCREDIBLE.

I'll end with this... "TEST ALL THE F***ING TIME!" 😂

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with Dave Farley

Dave Farley Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Don't want to be a Premium member but still want to support us?

Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us on Twitter!

:(