Check, test and debug with a purpose
Use each tool to answer a different question about your application.
Three tools, three questions#
| Tool | Question | Does not prove |
|---|---|---|
| Check | Do source, bindings and project contracts agree? | That the app behaves correctly for every input. |
| Test | Do repeatable assertions hold? | That visual layout and external permissions work. |
| IDE debugger | What state and path produced this behavior? | That an untested path also works. |
The command-line interface supports check and test. BASIC debugging is available in the Mac IDE; there is no implemented CLI debug workflow to promise here.
Follow live Check through a runtime failure#
Automatic Check now validates unsaved work after opening, saving, AI edits and a typing pause. IDE Run reports handled errors in Output; an unhandled error offers End, Go to Line and Copy. Read live diagnostics and runtime errors, then follow the complete eight-step recovery exercise.
Start with a pure function#
A calculation or text transformation is easier to test than a whole window. Put it in a standard module, then register a test module in the project. Keep test procedures public and use the test naming convention demonstrated by the workbench.
Option Explicit
Public Sub Test_Greeting()
Assert.AreEqual "Hello, Ada", Greeting(" Ada ")
Assert.AreEqual "Enter a name.", Greeting(" ")
End SubThe language workbench includes the complete project and tests registration, not just this isolated procedure.
Inspect the first wrong state#
Set a breakpoint before the action goes wrong. Check the selected object, input values and branch condition, then step through the handler. If an event never reaches its first line, inspect the binding before debugging the body. If the value is wrong at entry, follow its earlier assignment rather than adding a correction at the end.
Turn a fix into a regression check#
Write the smallest input that reproduces the failure. Add an assertion for a pure behavior where possible, and record the exact interactive steps for UI behavior. Include empty values, range boundaries, cancellation, repeated activation and reopening after a save.
Read the useful part of a diagnostic#
Keep the diagnostic code, source path and line/column with the problem. A package-admission diagnostic is not a syntax error, and a missing resource is not fixed by changing event code. The troubleshooting guide routes those failures to the correct boundary.
20f4bfed6b · Build manifestSources & maintenance
Original web explanation, reviewed against these repository sources. API tables and example files follow the implementation.
docs/manual/04-the-ide-at-a-glance.mddocs/manual/15-check-test-and-debug.mdmacos/McBasicIDE/Sources/AutoCheck.swiftmacos/McBasicIDE/Sources/RunErrorNavigation.swiftsrc/McBasic.Build/DefinitionService.cssrc/McBasic.Runtime/McHandledErrors.cssrc/McBasic.Runtime/McRuntimeErrors.cssrc/McBasic.Runtime.UI/McRuntimeErrorDialog.cs