Dependency Injection frameworks: an improvement to testability ?
Independent thesis Basic level (degree of Bachelor), 10 credits / 15 HE creditsStudent thesis
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.
Place, publisher, year, edition, pages
2015. , 38 p.
, UMNAD, 1030
Engineering and Technology
IdentifiersURN: urn:nbn:se:umu:diva-108379OAI: oai:DiVA.org:umu-108379DiVA: diva2:852739
Bachelor of Science Programme in Computing Science