Discover and read the best of Twitter Threads about #TDD

Most recents (23)

Siguiendo la lógica de #TDD, tus primeros tests en código de producción cuando no tienes experiencia no deberían ser siguiendo TDD

[ H I L O ] ⇩
La lógica de TDD se basa un ciclo red-green-refactor basado en baby steps o pequeños pasos.

Escribes el test más sencillo

El primer step que falle.

El segundo step que funcione.

El tercer step refactor para optimizar el código

Este ciclo se repite a medida que añadimos tests
Esta lógica de ir dando pequeños pasos sigue la tercera ley de hábitos, hazlo fácil.

Es importante para construir un hábito como el de escribir test, empezar haciéndolo fácil porque en base a obtener la recompensa querrás hacer más.

Ya llegará el momento de hacer TDD.
Read 7 tweets
¿Escribes código utilizando el sistema 1 de pensamiento o el sistema 2?

¿Sabes que relación tienen con #tdd?

Sigue leyendo ⤵️

Nuestro cerebro es increíble.

Lo que ocurre es que a veces estamos tan convencidos de sus capacidades y sus resultados que pasamos por alto las trampas que nos hace y los errores que nos lleva a cometer.

Conocerlas y comprenderlas es fundamental para tomar mejores decisiones.
El sistema 1 de pensamiento es implícito, es el encargado de dar respuestas rápidas.

Lo hace de manera rápida y frecuente.

Lo hace de manera emocional, estereotipada y hasta subconsciente.

Es útil en tareas automatizadas como andar o pestañear y puede hacerlas a la vez.
Read 10 tweets
Rescatando joyas de youtube mientras dure twitter

String Calculator kata by @ploeh

#tdd #Kata #RIPTwitter #TwitterTakeover #TwitterOFF
String Calculator kata with AutoFixture. Exercise 1
String Calculator kata with AutoFixture. Exercise 2
Read 10 tweets
On granularity of tests focused on behaviour.

#tdd #bdd #testing #programming

A function is one of the smallest units of behaviour. Given an input, it returns the output.

This means that given the context (input), the function's behaviour can be verified by calling the function and looking at the outcome (output).

🧵2/22 Pure function
Notice that the most straightforward outcome to verify is the function's return value, but it's not the only outcome we can look for. Functions can have side effects, modify state, interact with collaborators, etc.

Read 22 tweets
Why do I practice #tdd you ask?

There’s a number of paths I could’ve taken (or combinations of the four).

1) Write no automated tests.
2) Write tests before writing code.
3) Write tests at the same time as code.
4) Write tests after writing code.

🧵 Image
On a project that’s worth practicing #DDDesign, having no tests is not an option. Continuous refactoring towards deeper insights is the foundation of #DDD and it’s too scary to refactor with no tests.
As a result, refactoring won’t happen without tests and code will rot. Over time our code and our understanding of the domain will either diverge, or we’ll stop looking for insights to avoid change.
Read 17 tweets

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.


#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.
Read 10 tweets
0⃣ Clean Code Series: Variables📒🧑‍💻

It's a guide to producing readable, reusable, and refactorable software in #php #ruby #javascript #python #java, etc. - Software engineering principles, from Robert C. Martin's book "Clean Code"


Thread (9)🧵👇 Image
1⃣ Clean Code Series: Variables📒 🧑‍💻

☑️ Use meaningful and pronounceable variable names Image
2⃣ Clean Code Series: Variables📒 🧑‍💻

☑️ Use the same vocabulary for the same type of variable Image
Read 12 tweets
There are a lot of 🔥 takes out there about Test-Driven Development (#TDD)

Let's bust 5 of the most common myths! 🧵 👇
Myth 1️⃣: TDD takes too long.

Yes, you will spend a bit more time upfront writing tests versus just writing production code.

However, typing is not the bottleneck for developers. Manually verifying a system works takes way longer.
Myth 2️⃣: TDD is just about writing tests.

With TDD, tests are the means to the end. TDD is all about writing production code in a different way.

1. Write a small, failing test.
2. Write just enough code to make the test pass.
3. Refactor.
Read 6 tweets
In unit testing, what's a unit? Is it a method? Is it a class? Is it a module? No. Let's clarify this once and for all.

In unit testing, a unit isn't an element of structure. In unit testing, a unit is an individually observable element of BEHAVIOR.

#TDD #BDD #ATDD #UnitTesting
BTW I use @mfeathers explanation that "unit tests are tests that run fast" as a possible valid (foundation/element of a) definition of the term unit test.
Stop arguing which element of structure is meant by unit. Unit does not denote an element of structure. It denotes an element of behavior.

And that shouldn't be surprising: Tests are executable specifications of required BEHAVIOR (NOT: STRUCTURE) by example.
Read 14 tweets
for that first iteration of the code, simple don't mean shortcut:

simple != easy
simple != hacky
simple != rushed
simple != poorly written

even the first cut, MVP, needs to be changeable, testable, clear, expressive, etc

#TDD #technicalDebt #refactoring
the "make it work" part (K.Beck) always gets mistaken to mean, hack at the code, squeeze, force-fit, finagle, the easiest and quickest thing that'll get the managers, customers, users off our back.

but we just end up on the wrong side of karma

it just adds high interest technical debt, and need to refactor out:

- initial understanding, with deeper insight into the feature
- tightly coupled, low cohesion, incoherent, viscous, rigid, fragile, immobile code


Read 3 tweets
TDD is about design. So with @eventmodeling
it goes out the window. What you have is unit tests to help give you regression tests. But even then, you are doing OCP more than recent years allowed. So plow through the happy path ASAP. Use THAT as the backbone to your system.
More on this at tomorrow's meetup. This is truly agile. I never thought I would ever think to discourage #TDD. But here I am saying exactly that after practising it for 20 years.
So plow through the happy path as fast as possible. Add unit tests later to make sure you covered all the nuances of the data transformations. The regression tests aren't as necessary if you are doing #eventsourcing as you have a bread-crumb trail of how you got into any issues.
Read 5 tweets
#UnitTesting and #TDD continue to deliver

Yesterday, I was fighting a pretty nasty bug, all the unit tests passed

I knew there was a corner case not covered by the unit tests but what was it?

Reviewing my assumptions, the key: hw was not exactly sync
Need to test for data 1/
Not aligned, I added new unit test for that assumption, of course the test failed

Now, I just needed to modify the code to make that test pass and not make the rest of the tests fail

The best part, i could work with very small and manageable arrays (instead of the 2GB array) 2/
Once all the tests passed, tested with hardware and everything just worked!

Let's see why this worked:
1) there were 35 unit tests that tested the "happy path" and some corner cases
2) I could confidently modify the code and know I would be alerted if I broke existing code
Read 5 tweets
In my #TDD trainings, I sometimes say that I do not test code that is "too simple to break"; Code where:

1. The chance of the code breaking is very low
2. *If* the code breaks, we would see immediately

What do I mean by that? A thread... 1/
I wrote the following Typescript code running in #electronjs:

const { dialog, } = remote
const filePath = dialog.showSaveDialogSync({...})
if(filePath) {

The code is very hard to test, but I'm OK with that, b/c it fulfills the above criteria. 2/
Before I go into why the code is "too simple to break"... Why is it hard to test?

Well, "dialog" (and even "remote") is not available during unit testing. And even if it was, it would open a dialog that I'd have to remote-control. Not cool in a test. 3/
Read 12 tweets
#DeliveryConf @MrThomasRayner: Messy PowerShell behaviors: A lack of tests, no signed code (not good!), a lack of linting, no peer review (this is a big one!), lack of difference between artifacts in source and prod, no approval, and no dev env.
#DeliveryConf @MrThomasRayner: The same concepts from #CICD that we heard in the keynote earlier are applicable to PowerShell!
#DeliveryConf @MrThomasRayner: A lot of the people doing PowerShell might not have the background in development to provide the basics like storing prod code in source control, having peer reviews to avoid blinders and edge cases, and approval workflows.
Read 13 tweets
تابعت النقاش حول منهجية ال #Agile اللي بدأها الدكتور مازن @mznmel وخلوني ألخص وجهة نظري.
١- الضعف التقني (الشديد أحيانًا) لدى الكثير من فرق البرمجة في السعودية والقفز السريع للادارة هربًا من البرمجة مشكلة كبيرة. شخصيا غير مقتنع بمدير منتج برمجي ما اشتغل برمجة ٥-١٠ سنوات.
ما أعرف صراحة كيف شخص يبي يصير مدير منتج برمجي او يصير scrum master وهو لم يعمل قبل كمبرمج. أحد متطلبات التوظيف ك product manager في قوقل مثلا هي ان تكون software engineer بخبرة طويلة.
٢- هذا الضعف يؤدي الى عدم فهم عمل المبرمجين وسوء (او المبالغة ب) استخدام منهجية ال #Agile (كيف ومتى تستخدم🤔). ما يهمني لو تقرا الف كتاب عن الموضوع. اذا ما اشتغلت بيدك برمجة ضمن فريق لسنوات وحسيت بمشاكل ال delivery وعشتها راح اعتبرك غير فاهم لل #agile بغض النظر عن شهاداتك.
Read 20 tweets
#TDD, #CodeReview and #ContinuousIntegration in action - here is how with @marcandsweep we develop new features in #JaCoCo (
as an example let's have a look at…
… first we add high level "validation" test to study desired behavior, this test targets Records ( that are #JDK14 Preview Feature (,
so build fails locally, but only on JDK14 …
… yes - locally for development we have many #Java versions installed …
Read 12 tweets
Oh, dang. Now I’m all riled up & can’t focus. Been wanting to go toe-to-toe with <them> in a discussion about #TDD for over a decade. I think I’m going to have to vent. Here. Now.

First, the history of my introduction to <them>. We met, at a conference, and they said “Ah! You teach TDD? That stuff is dangerous! If Kent Beck were in Europe, he’d be imprisoned for the damage he’s done!”
Let’s generously assume they were using hyperbole, or really angry about something else, or needing therapy. Assume good intentions.
Read 23 tweets
I can answer the questions from my talk at @jaxcon today. There were only two.
@jaxcon "Can you recommend a book on evolutionary design?"

I can recommend a few. You can probably feel comfortable starting with any of them.

- Beck, _Test-Driven Development: By Example_
- Koskela, _Test-Driven_
- Jeffries, _Extreme Programming Adventures in C#_
Even my own book, _JUnit Recipes_, has content on evolutionary design. I had agreed with the publisher _not_ to write a book about #tdd, but rather about how to use #junit, but in those recipes you will find some parts that start "...and if you're doing TDD, then you will...".
Read 15 tweets
Nessa mini-thread, vamos explorar conceitos sobre Testes Unitários e #TDD. Vem comigo! 👇
Testes Unitários, de Integração e End-to-End são tipos de testes automatizados que compõem o núcleo do Continuous Delivery, uma metodologia de desenvolvimento que permite que você suba implementações para produção em dias ou horas, ao invés de meses ou anos.
Cada tipo de teste possui um papel único e isolado. A partir de agora, iremos começar a explorar conceitos de Testes Unitários com TDD.
Read 14 tweets
All of you #recruiting #fullstack developers, or calling yourselves #fullstack #software #developers, this is the stack. I call #shenanigans.
#UI & #UX
WAF and client-side #security
Client-facing #performancetesting
Caching & #CDN
Identity management
#Database access patterns
Build servers (#Jenkins)
Source code management
Deployment methodologies
Infrastructure Security
Concurrent programming
Backend performance testing
Storage subsystems
Messaging subsytems
Read 4 tweets
Getting started with Want to succeed with #TDD ? Stop writing tests! @BurkHufnagel #TDD #DevNexus…
We work with software that's way more complex than a simple shape like this. Reasonable people may see the same thing in different ways, based on their perspective! @BurkHufnagel #TDD #DevNexus
You have a goal that you share with me: you want delivering better code faster
... not *writing* code more quickly! @BurkHufnagel #TDD #DevNexus
Read 36 tweets
Bir yazılım geliştiricinin bilmesi gerekenlerle ilgili 15 maddelik flood geliyor.. Mümkün olduğunca fazla keywordü bir araya toplamaya çalıştım.
Hadi Başlıyoruz!

#Developer #Software #Java #code #kod #yazılım #development #computer #bilgisayar #tool #PC #IT #web #tech #data
1-Temel veri yapıları (linkedList, map, tree vb) ve temel algoritmalar (sıralama, arama vb)

Sıfırdan kodlama ihtiyacınız büyük ihtimalle hiç olmayacak. Ancak ihtiyaç anında doğru yerde doğrusunu seçebilmek için o veri yapısının veya algoritmanın nasıl çalıştığını bilmeniz şart
2- Network Temelleri

OSI Modelini ve 7 katmanı; temel protokolleri(#TCP-IP, TCP-UDP, #HTTP, #FTP), güvenlik protokollerini(#HTTPS, #SFTP, #SSL), monitoring protokolleri(#SNMP, ICMP) bilmekte fayda var. Ayrıca ağ ekipmanlarının görevlerini tanımak ve 7Layer yerlerini bilmek lazım
Read 16 tweets
Some days I'm really frustrated by people holding opinions in the face of experiments and data showing the opposite. It's one thing to say that the experiment isn't valid (and then please say why you think so), it's another to misread it entirely.
I'll be the first to admit that experiments around things like TDD are hard, but Medium posts like this one don't even attempt to look at the literature.…
To inject some data into the discussion,… is a good survey on the research on #TDD through 2014.
Read 13 tweets

Related hashtags

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.00/month or $30.00/year) and get exclusive features!

Become Premium

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

Donate via Paypal Become our Patreon

Thank you for your support!