Close
Register
Close Window

OpenDSA Complete Catalog

Chapter 4 Programming Tutorials

| About   «  4.16. Testing for Code Coverage   ::   Contents   ::   4.18. Bowling Example: Testing to Code  »

4.17. Bowling Test Coverage Example

4.17.1. Bowling Test Coverage Example

Here is another example to let you practice testing. This is testing a bowling game. Each frame starts with 10 pins, the user enters the number of pins hit by each roll of the ball. Hitting all 10 points with one roll is a strike. Knocking down all 10 points on two rolls is a spare.

Try to get at least 75% code coverage.

   «  4.16. Testing for Code Coverage   ::   Contents   ::   4.18. Bowling Example: Testing to Code  »

Close Window