devxlogo

Testing a Business Rule Should Not Have Any Side Effects

Testing a Business Rule Should Not Have Any Side Effects

Testing a business rule should have no side effects. Avoid err.raise and msgboxes inside business rule tests.

Consider this example:

 public const kMinimumApplicantAge = 18  'declared in common modPublic Function IsApplicantAgeEligible(DOB as date, testDate as date) asboolean    If datediff(

devxblackblue

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.

About Our Journalist