Skip to content
All projects

Test automation for an MES with virtual machines

Project write-up

The client is described by industry and scale, without a name. KPI figures are targets agreed with the client after a baseline measurement.

In brief

Problem
Every MES change is tested on the line during downtime, which limits test windows and slows development.
Approach
We build digital counterparts of workstations: machine simulators that send events like real devices.
Goal
Full regression time: from days to hours, target ≤ 8 h; Share of automated regression cases: ≥ 70% of critical paths.

Client context

Industrial plants combine the IT and OT worlds: controllers, SCADA systems and MES run for years, and every line stoppage costs money. Software changes have to respect the rhythm of production. The client is an electronics manufacturer with its own MES that controls order flow, end-of-line testing and product genealogy.

Challenge

Every MES change is tested on the line during downtime, which limits test windows and slows development. Errors in product genealogy are detected only when customers file complaints.

Requirements and constraints

  • IEC 62443 (security of industrial automation systems) divides the installation into zones and conduits, defines security levels (SL) and requirements for component suppliers. Every IT/OT connection must pass through a controlled conduit. (source)
  • ISO/IEC 27001:2022 requires a documented information security management system: risk analysis, a statement of applicability, access control and supplier management. Every element of the project must be traceable to a control from Annex A. (source)
  • Project constraints: work only on anonymized or synthetic data outside production, access to systems through the client's infrastructure, every deliverable accompanied by documentation that the client's team can take over.

Approach and architecture

We build automation following the test pyramid: the most tests at the unit and API level, fewer at the UI level, and end-to-end scenarios only for critical business paths. The framework is built as a product (with code reviews, versioning and documentation) and runs in the CI pipeline from the first sprint, so the development team gets feedback in minutes, not after a week.

We build digital counterparts of workstations: machine simulators that send events like real devices. Tests of order flow, genealogy and exception handling (rejects, repairs, retests) run in CI without access to the line. Only a short confirmation test remains on the line.

Key elements of the solution:

  • Workstation simulators with machine protocols
  • Flow and genealogy tests in CI
  • Production exception scenarios
  • A short confirmation test on the line

Team and roles

RoleCountResponsibility
QA lead1organizing testers' work, test case reviews, defect metrics
Test automation engineer2framework, scripts, CI integration
Embedded software engineer (C/C++)1device software, HIL tests
Test analyst (ISTQB)1designing and executing test cases, reporting defects
Product owner and domain experts (client side)as neededpriorities, business decisions, acceptance

Phased schedule

PhaseWeeksDeliverable
1. Regression audit and candidate selection1–3automation map, cost-benefit analysis
2. Framework build and CI integration4–8framework, pipeline, test code standard
3. Automating critical paths9–16smoke and regression suites
4. Stabilization and reporting17–21quality dashboard, quarantine of flaky tests
5. Handover and team training22–24documentation, workshops, maintenance plan

Technology stack

Python, pytest, OPC UA simulators, Docker, GitLab CI, SQL.

Risks and how we mitigate them

RiskHow we mitigate it
Impact of IT changes on production continuity (OT)tests on a rig that replicates the line, changes only during downtime windows, zones and conduits per IEC 62443
Flaky automated teststest quarantine, root cause analysis, stable selectors and independent data
Undocumented behavior of the legacy systemcharacterization tests (golden master) before the change, old/new result comparisons

Measurable goals and KPIs

The values below are targets that we set with the client after a baseline measurement in the first phase.

KPITargetHow it is measured
Full regression timefrom days to hours, target ≤ 8 hsuite execution time in CI
Share of automated regression cases≥ 70% of critical pathstest repository
Critical defects detected after deployment0 critical defects in the first 30 daysproduction incident log

Lessons learned and good practices

Machine simulators free testing from downtime windows. This is the biggest change in MES development speed. Product genealogy requires testing exception scenarios, not just the happy path. A flaky test is worse than no test, because it undermines trust in the whole suite.

Why B2B.net

B2B.net S.A. has operated since 2015 and has worked for more than 50 brands, mostly where audits are a daily reality: in banks, insurers and critical infrastructure. We are an accredited exam center, so testing methodology is not a claim for us but a working standard. We give a first proposal of engineers within 24 hours, and a team can start in 5 business days.

Acceptance criteria

Each phase ends with formal acceptance against criteria agreed at the start. In this implementation, acceptance covers: automation map, cost-benefit analysis; framework, pipeline, test code standard; smoke and regression suites; quality dashboard, quarantine of flaky tests; documentation, workshops, maintenance plan. Final acceptance requires a KPI measurement report against the baseline, complete documentation handed over to the client's team, and a list of recommendations for the next stage, with a cost and risk assessment for each.

Next step

Facing a similar challenge? Write to office@b2bnetwork.pl or call +48 577 317 312. You get a first proposal of engineers or a plan for the first step within 24 hours.

What would this look like for you?

Book a 30-minute call. We will prepare a plan for the first weeks and a team matched to your system.

Let's talk

B2Bnetwork · B2B.net S.A. · accredited exam center. We describe clients by industry and scale, without names.

More projects: Manufacturing