Conceptric
  1. CodeIgniter test coverage

    I like to use libraries; they move the business logic outside of the CodeIgniter MVC framework, where they and their associated test suites can be made independent. Since libraries can be reused in many CodeIgniter projects this maintains their portability, yet it’s simple to integrate them into the whole application test suite, where they can be run from the browser using a custom controller.

    Unfortunately, testing anything other than libraries and models is difficult because there’s no way to access the another important type of object: controllers. CodeIgniter positively encourages using controllers to implement business logic, consequently not being able to test them is a serious anomaly.

    Integrating a front-end testing framework, such as Selenium, might be the solution, but does that properly test the controller code? I don’t think it does; the target there is the presentation tier at the browser.

    The lack of good code coverage bothers me a lot, but I continue to struggle on with CodeIgniter because I’ve found other PHP frameworks to be just as lacking. Is this a general problem with frameworks? I’m tempted to try Ruby on Rails next to find out.

    There has been one comment to “CodeIgniter test coverage”

    1. Sunday, 24th May 2009 at 7:37 am, zorg wrote:

      CI is a PHP clone of Rails. Rails is a lot better when it comes to testing and about everything else… go for the original

    What do you think?

    XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

    You can follow any responses to this entry through the RSS 2.0 feed. You can skip to the end and leave a response. Pinging is currently not allowed.