"testing" or "business logic", who will write first when programming, the overall efficiency will be higher?

Old habits

follow my previous process: do logic flow chart, write business logic, write test code.

hear

but I heard that "TDD is test-led development; after development, it is relatively expensive to write tests."

question

I don"t have much experience writing tests. I would like to ask my colleagues, who do you think will be more efficient when writing "testing" or "business logic" first in programming?

Jul.28,2021

the person who is the first to master the business logic takes the approach wherever it is.


TDD seems to me to be a very extreme idea, as extreme as to think that "functional code is for testing code."

I prefer to have integration tests to cover every business scenario, rather than strictly following TDD . It is necessary to strike a balance between development efficiency and functional stability. So my personal view is that important business code must have integration test coverage, important functions / methods must have unit test coverage, but not everywhere need testing, too many junk tests are meaningless and take up a lot of development time.

Menu