Guidelines and tips for writing tests - Manual - AxUnit - AxUnit - AxUnit,

AxUnit (legacy) CLI Tool (test)

Portfolio
SIMATIC AX
Product
AxUnit
Software version
2.0.9
Edition
08/2025
Language
English (original)
Package Name
@ax/axunit-docs

To give a short introduction into the testing aspects, we collected some recommendations from our experience regarding unit tests.

Tests should:

  • be stateless.
    • This guarantees reliability. The test should only fail if there is a bug in the code under test, not due to side effects of other tests or the environment.
  • be separated from productive code.
    • We recommend a separated test-folder, containing all tests. This will help you to stay organized.
  • be easy to understand, which scenario they test.
    • give the test function a meaningful name.
  • use only one assert per test.
  • avoid branching in tests. A test should only test a single aspect.
  • also check negative scenarios, in order to guarantee robustness of your code.
  • be written to reproduce bugs and ensure their correction for future versions.