Software Engineering Stack Exchange is a question and answer site for professionals, academics, and students working within the systems development life cycle. It only takes a minute to sign up.
Sign up to join this community
Anybody can ask a question
Anybody can answer
The best answers are voted up and rise to the top
TDD is often praised for its ability to implement something in a step-by-step fashion, at each step we are generalising the code to handle new behaviours.
The question is that: can every algorithm be decomposed into small successive steps? Is there some counter-examples that prove that TDD may fail in some cases?
I am thinking about algorithms involving dynamic programming. This kind of algorithms often requires some ahead thinking, a birds-eye view. Doing it in a TDD fashion may drive us into a corner.
I am looking for resources/reflections that talk about this problem.
Yes, every (Von Neumann) algorithm can be broken down into small, successive steps since they’re run on computers – which run them in tiny, successive steps.
Those steps might not be practical to TDD, or might not produce useful insights even if you do. But there’s no CS limit here and “practical”/“useful” here is all subjective.
Not the answer you’re looking for? Browse other questions tagged algorithms tdd or ask your own question.