Why is code written inside functions easier to test?
- Functions never contain errors
- Each function can be called with test inputs and its return value checked
- Code outside functions cannot run
- Functions are compiled separately
Answer
B) Each function can be called with test inputs and its return value checked
Unit tests call a function and compare the result with the expected value. SLO CS-11-C-07 · Understanding
Computer Science MCQ · More Unit 3: Programming Fundamentals MCQs · Practise