
Eduardo
1.6K posts



@mjovanovictech I've always followed that approach, but depending on the complexity of the system, sometimes testing all possible path combinations in integration tests may be overkill. As always, the dev needs to evaluate the trade-offs and decide accordingly
English

Forget about unit tests.
Here's the best type of test to write.
I used to believe this for many years:
- Unit testing for the domain entities and services
- Integration testing for the application use cases
After writing thousands of tests, I no longer believe this to be the best way.
The highest ROI approach is integration testing with real services.
If you can run external services in Docker, use Testcontainers.
If not, create separate service instances you can use for testing.
This will also work in CI pipelines, so even faster feedback loop.
If you can write end-to-end tests, even better.
I'm not saying unit tests are bad.
But you get better ROI with integration testing.
What do you think about this idea?

English

@Rapariga_da_Sup Que continues a fazer o que mais gostas por muito tempo! Força aí, miúda
Português
Eduardo retuiteado
Eduardo retuiteado

@zillinft O medo é tão grande que o pessoal tá dando um oi, tentando cutucar o bicho com a vara de 3 m para não ser mordido
Português

@smileonX @Officer_Stoopz @trikcode Bro, I'm trying to say this respectfully, but... That's not how software development works
English

@Officer_Stoopz @trikcode no, they know nothing about coding, codes didn't change, someone with knowledge will still be able to debug or add new features.
English
Eduardo retuiteado


@DevLeaderCa Reqnroll for BDD, Autofixture for TDD. Both using NSubstitute and FluentAssertions
English

@ograndesa @PortoInsider @diarioas Lembras-te que quando fomos buscar o Hulk ele jogava na 2a divisão Japonesa
Português

@PortoInsider @diarioas Quando são um jogador famoso mas de um país nada a ver, deixa-me logo desconfiado
Português

Juan Riquelme Angulo, o 'Haaland Equatoriano', de 18 anos do Independiente Del Valle, está na mira do FC Porto. O atacante está avaliado em 350Mil €. [@diarioas]

Português

@quaresmajpqp @sharkinho Porque é que a ordem das hipóteses está trocada? O tweet foi feito por AI?
Português

@mgmpl @observadorpt Sim, e eu concordo contigo. Realmente os OCS fazem isso. Em relação ao PS é só estúpido. Mas em relação aos imigrantes, penso que até possam estar a piorar a imagem deles nos casos em que referi
Português

@edmolko @observadorpt Claro que não é. O meu comentário é sarcasmo. Mas é consequência directa do comportamento dos OCS nacionais. Ora fica atento às notícias durante uns tempos...
Português

@mgmpl @observadorpt Eu não sei se isso é uma boa política. Se porventura realmente não souberem a nacionalidade de quem comete uma ilegalidade, toda a gente vai assumir que foram imigrantes mesmo que não tenham sido.
Português

@observadorpt Ora bem. Se foi "carro abriu fogo" quer dizer que era com emigrantes. É como as notícias sobre políticos corruptos, quando não diz o partido já sabemos que é do PS
Português

@MrPeterLMorris @kristijan_kralj In my Integration Tests I use in-memory for local dev, and a real one in CI that catches issues like the one you mentioned.
English

The hidden trap of the Repository Pattern:
Overengineering.
For 2 years, I've been running a quiet experiment:
Building a production .NET app, with semi-complex domain logic, and real-world requirements.
But I challenged one of the most repeated claims in .NET circles:
"You have to use a repository pattern over EF Core to write proper unit tests."
I ignored that advice:
- No generic repositories.
- No IWhateverRepository interfaces.
- DbContext injected directly into services.
- Domain logic pushed to domain classes when needed.
Pure logic got unit tests.
Logic in services got unit tests + EF Core In-Memory provider.
I still checked that everything works with a real DB using integration tests.
I ended up with 927 tests:
- 654 unit tests
- 273 integration tests
And best of all?
My tests were faster to write and easier to maintain.
I haven't missed repositories.
But I realized they were slowing me down in previous projects.
Extra layers don't automatically make the code more testable.
They just made it more abstract and harder to change.

English
Eduardo retuiteado

@tiagopita Eu não sinto inveja porque reconheço que há pessoas melhores que eu em muitas áreas à volta da minha. Se calhar és o melhor em todas as áreas, porque não? Só questiono as tuas afirmações sobre AI e SWE porque não é isso que verifico diariamente.
Português

@tiagopita "tem esta atitude de merda como este tipo." Eu só comentei que a tua recente cruzada contra os Devs me parece excessiva e questionei o porquê. Não leves demasiado a peito. Para quem se diz ser tão experiente em C-level, achei-te demasiado impulsivo. No entanto, não generalizo
Português

@tiagopita Não percebo esse teu ataque recente aos developers ultimamente. À primeira vista, até parece que tens inveja do conhecimento técnico. AI é uma tool, fantástica que nos ajuda a focar em resolver problemas em vez de perdermos tempo na implementação. Problemas sempre existirão
Português














