Skip to main content

This page is under review and therefore should not be read as official guidance

Proficiency Testing LIMS (PT-LIMS)

Project summary

The Proficiency Testing Laboratory Information Management System (PT-LIMS) runs Defra’s proficiency-testing programme, delivered by the Animal and Plant Health Agency (APHA) under its VETQAS brand. Participating laboratories worldwide receive test samples, analyse them and submit their results. APHA compares each submission against the expected result, scores it, signs it off and publishes an evaluation. Participation is voluntary and paid, so the system also manages customers, contracts, pricing and invoicing.

PT-LIMS was an ageing web application built on an older web-forms framework, with its business logic spread across a large number of hand-written pages and data-access components. It has been rebuilt as a modern web application that meets Defra software development standards and the GOV.UK Design System (GDS), using a layered “clean” architecture that separates the domain, application, data and user-interface concerns.

The rebuild reproduces all 17 feature areas — from reference data and the customer or participant registry, through scheme definition, distributions, result capture, assessment, sign-off and publication, to the external participant portal, notifications, data retention and audit — with around 94.5% line coverage across more than 470 automated tests.

At a glance
Service Proficiency Testing LIMS (PT-LIMS) / VETQAS
Organisation Animal and Plant Health Agency (APHA), Defra group
Users Internal APHA staff (contracts, scheme, scheduling, assessor, results sign-off, test consultant, support and administrator roles) and external participating laboratories (participant and viewer roles)
Status In delivery

As-is

PT-LIMS was a pair of web portals — an internal portal for APHA staff and an external portal for participating laboratories — built on an older web-forms framework. The business logic was written in a mix of languages and held in page-behind code and a bespoke business-object layer, talking to a relational database through hand-written stored procedures. Four separate background services handled email dispatch and the seven-year data-retention cleansing of attachments, consultant records and customer or participant data.

Key pain points that drove the modernisation:

  • Ageing, hard-to-support platform — the web-forms framework and its patterns are well past their prime, making the application costly to change and to keep secure.
  • Tightly coupled logic — business rules were entwined with the user-interface pages and a hand-rolled data-access layer, so changes were risky and hard to test.
  • No automated testing — there was no meaningful automated test safety net, so a change in one area could silently break another.
  • Accessibility gaps — the older interface did not meet current WCAG 2.2 AA standards.
  • End-of-life dependencies — the reporting and document stack relied on third-party components that had reached, or were approaching, end of life.
  • Fragmented background processing — separate background services for email and retention added operational overhead and were awkward to observe.

To-be

The target is a cloud-hosted web application, reached from a supported browser and backed by a managed relational database. The domain and business rules are reproduced faithfully but re-expressed as isolated, testable services.

  • Layered clean architecture — a strict dependency direction (web depends on application, which depends on the domain; infrastructure depends on the application and domain) keeps the business rules free of framework and database concerns.
  • Accessibility and design — every screen uses the GOV.UK Design System, so the service meets GDS style and WCAG 2.2 AA. An in-app accessibility statement is included and automated accessibility checks run in the test suite.
  • Security — authentication uses the corporate identity provider for internal staff and the cross-government identity service for external participants, over a standard single sign-on protocol. Role-based authorisation guards each page, security-header middleware applies the recommended GOV.UK and NCSC baseline, and antiforgery and HTTPS protections are on by default.
  • Testability — automated coverage exceeds the Defra 90% threshold across unit, UI component and repository tests.
  • Operability — the application exposes liveness and readiness health probes, applies its database migrations and seed data on startup, and folds the former background services into a single, observable background retention worker.

Steps taken

  1. Analysed the legacy system — reverse-engineered the two portals, the business-object layer, the database and the background services into four structured analyses (domain, application, database and interaction), capturing every actor, term, entity, screen and business rule.

  2. Produced a Product Requirements Document — synthesised the analyses and the High Level Design into a PRD defining the actors, domain model, bounded contexts and acceptance criteria.

  3. Decomposed into features — broke the PRD into 17 traceable feature specifications (FT-001 to FT-017), each with acceptance criteria, giving a no-silent-loss chain from legacy screen to test.

  4. Rebuilt the application — built on a modern web framework with an object-relational mapper in a layered clean architecture, converting page-behind and business-object logic into testable services.

  5. Applied GDS standards — integrated the GOV.UK Design System: the GOV.UK header with the Tudor Crown, phase banner, footer, GDS Transport font and accessible tables.

  6. Baked in WCAG 2.2 AA — enforced accessible page structure and controls, added an accessibility statement page, and ran automated accessibility assertions in the web test project.

  7. Built the test suite — wrote more than 470 unit, component and repository tests, reaching around 94.5% line coverage.

  8. Consolidated background processing — replaced the separate email and retention background services with in-application services and a single background retention worker that runs the four cleansing jobs and writes an auditable record for each.

  9. Iterative hardening — worked a prioritised gap analysis against the legacy behaviour, deepening the testing lifecycle, approval workflows, notifications, retention and audit so each feature meets its acceptance criteria.

Benefits, outcomes and success metrics

The outcomes below are evidenced from the rebuilt codebase and the project’s delivery records.

Benefit / outcome Metric / evidenced result
Moved off an ageing web-forms platform onto a supported, modern stack The service is a modern, supported web application with an object-relational mapper, verified from the solution’s project files
No loss of capability All 17 legacy feature areas reproduced as feature specifications FT-001 to FT-017, each with acceptance criteria
Automated test coverage introduced where there was none More than 470 automated test methods, with around 94.5% line coverage — above the 90% Defra target
Standards-compliant, accessible user interface GOV.UK Design System with the Tudor Crown header, phase banner, footer and GDS Transport font, an accessibility statement page, and automated WCAG 2.2 AA checks in the test suite
Stronger, standards-based access control Corporate and cross-government single sign-on, with role-based authorisation applied to every routable page
Hardened by default GOV.UK and NCSC baseline security headers, HSTS, HTTPS redirection and antiforgery are enabled in the web application
More operable service Liveness and readiness health probes are exposed, and the application applies its database migrations and seed data on startup
Simplified background processing The four separate retention and email background services are consolidated into in-application services and a single background retention worker, each cleansing job writing an auditable record

Lessons for reuse

Other teams modernising a similar legacy application can reuse the following patterns:

  • Analyse the legacy system into structured analyses first. Analysing the portals, business objects, database and background services into domain, application, database and interaction analyses captured every actor, entity, screen and rule before any rebuild began.
  • Decompose into small, traceable features. Breaking the PRD into 17 feature specifications with acceptance criteria gives a no-silent-loss chain from legacy screen to test.
  • Adopt a layered clean architecture. Keeping the domain and business rules free of framework and database concerns makes the logic unit-testable and protects it during the user-interface rewrite.
  • Convert page-behind logic into isolated services. Moving business rules out of the web-forms pages and the hand-rolled data layer into services makes them testable and reusable.
  • Adopt the GOV.UK Design System from the start — header, footer, fonts and accessible components — rather than retrofitting accessibility later.
  • Consolidate background workers. Replacing several standalone background services with in-application services and a single observable background worker reduces operational overhead.
  • Make environments reproducible. Applying migrations and seed data on startup means a new environment needs only a connection string to become useful.