General statistics
List of Youtube channels
Youtube commenter search
Distinguished comments
About
Ton Bong
Continuous Delivery
comments
Comments by "Ton Bong" (@tongobong1) on "Unit Testing Is The BARE MINIMUM" video.
Usually you write full test before the first line of production code and you don't change the test only production code when you write more full tests.
2
@powerswitchfailure Dave is doing London-style and I try to convince him against this nonsense. I am baffled how many otherwise experienced programmers just don't get how terrible is London-style.
2
You just wrote a bad unit test. Good unit test has well defined inputs and outputs.
1
@llothar68 yes there is something fundamentally wrong with TDD or else more professional programmers would use it.
1
Great point! Also if there is a list of well defined requirements for legacy code without tests we can make good tests for that code too no matter how messy it is provided we can change the design so much that we can get the correct feedback from the system.
1
Great explanation of why we should do TDD.
1
Are you doing TDD with classical or London style unit tests? You should know London style is terrible.
1
Writing mocks is usually bad except when mocking resources that are outside the process because there is no other way to create a unit tests for code that accesses those resources. I guess they removed unit tests that were full of mocks - the terrible unit tests. Unit test can have more than one assert but it should never have multiple steps because in that case it is not a unit test but contains more tests inside one test.
1
Mockists are writting terrible unit tests because they are hard to read and understand and are coupled with implementation. Use integration tests whenever your program accesses resources outside the current process like DB, filesystem, web... You can write integration test first and then unit test from that integration by mocking the access to outside resources.
1
@deanschulze3129 Great question. I think TDD has some fundamental problems that deter most professional programmers from using it. I think TDD is a bit like socialism - good in theory and for some people but not so good for most. The problem I see is that promotors of TDD only tell us good things about TDD and never bad like it is useless when creating GUI in code, using random data... Sometimes it is just too silly to write a test first. I think the worst thing about TDD is jumping from writing test to production code and back to test - the mental process that most programmers just don't like doing it. I must say that I like TDD whenever I write logically complex code - business logic.
1