Skip to content

Component development

Peter Willendrup edited this page Jan 14, 2026 · 24 revisions

Basic structure

In-component documentation

Component (unit) testing

Run mctest

  • The mctest tool can be used to test a set of McStas/McXtrace instruments

Tips and tools for improving quality of your code

  • Keep it simple - complexity means a harder time debugging.
  • Choose algorithmic simplicity / readability over performance.
  • Document (in language that your colleague also understands) what your code is meant to do. You will even not fully remember yourself in a matter of months!
  • Please always be mindful and act on / minimise the number warnings from your c-compiler!
  • Run the mccode linter
  • If you experience weird crashes maybe time for Debugging the c-code?

A tip for a good workflow

Clone this wiki locally