Question 640
At fictional Cedar Retail Group, the Business Central development team is supporting store procurement and finance and reviewing AL business logic and user experience during a code quality review (MB820-4.3-159). The observed development issue is that a workflow needs optional business arguments but developers add many duplicated procedure overloads with inconsistent behavior. Which recurring engineering check would best prevent this issue from returning?
Explanation
Correct Answer
The ongoing check is to use contract tests for all procedure variants. This helps detect recurrence when a workflow needs optional business arguments but developers add many duplicated procedure overloads with inconsistent behavior. The associated correction is to define clear procedures with appropriate parameter defaults or supported overload contracts; a confirming result is that every supported call path applies consistent business validation.
Incorrect Answers
The proposed “Test filter behavior with similarly named fields” tests a different control: apply the intended record filter and validate current filter groups when composing queries. The reported condition is that a workflow needs optional business arguments but developers add many duplicated procedure overloads with inconsistent behavior; the more direct action is to use contract tests for all procedure variants.
“Review externally visible procedures in every release” supports the separate task “use local/internal/protected access boundaries as appropriate to the AL object and intended consumers”, not the reported problem: a workflow needs optional business arguments but developers add many duplicated procedure overloads with inconsistent behavior. This case instead calls for “Use contract tests for all procedure variants”.
“Review global variable dependencies in shared codeunits” concerns the separate step “refactor it into a procedure with explicit parameters and local state”. The reported issue is that a workflow needs optional business arguments but developers add many duplicated procedure overloads with inconsistent behavior, so the direct response is to use contract tests for all procedure variants.