Preparation
Preparation
Beginners and junior developers first learn to run, explain, change and verify a small project before FDE implementation practice.
First task: start without installation
A ticket is a fault request. Its title is an input; its state is the processing stage. A function accepts or rejects inputs under rules. Submit “power failure”, then an empty title, then an unsupported state. Observe three results. Inputs remain on this page and are never saved or sent.
If the button is unavailable, the interaction script is not ready. Read the rules and reference below or download the local lab. Inputs are not submitted to the server.
Understand the rule, then run locally
function acceptTicket(title, state) {
if (!title.trim()) return "rejected: empty title";
if (!["new", "confirmed"].includes(state)) return "rejected: state";
return "accepted";
} trim removes surrounding spaces; if returns early when a condition is met; the list limits states. Independent task: what happens with spaces only? Why is accepted not repaired? Write reasons before revealing the answer.
Reveal reference explanation
Spaces become empty after trim and are rejected. Acceptance only validates input. Repair requires technician work, confirmed results and a recorded state change. Treating validation as business completion omits responsibility and acceptance.
Local execution guide
- Create a dedicated folder such as fde-lab. Save the downloaded file there with its .mjs extension, not .txt. Download ticket-lab.mjs
- If Node is missing, use the official installer for your system. Open Terminal on macOS or PowerShell on Windows and run node --version; expect v22+. Command not found means installation or terminal restart is still needed. Official Node download
- Enter the practice folder with cd followed by its full path, in double quotes if it contains spaces. Example: cd "/your/path/fde-lab". Replace the example with your actual path.
node ticket-lab.mjs baseline— Expect FAIL for unknown and secret: deliberate defects. If the file is missing, check the folder and extension; do not delete failing cases.node ticket-lab.mjs candidate— Five PASS results demonstrate the repair. Compare both functions and explain each change; repair a copy yourself in implementation. No npm install or keys are needed.- Version-control introduction: first copy ticket-lab.mjs to my-ticket-lab.mjs, keeping plain text and the .mjs extension. Before repairing, run git init, git add my-ticket-lab.mjs and git commit -m "save baseline" in the practice folder. After the implementation repair, inspect git status and git diff to compare against that baseline. Then run git add my-ticket-lab.mjs, git commit -m "repair ticket rules" and git show to review the repair. The initial commit shows the entire new file, not the repair diff. If Git or identity setup is missing, preserve original and repaired copies and record the gap. Do not use reset or deletion for recovery.
Begin with this rule task and role/scoping work. Engineering implementation still requires local execution. Record commands, versions and exact errors; use module references first, then discuss blockers through curriculum inquiry. Preparation is a first step, not a complete programming qualification.
Four preparation exercises
01
Programming foundations
Write a ticket list in a familiar language: accept a title and state, reject empty titles and allow only agreed states. Explain structures, conditions and functions.
02
Projects and execution
Run it in your own practice directory and record commands, versions and inputs/outputs. Distinguish local practice, test environments and production.
03
Version control
Record a change in your own practice repository, read the diff and create a commit. Explain saved and uncommitted work; preserve it before recovery.
04
Verification and failure
Check a valid ticket, an empty title and an invalid state. Trigger a controlled input error, explain and fix it without deleting the checks.
Readiness before implementation
- Run the small project independently and explain inputs, state and failure behavior.
- Read diffs, preserve changes, run checks and explain one repair.
- Identify data and environments you are not authorized to use; record and clarify unknowns.
If not ready, study role and discovery while strengthening foundations. Ask a peer to review the exercises before implementation. These tasks do not replace a full programming course or automatically certify readiness.