Test-First Development
Definintions
API - Application Program Interface - software to software
Stub definitions - a minimal incorrect function that compiles, is used as a placeholder
Overview
When developing software is a test-first manner, then the workflow for writing code is as follows:
- Design the API of your code. In C++ this often involve writing function declarations in header files.
- Implement stub definition(s) for that API. In C++ this often involves writing function definitions in '.cpp' files.
- Write automated tests for that API. In this module, this will involve writing test cases using the Boost UTF.
- Implement definitions for the API that meet the functional requirements. This involves replacing the stub definitions with implementations that pass the tests.
Depending on the type of test-first development you are employing, you might either:
- Apply this workflow once to the program as a whole. That is, design the entire API, then implement stub definitions for everything, then write all the tests, then correctly implement the definitions.
- Apply this workflow iteratively on a unit by unit basis. That is, design the API for one unit, implement a stub definition for that unit, write tests for that unit, correctly implement the definition, and then start the process again for the next unit.