Test driven development can be a huge shift in the development approach for many of us. The test driven approach basically chips away at the solution like a sculptor would at a marble block instead of trying to define and create a monolithic application in one shot.
As a first step, we'll define the interfaces out software will adhere to. The interface should clearly define how our class is to interact with other classes and what information it will expose. This is a crucial step in any software design process because we really have to know where we are going and the interface serves as a map that will help us get there.
After we have an interface, we'll begin with the test-driven development cycle.
- Add a test
- Run all tests and watch the new one fail (and the rest succeed)
- Modify our code to make the test succeed
- Run all tests and watch them succeed
- Refactor, if necessary
- Run tests to ensure everything still works
- Repeat
0 comments:
Post a Comment