← All writing

Software & systems

Automating NFC testing across payment terminals and phones

7 min read

A fixed phone with its back facing the front of a payment terminal, separated by a metal shield on its own linear slide.

Some software tests have to reach into the physical world.

NFC software needs to respond correctly when an interaction between a phone and a payment terminal begins, completes, or is interrupted. Testing the application in isolation only covers part of that behaviour.

Connecting an AI test agent to a physical fixture provides a way to exercise those interactions remotely, with continuous feedback from the devices involved.

The approach can extend across a variety of phones and payment terminals. When a CI workflow reaches the hardware test stage, it can spawn an AI test agent to operate the test through the fixture and observe what happens. The physical setup supplies a controllable action; device monitoring supplies the evidence.

Making the tap controllable

The fixture holds a phone with its back facing the front of the payment terminal. The phone’s display faces outward, while the terminal’s screen and keypad face toward the phone. Both devices are fixed to the base. A sliding metal plate sits between them, secured to its own carriage and guide. A motor actuator drives the carriage along the gap between the devices, inserting the shield into that gap or withdrawing it completely. Only the shield and its carriage move; the phone and terminal stay fixed.

The plate provides two useful states:

  • Shield inserted: NFC communication is blocked in the fixture, representing the state before the phone and terminal have been tapped together.
  • Shield withdrawn: the obstacle is removed, allowing the two NFC interfaces to begin communicating.

This turns the beginning of an NFC interaction into an action the test system can control. The devices can remain aligned between attempts, with the shield controlling when they can communicate.

The distinction matters for repeatability. Device position, readiness, and the moment communication becomes possible are separate variables. The jig holds the physical arrangement steady while controlling that last variable.

Each device pairing still needs to be checked: the inserted plate must actually prevent the interaction, and withdrawing it must permit a reliable exchange. Shielding simulates the transition into contact; reproducing the full motion and changing angles of a person’s hand would be a different test.

Connecting the fixture to CI

A CI workflow can organise the interaction into a small physical test cycle:

  1. Prepare the test. Identify the software build, scenario, phone, and terminal. Establish device monitoring before changing the physical state.
  2. Start with the shield inserted. Put the devices into the scenario’s starting state while NFC contact is blocked.
  3. Arm the interaction. Prepare the phone and terminal for the operation under test, using the controls available for that device pairing.
  4. Withdraw the shield. Allow the NFC interfaces to communicate and watch the resulting device behaviour.
  5. Evaluate the outcome. Compare the observed events with the scenario’s expected result, preserving the supporting logs.
  6. Reset the fixture. Reinsert the shield and return the devices to a known state before another attempt.

The useful boundary is between the agent and the hardware controls. The agent needs operations it can invoke and observations it can interpret. Movement limits, timeouts, and reset behaviour belong in the fixture’s control layer, so the physical action remains predictable.

This also makes the fixture a resource that CI must schedule. A particular phone–terminal pair should belong to one test at a time, with a clear handover after cleanup. Physical devices need that coordination just as shared test environments do.

Observing Android and iOS throughout the test

Continuous device monitoring captures what happens throughout the test, including events that are no longer visible in the final screen state.

On Android, ADB provides a connection to the device, with tools such as adb logcat exposing application and system messages. On iOS, monitoring uses the device and application logs available through the development setup. Apple’s Console documentation describes viewing logs from connected devices, including iPhones. ADB is the Android part of this arrangement.

The logs available depend on the device, software, and instrumentation. The test has to use signals that the particular setup actually exposes.

Timing is especially useful here. Relating the moment the shield moves to subsequent events helps establish what happened: the interface becoming active, the application entering an expected state, a timeout, or an error. A visible response can be useful context, but the application-level outcome needs its own evidence. Establishing an NFC exchange and completing the intended software workflow are separate things to check.

A useful remote result answers four questions: which build and device pairing ran, what physical action occurred, what the devices reported, and which expected outcome those observations satisfy.

Where the AI agent helps

Moving a metal plate is a conventional automation task. The AI opportunity is in coordinating the test around that action and interpreting the observations from different devices.

An agent can use the scenario and current device state to work through preparation, invoke the permitted fixture operations, inspect the resulting logs, and assemble a useful explanation when something goes wrong. That is particularly valuable when testing spans different phone models, operating systems, and terminal implementations.

For example, an unsuccessful attempt might involve a device that never became ready, an NFC exchange that began but timed out, or an application that received an event without reaching the expected state. Those possibilities call for different investigation. Relating the logs to the physical test sequence gives the agent something concrete to reason about.

The pass or fail decision should be tied to explicit test expectations. The agent’s interpretation should help explain the evidence and choose bounded next steps. Retries should have limits, and the original failure should remain available for inspection.

Testing across a device matrix

One successful phone–terminal pairing is only one data point. Broader coverage requires testing across a matrix of devices.

The fixture needs to accommodate different device bodies and NFC antenna locations. The software side also varies: Android and iOS provide different monitoring paths, and terminal behaviour can differ between models. A reusable test flow therefore needs device-specific preparation and observation alongside the common shield-and-observe cycle.

Useful scenarios can include the first interaction after readiness, repeated interactions, removal of contact, and recovery after an interrupted exchange. For each scenario, the expected behaviour needs to be defined for the software being tested.

The benefit is the ability to run and investigate these physical interactions remotely after the devices have been mounted and connected. Engineers can work from the test sequence and captured evidence while the hardware remains in the lab.

Applied AI with a physical feedback loop

This architecture connects software testing, physical automation, developer infrastructure, and applied AI.

The fixture makes a physical event controllable. Continuous device monitoring makes its consequences observable. The agent connects those capabilities to a test scenario and helps turn the result into something an engineer can act on.

A CI job can then return more than the outcome of an isolated software test: a record of a controlled interaction between real devices, the responses it produced, and the evidence supporting the result.