Get Thinking
A detailed discussion of these questions can be found in the "Appendix A" section on page 494.
Mull It Over
Write a test harness for the
greatest_common_divisorcode example earlier in this chapter. Make it as exhaustive as you can. How many individual test cases have you included?How many of these passed?
How many failed?
Using these tests, identify any faults and repair the code.
How should the testing of a spreadsheet application and an automatic aircraft pilot differ?
Should you test all of the test code that you write?
How does a programmer’s testing differ from a QA department member’s testing?
Is it necessary to write a test harness for every single function?
Test-driven development encourages you to write tests first, before any code. ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access