PeaBox Lab › PeaLang › Learn › Chapter 25 › Lesson 5

Part IV — Expert Production Engineering · Chapter 25 · Lesson 5 of 7 · 2 min read

Lesson 5: Testing Language Changes Across Engines and Hosts

Lesson level: Expert

Purpose: Testing must cover representation, effects, security, and host behavior. Baseline tooling and mocks do not replace measured coverage or live certification.

Learning Objectives

5.1 Concepts

A language-change matrix covers valid and invalid syntax, ordinary values, side-effect ordering, module exports, error categories, authority denials, resource exhaustion, and supported hosts. Use the same fixture contract across interpreter and VM; use host-specific boundary tests for Python embedding, Java sidecar, and TypeScript clients. Browser packaging is a separate evidence class until executable behavior is established. Keep seeds and minimized failures for reproducibility.

5.2 Annotated Example

Native tests are handled by native_testing.py: test blocks are extracted and expect lines lowered to assert before interpreter execution. Each test runs with setup plus its body. The extraction logic counts brace characters without a full string/comment-aware parser, so use simple test blocks and dedicated parser fixtures for complex brace text. pea test --coverage returns a test-aware baseline, not measured statement or branch coverage. --watch runs the baseline once and asks users to rerun; it is not a continuous file watcher.

5.3 Guided Practice

Design one fixture whose return value matches but side effects differ. Add a permission-denial fixture and an error-location fixture. Explain why mock host tests do not certify a live provider.

5.4 Common Mistakes

Do not inflate coverage from a count of nonempty lines, treat watch as an automated loop, or discard a failing fuzz seed after fixing only the visible example.

5.5 Hands-On Lab

Deliverable: Reproducible contributor packet, updated reference, executed fixtures, and open review items.

5.6 Review Questions

How are native test blocks executed? What do coverage and watch actually provide? Which host boundaries need separate fixtures?

5.7 Applied Challenge

Create a machine-readable change acceptance matrix with passed, failed, unavailable, and unsupported states. Missing mandatory evidence must block acceptance.

Lesson Summary

Testing must cover representation, effects, security, and host behavior. Baseline tooling and mocks do not replace measured coverage or live certification.

Lesson status: Draft complete; ready for review.

← Previous Next →