Changes between Version 4 and Version 5 of Document/Development/Testing/WritingTesteableModules
- Timestamp:
- 09/01/10 02:06:25 (3 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Document/Development/Testing/WritingTesteableModules
v4 v5 1 1 In general the guidelines used for writing highly modular and decoupled software also applies here. 2 2 3 We will look to some advice specific to eBox. You will notice that almost all of the issues are variations on the theme of isolation and decoupling from environment. eBox uses a lot of external programs so it is easy to lose sight of the isolation and decoupling issues. This is how they creep back in to eBoxand the unit tests.3 We will look to some advice specific to Zentyal. You will notice that almost all of the issues are variations on the theme of isolation and decoupling from environment. Zentyal uses a lot of external programs so it is easy to lose sight of the isolation and decoupling issues. This is how they creep back in to Zentyal and the unit tests. 4 4 5 5 * Never hard-code file or program paths. 6 Instead store them in eBox'sconfiguration and retrieve them. That eases mocking and test environments creation.6 Instead store them in Zentyal configuration and retrieve them. That eases mocking and test environments creation. 7 7 * Never hard-code root commands. 8 8 Always construct them using the previous technique and isolate the construction in a object method to avoid code duplication