Vizavi

Debug a failing code snippet

Trace a code snippet with a failing input and propose a minimal correction and regression test.

Prompt

Here is [snippet], [input] and [expected behavior]. Trace the failing path, show the first assumption that breaks, propose a minimal correction and give one regression test for the failing case plus one for existing behavior.
Open in Vizavi Chat

Illustrative source records

Worked example

  1. Code: takes the first item unconditionally
  2. Failing input: empty array
Example answer

Add the empty-array case to the test and define the expected result before adjusting the access.

Suited for

Engineers and on-call leads.

Connectors

Use material you can access, or paste the relevant excerpt into your question.

Bring a real question to your next review.

Start with a meeting or agree a cross-system workflow with the people who own the sources.

Necessary storage supports sign-in and service operation. Optional product analytics stays off until you allow it. You can change your choice in Cookie settings. Cookie Policy