O'Reilly logo

Code Craft by Pete Goodliffe

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Get Thinking

A detailed discussion of these questions can be found in the "Appendix A" section on page 494.

Mull It Over

  1. Write a test harness for the greatest_common_divisor code example earlier in this chapter. Make it as exhaustive as you can. How many individual test cases have you included?

    1. How many of these passed?

    2. How many failed?

    3. Using these tests, identify any faults and repair the code.

  2. How should the testing of a spreadsheet application and an automatic aircraft pilot differ?

  3. Should you test all of the test code that you write?

  4. How does a programmer's testing differ from a QA department member's testing?

  5. Is it necessary to write a test harness for every single function?

  6. Test-driven development encourages you to write tests first, before any code. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required