Dependency Injection frameworks: an improvement to testability ?

University essay from Umeå universitet/Institutionen för datavetenskap

Author: Anders Lundberg; [2015]

Keywords: ;

Abstract: Testing is a crucial part of any software project. Its importance can be seen in the increasing amount of developer striving towards producing code with higher testability, thus being able to verify and validate the functionality of their systems. The design and structure of the code is thereby very important, to incorporate testability at a satisfying level. Dependency-Injection(DI) is a way of reversing the dependency flow between objects in a system, to make them more isolated and easier to test. As DI will help the developer to build code in a good objectoriented way by promoting thought through structure, this will lead to higher testability in the produced code. This report gives a overview of what testability is, if it can be measured and if DI frameworks can be beneficial from a testability point of view. By drawing conclusions on previous studies and work done in this field, these questions have been answered. Also a system for calculating dependency and coupling between objects is also presented, and shows that the conceptual use of DI gives more testability. The paper concludes that the use of DI frameworks will be beneficial for a systems testability, although DI itself is the major factor and not the frameworks. However as the frameworks make the use of DI that much easier there will be a significant increase in testability with the use of them.

  AT THIS PAGE YOU CAN DOWNLOAD THE WHOLE ESSAY. (follow the link to the next page)