McBasic™Get McBasic™ ↗
Build 881
Guided workflow

Find and test an event-handler defect

Use a deliberate defect to practice diagnostics, breakpoints and regression checks.

Step 1Start from a known-good project#

Download HelloForms, open it and complete its four acceptance checks. Commit this baseline before changing code.

Step 2Introduce one observable mistake#

In cmdGreet_Click, replace the empty-input condition with the following line, leaving the rest of the handler unchanged:

Deliberately wrong condition
If Len(name) > 0 Then

Step 3Check and observe the limit of Check#

Run Check. The code is legal BASIC even though its behavior is wrong. Run the application and reproduce the problem using Ada and an empty input.

Step 4Stop before the wrong branch#

Set a breakpoint on the condition in the IDE. Run, enter Ada and activate Greet. Inspect name and Len(name), then step over the condition. Do not change the label to hide the wrong branch.

Step 5Restore the rule and protect it#

Correct condition
If Len(name) = 0 Then

Repeat empty, whitespace-only and normal-name tests. Move the transformation into Greeting if you want to automate its behavior, then use the complete test module in LanguageWorkbench.

Source baseline 20f4bfed6b · Build manifest