NFC Testing Methodology

Systematic Testing for NFC Products and Deployments

NFC Testing Methodology

Systematic NFC testing catches interoperability failures before they reach end users. This guide defines a complete test framework covering RF physics, protocol compliance, NDEF payload correctness, OS dispatch behaviour, and environmental robustness.

Why NFC Testing Is Unique

NFC combines three failure domains that rarely overlap in software testing: RF physics (field strength, antenna tuning), protocol state machines (iso-14443, iso-15693), and application-layer NDEF data. A bug in any layer can cause silent failures — the tag scans but the wrong app opens, or the correct app opens but data is missing.

Test Matrix Overview

Test Category Tools Required Pass Criteria
RF detection Reference reader + calibration tag UID returned within 100 ms
Read range Calibrated fixture with fixed antenna ≥ specified read-range at 20°C
NDEF parse NDEF Decoder + TagInfo Zero parse errors, all fields decoded
Cross-device Android 8+, iOS 13+, at least 3 reader models 100% read success across all
Write-verify Encode station + immediate read-back Byte-for-byte match
Lock state Raw block read after lock Lock bits set, no write accepted
password-protection Correct PWD, wrong PWD, no PWD ACK/NAK as expected
Environmental Temp, humidity, flex, metal proximity UID returned, NDEF intact

Phase 1: RF Characterisation

Before testing NDEF content, confirm the physical link budget is adequate.

Read range test: Mount the reader antenna in a fixed fixture. Move the tag from 0 mm to maximum distance in 2 mm increments. Record the nearest and farthest distances at which the UID is reliably returned (≥ 10/10 reads). This establishes the usable range window.

Angular sensitivity: Test at 0°, 45°, and 90° rotation relative to the reader coil plane. Tags with circular antennas tolerate rotation; rectangular coils have a strong preferred axis. Document the dead zone.

Metal proximity: If the tag will be applied near metal, repeat read range tests with the tag on an aluminium plate. Standard inlays degrade to near zero at < 3 mm. If the measured range drops below spec, switch to an on-metal-tag design.

Phase 2: Protocol-Level Testing

Use a protocol analyser (Proxmark3, PN532 with raw command access) to verify the exchange at the iso-14443 or iso-15693 layer.

Key checks:

Command Expected Response Common Failure
REQA / WUPA ATQA (2 bytes) No response = chip dead / wrong protocol
SELECT cascade Full uid + SAK Wrong SAK = wrong chip type
READ block 0 Capability container bytes E1 10 xx 00 for Type 2
READ NDEF blocks TLV stream starts 0x03 0x00 = blank; 0xFF = corrupt
WRITE + READ-BACK Written bytes returned Mismatch = write failure
PWD_AUTH (correct) ACK 0x0A NAK = wrong password config
PWD_AUTH (wrong) NAK ACK = password not enabled

Phase 3: NDEF Content Testing

Decode every record type present:

  1. URI records: verify scheme prefix byte matches URL scheme (0x04 for https://); verify no trailing null bytes.
  2. Text records: verify UTF-8 encoding flag and language code byte; verify no BOM.
  3. smart-poster records: verify nested NDEF parses correctly; check Action record value.
  4. External type records: verify namespace string format (domain.com:type).

Use the NDEF Decoder on a hex dump of the raw tag memory, not on the parsed output from a high-level app, to avoid masking parser bugs in your test tooling.

Phase 4: OS Dispatch Testing

The most common field failure is a tag that reads fine at the protocol level but launches the wrong app or no app on the end-user device.

Android dispatch test matrix:

NDEF Content Android Behaviour Test Pass?
URI record https:// Browser intent Opens correct URL
URI record with AAR AAR app intent Target app opens
MIME text/vcard Contacts import intent Contact imported
External type record App-specific intent filter App handles it
Empty NDEF message No dispatch No crash

iOS test matrix (Core NFC):

Scenario iOS Behaviour Test Pass?
NDEF read during session Delegate called with NDEF message All records present
NDEF read, session expired No callback Graceful; session expires
Non-NDEF tag during NDEF session Error callback Error code handled
Background tag reading (iOS 14+) System notification Notification shown

Phase 5: Environmental Stress Testing

Test Condition Acceptance Criterion
Temperature high +70°C, 30 min UID + NDEF intact
Temperature low -20°C, 30 min UID + NDEF intact
Humidity 95% RH, 48 h UID + NDEF intact
Flex (label) 1000 × 90° bend over 10 mm radius UID returned
Drop (product tag) 1.5 m onto concrete UID returned
UV exposure 100 h xenon arc UID returned
Chemical (cleaning spray) 10× wipe UID returned

Regression Testing in CI

For software projects that encode tags programmatically:

  1. Add a golden-master NDEF byte sequence to your test suite.
  2. On every commit, run the encoder and compare the output bytes to the golden master.
  3. Test on at least one physical tag per release — software comparison does not catch antenna tuning regressions.

See the NDEF Encoder and NDEF Decoder for generating and verifying test vectors.

See Also

Terms in This Guide