問題文
A team writes guidance for designing units that are easy to verify. Which two pieces of guidance are sound? (Select two.)
選択肢
- Keep decisions in functions that take their inputs as arguments and return their results, with side effects pushed to the edges.
- Prefer many private helper methods, because a unit with more private members exposes a smaller surface and is therefore easier to verify from the outside.
- Expose the seams where external facilities are used, so a test can supply substitutes without replacing global state.
- Use inheritance to share behavior between units, because a base class provides a single place to verify the shared logic and the subclasses therefore need no tests of their own.
- Read configuration directly from the module scope inside each function, because a single source of truth removes the need to pass the values around.