Is TDD Worth It? 😅

preview_player
Показать описание
Follow for more Android & Kotlin tips 🙌
Рекомендации по теме
Комментарии
Автор

I write tests for usecases (VMs should be as skinny as possible), and mock as little as possible. My rule if thumb is - if the test is more difficult to write than the thing you're testing, you're testing the wrong layer.

philblandford
Автор

On my team we started a working model combining TDD and Pair Programming. We would pair and do TDD on the ViewModel, treating it as a contract between the View and the Data/Repository. Then split up and implement each of those separately given the completed VM with tests. It was not perfect and we definitely needed to adjust the VM at times, but overall it was a good experience and we thought it worked well.

ddaypunk
Автор

I'm doing both, while TDD is a bit more counter intuitive, the upside is that it forces you to plan ahead edge cases which can potentially save you some time (sometime, handling some edge cases forces you yo rewrite the whole implementation) and predicting edge cases is just a very important skills to acquire as a programmer

vulkanosaure
Автор

If you are writing function before test then it is not TDD. TDD is not a testing practice, it is a software design. Testing function is just another benefit, not the actual purpose. Just saw Christopher perry said the same thing.

sytrtube
Автор

TDD tests can be usually discarded after implementing them. You can save them, but, mostly, they're just a design step, you don't need to keep them around once you're happy with the design.

gJonii
Автор

TDD is more about incrementally designing your system than testing its functionality. You are expressing your design intentions in code.

briancolfer
Автор

I started doing TDD back in 2014, and I still test-drive my code as of today.

I couldn't recommend this practice enough.

jov_mit
Автор

My approach to testing is quite simple. I take one scenario where a failure must occur and another scenario that has to be successful. That's it, so whenever i break something, the tests are there to help me, and if there are some special use case i would write test for them too. Like they say, keep it simple

oumardicko
Автор

TDD was never intended as a general concept.

korbendallasmultipass
Автор

Thanks for the short video but it looks very misleading and hints the author never learned the TDD practice but had some experience with unit tests though.
TDD is not about writing your tests before you write a function. You write a single test (or a part of it) and then production code to let the test pass. Not all tests, not even several. Next thing is you don't write a test to verify a function. A test is created when your system needs some new behaviour. You add a test first to require the behaviour and it initially shows a red test, indicating the behaviour is not in the system. Then you write production code to fulfill the requirement and the test passes. So it's nonsense to say that TDD can be useful when you roughly know what a function does but it's not the case every time. Because if you are writing some code you must know what you are implementing at the moment, otherwise what are you typing? And if you know what your system needs to do you can always write a test for it. At this point you actually don't need to know how exactly it will be implemented.

alexanderj
Автор

You are the Best, always watching you ❤

ibrahimaydn
Автор

I don't know about TDD. I just don't see how benefits can outweigh the problems. So many things can change during the development. If during implementing a function due to some unforeseen problems I'll have to change how it works 3-4 times, then what? I'm supposed to write 4 tests just to delete them? That makes no sense to me. It's so much easier to have an idea how it should work in your head, then write the function and then write the test and see if it works how you wanted it to work. Write test once, not 4 times.

GuitarPlayerPL
Автор

Writing TDD on big projects that has not feature modularization and take long to build is long day.

otoS
Автор

In my research, what you have described is the actual TDD process!

ChrisAthanas
Автор

I always find writing Unit tests pointless. It hasn't helped us much in finding any bugs, because we change any of the written code very less often

ajithma
Автор

As a freelancer i dont have the time to write tests, i wish to do so, but i need to meet the deadlines of the client and deliver .

baadrqaaba
Автор

It is a hot topic! Could you give it more attention in your videos, pleeease!

alexnovikov
Автор

flowchart >> test >> actual code

Alchemist
Автор

I think over speaking about using TDD people should speak about how to convince the client to pay for it 😂

symekoo
visit shbcf.ru