Delphi Test-Driven Development (TDD) and DUnitX-987ae7 — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited Delphi Test-Driven Development (TDD) and DUnitX-987ae7 (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
This skill guides behavioral expectations for test-driven development (TDD) using the modern Delphi ecosystem.
When operating under the scope of TDD, AI MUST ALWAYS prioritize the Red-Green-Refactor cycle. If the user requests TDD, DO NOT write the business implementation before writing the test that will fail.
interface section just to compile. Then, immediately write a complete DUnitX Test Case calling out the non-existent behavior or asserting an expected result. The test will logically fail.Assert pass.[TestFixture].[Setup] to instantiate Classes and Fakes. Use [TearDown] to clean up instances that do not use ARC (Interfaces).[TearDown] and injection via Interface (ARC) are mandatory to keep the suite watertight.Embrace context conventions like Action_Condition_ExpectedResult:
[Test]
procedure ComputeDiscount_LoyalCustomer_ReturnsTenPercent;Replace manual Boolean validations (Assert.IsTrue(A = B)) with fluent and specific Assert:
Assert.AreEqual(100.0, FInvoice.Total)Assert.IsNotNull(FCustomer)Assert.WillRaise(procedure begin FSut.DoInvalid; end, EBusinessRuleException)Assert.Contains('Error', LMessage)To isolate the class under test (SUT - System Under Test) from the infrastructure (Database, APIs, View), apply Strict Dependency Inversion (DIP) by injecting Interfaces into the SUT via constructor.
As Delphi does not have a built-in Mocking Framework in RTL, write local "Fake/Mock" Classes implementing the Interface to simulate the dependency within the test's implementation session.
// Cria-se o Fake only no arquivo de teste
TFakeEmailService = class(TInterfacedObject, IEmailService)
public
SentCount: Integer;
procedure Send(const AMsg: string);
end;TFDQuery) in the tested class. Always abstract database access into a IRepository and create a TFakeRepository for DUnitX.try..except on E: Exception do) in methods being tested, this breaks Assert.WillRaise().~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.