Enum Class CoverageProbeType
- All Implemented Interfaces:
Serializable, Comparable<CoverageProbeType>, Constable
Enumeration of coverage probe types placed at control flow points.
Coverage probes are inserted during IR generation when coverage is enabled. Each probe type represents a specific control flow construct that needs to be tracked for code coverage analysis.
EK9's coverage follows an edge-based approach: probes are placed at control flow decision points rather than at every statement. This minimizes the number of probes while maintaining full branch coverage capability.
Note: BLOCK (merge point) and FUNCTION_EXIT probes are intentionally omitted:
- BLOCK probes are redundant - explicit branch tracking (BRANCH_TRUE/FALSE, SWITCH_CASE, LOOP_BODY) already identifies which paths were taken
- FUNCTION_EXIT probes are redundant - EK9 has no return statement, so functions have exactly one exit point (end of function body)
-
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionProbe on the false branch of a conditional (else, while condition is false).Probe on the true branch of a conditional (if, while condition is true).Probe at exception handler entry (catch block).Probe at explicit finally block entry.Probe at the entry point of a function/method.Probe at loop body entry.Probe at each switch case target. -
Method Summary
Modifier and TypeMethodDescriptionstatic CoverageProbeTypeReturns the enum constant of this class with the specified name.static CoverageProbeType[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
FUNCTION_ENTRY
Probe at the entry point of a function/method. Every callable construct gets a FUNCTION_ENTRY probe to track whether the function was ever invoked. -
BRANCH_TRUE
Probe on the true branch of a conditional (if, while condition is true). Tracks execution of the true path in conditional control flow. -
BRANCH_FALSE
Probe on the false branch of a conditional (else, while condition is false). Tracks execution of the false path in conditional control flow. -
SWITCH_CASE
Probe at each switch case target. Each case in a switch statement gets its own probe to track which cases were executed. -
CATCH_BLOCK
Probe at exception handler entry (catch block). Tracks whether exception handlers were exercised during testing. -
LOOP_BODY
Probe at loop body entry. Tracks whether loop bodies were executed (distinguishes between loops that ran zero times vs one or more times). -
FINALLY_BLOCK
Probe at explicit finally block entry. Tracks whether user-written finally blocks were executed.Note: Synthetic finally blocks (from try-with-resources without explicit finally) are NOT tracked because the close() method's FUNCTION_ENTRY probe already proves cleanup happened.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-