DEV Community

Perch D
Perch D

Posted on

How to Review AI-Generated Logic in IoT Applications

An AI agent creates a machine-monitoring dashboard. Temperature readings appear, the trend chart updates, and an alarm triggers when a value exceeds its threshold.

The demo works. But what happens when the sensor disconnects? When an old reading arrives late? When a user changes the threshold without permission?

For IoT applications, reviewing the interface is only part of reviewing the application. The harder questions concern data quality, state transitions, permissions, and behavior during failures.

Whether an AI produces source code or editable visual workflows, teams need a repeatable way to inspect its output.

Start With Requirements You Can Test

A prompt such as “build a temperature-monitoring dashboard with alerts” leaves important decisions unspecified.

Before generating the application, describe its expected behavior. For example:

  • Read temperature from a configured device every five seconds.
  • Preserve the reading’s timestamp and quality status.
  • Mark data as stale after 30 seconds without a valid update.
  • Raise a high-temperature alarm after three consecutive valid readings above 80°C.
  • Clear the alarm after three consecutive valid readings below 75°C.
  • Allow operators to acknowledge alarms.
  • Restrict threshold changes to authorized engineers.

These values are illustrative. Actual thresholds and timing must come from equipment requirements and operating conditions.

The point is to give reviewers something more precise than “it looks right.”

1. Review the Data Path

Trace one reading from the device to the dashboard and alarm rule.

Check:

  • Which device or tag supplies the value?
  • Is the value expressed in the expected unit?
  • Is its timestamp generated by the device or the receiving system?
  • How are invalid, missing, or stale readings represented?
  • Can a reconnect deliver older buffered readings?

An application can display a plausible number while interpreting it incorrectly. A temperature conversion error or stale value may be invisible in a polished dashboard.

If the platform uses visual models, inspect data bindings and transformation expressions. If it generates source code, inspect parsing, conversion, validation, and error handling.

Neither output format removes the need to verify the data path.

2. Review Alarm State, Not Just the Threshold

A threshold comparison is simple:

temperature > 80
Enter fullscreen mode Exit fullscreen mode

A useful operational alarm needs more context.

In our example, three valid readings above 80°C activate the alarm. Three valid readings below 75°C clear it. The gap between activation and clearing thresholds introduces hysteresis, reducing repeated transitions near the boundary.

Reviewers should also ask:

  • Do invalid readings reset the consecutive-reading counter?
  • Does stale data create a separate communication alarm?
  • Does acknowledgment leave the underlying alarm active?
  • Does the rule use measurement timestamps or arrival order?
  • What happens to counters after an application restart?

AI-generated logic may choose reasonable-looking answers that differ from your requirements. Make those choices explicit.

3. Separate Monitoring From Equipment Control

A dashboard that reads machine data has a different risk profile from an application that writes setpoints or starts equipment.

Do not let a broad generation prompt quietly introduce write operations.

Review every action that can affect a device:

  • Its target and permitted value range.
  • The roles allowed to execute it.
  • Required confirmation or authorization.
  • Timeout and failure behavior.
  • The audit record it produces.

For this example, keep the application limited to monitoring and notifications.

Safety-critical protection should remain in the appropriate engineered control system. A generated monitoring workflow should not become a substitute for an equipment interlock.

4. Test Connectivity Failures Deliberately

A connected application needs a defined response to disconnection.

Disconnect the device and check whether the application distinguishes “no new reading” from “normal temperature.” Then restore the connection and inspect how it handles delayed data.

If the application also has an edge-to-central connection, test those links separately:

  1. Device connection fails while the edge runtime remains available.
  2. Internet uplink fails while local device communication continues.
  3. Connectivity returns and buffered records arrive.

For platforms with a local runtime, such as Iotellect Edge, specify which monitoring, alarm, and interface functions must continue locally. Verify those functions in the configured deployment.

Edge execution supports an offline design; it does not define that design for you.

5. Review Permissions With Separate Accounts

An administrator account can hide access-control mistakes because almost everything works.

Test with actual operator, engineer, and read-only accounts.

Verify that:

  • Read-only users cannot change thresholds.
  • Operators can acknowledge alarms without editing rules.
  • Engineers can modify only the resources assigned to them.
  • API access follows the same restrictions as the interface.
  • Customer data remains isolated where multi-tenancy applies.

Hiding a button is insufficient. The underlying operation must enforce authorization too.

6. Review the Change Before Deploying It

Ask the AI to explain what it changed, but verify that explanation against the actual application.

For visual models, inspect modified bindings, rules, expressions, and permissions. For source code, review the diff and affected dependencies.

Before deployment:

  • Save a known working version.
  • Test expected behavior and failure cases.
  • Confirm that unrelated resources were not modified.
  • Document how to restore the previous version.

Where the platform supports versioning and rollback, test those mechanisms before relying on them.

Where AI-Assisted Low-Code Helps

Visual workflows can make review more accessible to engineers who understand the equipment and process but do not work primarily in source code.

They can inspect relationships between readings, rules, alarms, and interfaces. However, visual models can still contain incorrect expressions, hidden dependencies, or excessive permissions.

At Iotellect, we work on low-code IoT and industrial applications. This article reflects that perspective: AI assistance is most useful when its output can be inspected, tested, and maintained by the people responsible for the system.

Our comparison of low-code, vibe coding, and AI-assisted low-code explains the broader differences between these development approaches.

For a production application, the practical question remains the same: can your team explain what changed and demonstrate how it behaves when something goes wrong?

Top comments (0)