al-test-generation

al-test-generation is a skill for Claude Code, Codex from microsoft/BC-Bench. It costs 43 tokens per session (658 once invoked), scanned A, original, MIT.

A guide for writing automated tests in AL, the programming language used for Microsoft Dynamics 365 Business Central. It covers test codeunits, test procedures, required handlers, and data constraints.

In plain words
What is it for?
Creating AL tests and test automation for Business Central code, including tests that interact with its user interface.
Why use it?
It helps avoid common Business Central test failures caused by unhandled messages, pages, reports, or invalid test data.

Skill for Claude CodeCodex ✓ vendor

Written for no agent in particular: nothing here depends on one.

Good fit Creating AL tests and test automation for Business Central code, including tests that interact with its user interface.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/microsoft/bc-bench/al-test-generation
About the project

BC-Bench is a benchmark for measuring coding agents on real-world Microsoft Business Central development tasks written in AL. It helps compare models and agent configurations using reproducible evaluation data.

microsoft/BC-Bench · 57 stars · on GitHub · microsoft.github.io

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add microsoft/BC-Bench --skill al-test-generation
Clone the repo
git clone --depth 1 https://github.com/microsoft/BC-Bench

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for al-test-generation

README.md
[![agentmods](https://agentmods.dev/badge/skills/microsoft/bc-bench/al-test-generation/github.svg)](https://agentmods.dev/skills/microsoft/bc-bench/al-test-generation)
Your own site
<a href="https://agentmods.dev/skills/microsoft/bc-bench/al-test-generation"><img src="https://agentmods.dev/badge/skills/microsoft/bc-bench/al-test-generation/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for al-test-generation

Your own site · 80×15
<a href="https://agentmods.dev/skills/microsoft/bc-bench/al-test-generation"><img src="https://agentmods.dev/badge/skills/microsoft/bc-bench/al-test-generation.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 43 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 658 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00043 $0.00658
Opus 5.5 $0.00017 $0.00263
Sonnet 5.5 $0.00009 $0.00132
Haiku 4.5 $0.00004 $0.00066

Measured 1mo ago against content hash 15b1e4dfa461, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

al-test-generation scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

src/bcbench/agent/shared/instructions/microsoft-BCApps/skills/al-test-generation/SKILL.md · 94 lines

How it starts

The opening of the file, as written. The whole thing — 94 lines — stays where its author put it; the contents beside it link to each section on GitHub.

To create AL tests for Microsoft Dynamics 365 Business Central, follow this process:

1. Analyze the Code Under Test

Before writing any test code:

  1. Read and understand the procedure or functionality being tested
  2. Trace through all code paths to identify UI interactions
  3. Examine table definitions for TableRelation constraints

2. Identify Required Handler Methods

CRITICAL: Tests fail with "Unhandled UI" errors when handlers are missing.

Look for these patterns in the code under test:

Code Pattern Required Handler
Confirm() [ConfirmHandler]
Message() [MessageHandler]
StrMenu() [StrMenuHandler]
Page.Run() [PageHandler]
Page.RunModal() [ModalPageHandler]
Report.Run() or Report.RunModal() [ReportHandler]
Report request page [RequestPageHandler]
Hyperlink() [HyperlinkHandler]
Notification.Send() [SendNotificationHandler]

3. Analyze TableRelation Constraints

CRITICAL: Tests fail with validation errors when inserting data that violates TableRelation constraints.

Before inserting test data:

  1. Read the table definition for all fields receiving values
  2. Identify fields with TableRelation properties
  3. Ensure related records exist before inserting test data
  4. Use Library functions (e.g., LibrarySales, LibraryPurchase) to create prerequisite data

4. Write Test Structure

Follow the AAA pattern (Arrange-Act-Assert):

[Test]
[HandlerFunctions('RequiredHandlers')]
procedure TestProcedureName()
begin
    // [GIVEN] Setup test data and preconditions
    Initialize();
    CreateTestData();

    // [WHEN] Execute the action being tested
    ExecuteAction();

    // [THEN] Verify the expected results
    VerifyResults();
end;

Read the full file on GitHub · 94 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 94 lines · 43 tokens per session scan A 15b1e4dfa461

Subscribe to this mod's changes

al-test-generation is a skill published in the GitHub repository microsoft/BC-Bench (57 stars, last pushed today), licensed MIT. It adds 43 tokens to every session and 658 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

skill-testing

AL test development patterns for Business Central. Use when creating test codeunits, writing Given/When/Then test procedures, using Library Assert, configuring test projects, or implementing TDD workflows.

javiarmesto/ALDC-AL-Development-Collection · 41 tokens

aldc

Use canonical ALDC architecture, implementation, TDD orchestration, review and specification workflows for AL / Business Central projects.

javiarmesto/ALDC-AL-Development-Collection · 27 tokens

conduct

AL Conductor Agent - Orchestrates Planning → Implementation → Review → Commit cycle for AL Development. Enforces TDD and quality gates for Business Central extensions. Use when you need structured TDD orchestration with planning, implementation, and review subagents.

javiarmesto/ALDC-AL-Development-Collection · 53 tokens

research-engineer

An uncompromising Academic Research Engineer. Operates with absolute scientific rigor, objective criticism, and zero flair. Focuses on theoretical correctness, formal verification, and optimal implementation across any required technology.

davila7/claude-code-templates · 43 tokens

eval-dataset-design

A guide to creating reliable test sets for AI agents. Each evaluation task includes the request, the simulated user's behaviour, a reset starting state, and a success check that can be independently verified.

bojieli/ai-agent-book · 138 tokens

tika-eval-compare

Compare extracts from two Tika builds over a corpus to detect regressions in content, encoding, exceptions, and embedded-document handling. Use for "compare before/after extracts", "eval this change against the corpus".

apache/tika · 50 tokens