Start with an observable contract
Write down what the blocker claims to control and what evidence will confirm it. For an extension, this might be adapter acceptance of a rule set and refusal of a synthetic request in the configured profile. For a resolver, it might be the expected answer from the configured DNS path. A status indicator should be derived from that evidence.
The OWASP Web Security Testing Guide offers a useful example of structured testing: define a condition, perform a check, and record the result. Its scope is broader than a personal blocker, but its discipline helps separate assumptions from observations. Do not describe the project as audited merely because you borrowed a testing format.
Give the matcher a fixture set
Fixtures are inputs paired with expected decisions. They let you check normalization and boundary logic without opening a browser. Include both blocked and allowed cases; a matcher that blocks every destination can appear successful if the tests only contain blocking examples.
| Input host | Rule | Expected result |
|---|---|---|
| example.test | example.test and subdomains | Block |
| sub.example.test | example.test and subdomains | Block |
| notexample.test | example.test and subdomains | Allow |
| example.test.other.test | example.test and subdomains | Allow |
Add malformed entries, mixed case, a final dot, exact-host rules, and exception precedence. Use RFC 6761 reserved test names for these examples. For integration checks, configure a controlled local endpoint; a reserved name does not automatically provide a reachable test website.
Check the route, not just the rule
Firefox and Chromium profiles can have different extension installations and permissions. Test the intended profile, private-browsing scope where applicable, and the behavior after the browser restarts. Confirm that the interface does not imply coverage in a profile where the extension is absent.
RFC 8484 defines DNS over HTTPS. That is a different transport for DNS, not evidence of harmful activity, but it can create another resolver route outside a locally configured filter. Record whether the chosen architecture covers that route. Likewise, a network DNS setup should not imply control when a device moves to mobile data.
Windows and macOS network settings, and Linux resolver arrangements involving systemd-resolved, can change the effective path. Test the configuration you actually support rather than generalizing from a single machine. Keep these checks within devices and networks you own or are authorized to manage.
Make operational failures ordinary tests
- Restart: enforcement resumes only after the required service or extension is ready.
- Interrupted update: the chosen previous-rule behavior remains visible.
- Invalid configuration: a useful error replaces a silent empty list.
- Permission removal: status changes to reflect reduced coverage.
- False positive: a reviewed exception fixes the specific match.
- Recovery: ordinary and emergency communication remain available through the documented process.
“Fail closed” means refusing activity when the decision system fails; “fail open” means permitting it. Neither is automatically appropriate everywhere. A whole-device closed failure can disrupt essential access. Choose behavior at the specific enforcement point and explain the tradeoff before relying on it.
Test the interface without collecting histories
Use the keyboard to reach controls, read error messages, and recover from an unsuccessful change. Test readable zoom, narrow screens, and a screen reader where available. The Web Content Accessibility Guidelines provide useful principles for perceivable status and operable controls; referencing them is not a certification.
Record software version, rule version, configuration, expected result, and observed result. Prefer synthetic fixture identifiers to full browsing URLs. Request paths and query strings can contain private information even when a hostname appears harmless. If diagnostic logging is added to your own app, make its purpose, scope, and deletion behavior explicit.
Retest after changes to the adapter or rule generator. Passing fixtures are evidence about the tested contract, not a promise that every future destination or behavior is covered.