General statistics
List of Youtube channels
Youtube commenter search
Distinguished comments
About
Ton Bong
Continuous Delivery
comments
Comments by "Ton Bong" (@tongobong1) on ""TDD Is An Essential" | Martin Fowler On Test Driven Development And Self Testing Code" video.
Martin Fowler if you are reading this please STOP THE LONDON STYLE UNIT TEST MADNESS. These tests are terrible for projects and they are costing Europe billions! Save the Europe from London style unit tests by promoting classical unit tests!
6
Just stay away from mocking as much as possible!
5
The problem with TDD is this: 'To a man with a hammer, everything looks like a nail'. TDD is a great tool if you know when to use it and also when you should NOT use it.
4
@Tony-dp1rl Great question. It is interesting that even Martin Fowler admitted in this video that he is not doing TDD as much as he "should". I wish David would ask him why not. There are many good reasons why we don't use TDD and I wish we would discus them more.
4
Yes but it is very common in iterative development that we don't understand the feature at first. This is why we implement something we think customer wants and get the feedback from him ASAP so we can improve and show him again and again.... until he is satisfied with the result.
4
Most experienced developers with 20+ years of programming experience that I know don't know how to write a good unit test. All those that write London style unit tests don't know how to write a good unit test.
3
@NicodemusT sometimes you need a mock to create a test but you should consider changing the design so you don't need the mock to test the functionality. Example: instead of loading data from injected object you could load data and send it as a parameter to method that you want to test.
2
@dflor003 mocks are terrible and you shouldn't use them to mock services.
2
@bobbycrosby9765 Mocking sometimes is not London. London is mocking everything.
2
But it is also weirdly that even Martin Fowler sometimes forgets to use the TDD as he just admitted or maybe it is not so weirdly. It seems like sometimes is more useful to implement somethin without TDD.
2
EXACTLY! London style unit tests are class tests testing every class in total isolation from other classes using mocks so they are just terrible. I am baffled how many smart programmers like Dave Farley still think London style tests are useful. It is time to REJECT those crazy tests!
2
@gJonii Usually every time it feels silly to write a test before production code, when implementing GUI, random data generators, when you don't know exactly what you want to achieve just approximately, for data definition, getters and setters...
1
@gJonii Sometimes the design is just not an issue so I don't need the TDD to create a good public design. Example is just a simple method call that implements something complex using many private methods... I have many implementation ideas and the fastest way to test them is to just look manually at the results I get. Writing unit tests for all temporary tests seems like wasting time and it is rather annoying to change focus from test to production code and back. Only when I have a stable implementation I create a unit test or few of them that protect functionality and then I can refactor and extend it further. This is the case when TDD is not that useful.
1
@nickpll But you should use integration tests for database and integration tests are usually much slower than unit tests so you usually don't run them together with unit tests.
1
@nickpll you don't use mocks in integration tests. Those tests are using database - usually empty test database that you fill with test data.
1
@dflor003 Refactor/redesign the system so you can test as much as possible with unit tests without mocks and the rest you test with integration tests so you never need to mock anything.
1
@dflor003 Don't mock calls to external API that execute inside the process. Only mock those that go outside the process like IO, database access, network... London style TDD is so silly focusing on the class while implementing top down. This is just breadth first implementation of functionality and it is inferior to depth first because in breath first you need silly mocks while you don't need mocks in depth first implementation of functionality. In depth first you are writing all classes that implement the functionality - satisfy unit test at once. Sometimes it is even better to create a "fat" class and then refactor it by extracting classes out of the fat class. You also shouldn't create a test class for every class. It is perfectly fine to test classes through "upper" client classes and their unit tests.
1
@jameswrightson744 just google the difference between London and classical style unit tests.
1