In general the guidelines used for writing highly modular and decoupled software also applies here.

We will look to some advice specific to EBox. You will notice that almost are issues are variations of the theme of isolation and decoupling from environment. EBox uses a lot of external programs so it is easy to lost track of isolation issues.

  • Never hardcode file or programas paths. Instead store them in EBox's configuration and retrieve them. That eases mocking and test environments creation.
  • Never hardcode root commands. Always construct them using the previous technique and isolate the construction in a object method to avoid code duplication
  • When possible, especifiy configuration file for daemons. In this way will be avoid to overwrite it while testing and we will be safe from permission issues.