# SubType property on codeunits
> Version: _Available from runtime version 1.0._
Specifies the purpose of a codeunit.
## Applies to
 Codeunits
## Property value
Value|Description
Normal|Defines a general-purpose codeunit. This value is the default.
Test|Defines a codeunit that contains test methods.
TestRunner|Defines a codeunit that runs one or more test codeunits.
Upgrade|Defines a codeunit that contains data-upgrade triggers.
Install|Defines a codeunit that contains extension-installation triggers.
## Syntax
```al
SubType = Normal;
```
## Remarks
Codeunits that have the SubType property set to Test or TestRunner support automated testing of your application.
 A Test codeunit contains the test methods that test your application. When a test codeunit runs, it executes the OnRun trigger, and then executes each test method in the codeunit. Unlike a normal codeunit, where a failing method terminates the codeunit, a test codeunit continues to run its remaining test methods even if one test method fails. See ../devenv-test-codeunits-and-test-methods.
 A TestRunner codeunit manages the execution of one or more test codeunits and can integrate with external test management and reporting frameworks. It supports the OnBeforeTestRun and OnAfterTestRun triggers, which run immediately before and after each test codeunit runs, so you can do preprocessing and postprocessing, such as initialization or logging test results. See Test runner codeunits<../devenv-testrunner-codeunits>.
An Upgrade codeunit contains the code that upgrades data from a previous extension version so that it's compatible with the current version. Upgrade codeunits support system triggers, such as OnUpgradePerCompany and OnUpgradePerDatabase, that run when you start the data upgrade process. See ../devenv-upgrading-extensions.
An Install codeunit contains code that runs operations, such as initializing data, when an extension is installed for the first time or reinstalled. Install codeunits support the OnInstallAppPerCompany and OnInstallAppPerDatabase triggers. See Writing extension install code<../devenv-extension-install-code>.
## Related information
devenv-codeunit-properties
../devenv-test-codeunits-and-test-methods
Test runner codeunits<../devenv-testrunner-codeunits>
Upgrade codeunits<../devenv-upgrading-extensions>
../devenv-extension-install-code
SubType property for BLOB fields<devenv-subtype-blob-property>

Copyright (c) Microsoft Corporation. CC BY 4.0, https://creativecommons.org/licenses/by/4.0/; code samples MIT. From https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/properties/devenv-subtype-codeunit-property, MicrosoftDocs/dynamics365smb-devitpro-pb at 828b6ee (2026-11-19). Changed: includes filled in, links to this site, and for agents shortened without dropping a fact. https://jonas-paprotka.de/docs/dev-itpro/developer/properties/devenv-subtype-codeunit-property/
