2 ms·
The code is correct if you hit yes() and no() correctly depending on three conditions. There are 8 possibilities in both cases and thus you need 8 tests in both
by GoblinSlayer 5y ago
The code is correct if you hit yes() and no() correctly depending on three conditions. There are 8 possibilities in both cases and thus you need 8 tests in both cases. Shortcircuiting is optimization, it doesn't reduce complexity of the logic.
- thaumasiotes 5y agoThat is a concern, but it's not one related to how many branches exist in the code. "How did we get here?" and "Are we in the right place?" are distinct questions.