3 ms·
> How do you ensure the tests themselves are accurate? By adding tests as you build-up and refine code, taking your branch coverage into account, as reported b
by tannhaeuser 4y ago
> How do you ensure the tests themselves are accurate?
By adding tests as you build-up and refine code, taking your branch coverage into account, as reported by coverage tools.
If data is too complex, this informs you that the responsibilities of your piece of code needs to be split up into separate components, packages, classes, or whatever. Designing for testability (rather than looks or "design patterns") is one of the most important, if not outright the most important consideration in code organization IMO.
Creating test cases "after the fact" is mostly worthless. TDD, OTOH, gets you best results for a broad range of code bases, but takes a lot of effort, discipline, and energy.