BC Teardown #10: Users should not be your test suite

BC Teardown #10: Users should not be your test suite

Click around and hope is not a test plan.

The pain

After every update someone clicks through the system for days, hoping nothing broke. Something always slips through.

Why it happens

Manual testing is slow and never repeated the same way twice, so it gets skipped when time is short.

Before: Click around and hope

1. Create a test order
2. Post it
3. Open the invoice
4. Squint at the fields
5. Repeat for every scenario
   you remember
6. Forget the one that breaks

After: A repeatable AL test

// codeunit with Subtype = Test
[Test]
procedure ProjectCodeReachesInvoice()
var
  SalesHeader: Record "Sales Header";
  InvHeader: Record "Sales Invoice Header";
  LibrarySales: Codeunit "Library - Sales";
begin
  LibrarySales.CreateSalesInvoice(SalesHeader);
  SalesHeader."DF Project Code" := 'PRJ1';
  SalesHeader.Modify();
  InvHeader.Get(LibrarySales.PostSalesDocument(
    SalesHeader, true, true));
  InvHeader.TestField("DF Project Code", 'PRJ1');
end;

The result

Run the whole suite in a sandbox on the new version before you schedule the update. If it passes, update with confidence.

Tip: Add a test every time you fix a bug, so it can never come back.

Download this teardown as a PDF


Got a Business Central problem like this? Free BC update readiness check. Senior Microsoft certified developers, and you talk to the person writing the code. Contact Dataflow Solutions.