I’m pretty sure BMO was designed to make module development easier for third party developers first and unit tests seem to be an after thought. But, this is okay, BMO allows FreePBX to be modular and enables allows it to be extended really easy. I personally believe that BMO was one of the best decisions the FreePBX project made. I’m not sure how I would have done thing differently. That being said, there are things I personally believe shouldn’t have been made into BMO modules and should just be part of framework, such as config and database. This may have changed a few things, like… having a framework depedency and a module registry dependency instead of having the single FreePBX dependency that we have today.
My biggest gripe is that the registry pattern we used makes code harder to test, since all tests need to interact with the same class to set the fake dependencies of a class under test. And this is the problem.
To resolve this, we will probably need to create a ton of classes that simulate the FreePBX application, just so we can test it easy. This will be a TON of work.
As for the old code being deprecated, I totally agree, we shouldn’t be adding or modifying code that can’t be tested with unit tests. But, our current situation is that we’re in a place where it’s too hard to write unit tests to begin with and until we resolve that problem, things will just be as they are.