Return to search

Dependency Injection and Mock on Software and Testing

Software testing has been integrated within software development life cycle due to its importance in assuring software quality, software safety, and customers' satisfaction. However, problems in software testing are prominent among software developers as system grows in size and complexity. Dependency injection becomes an appealing solution for developers with its practicality to improve software design, improve testability, and enable mock testing technique. The study aims to discover the extent to which the dependency injection facilitates software design and software testing. In addition, the effect of mock practice on testing is also assessed. Metrics for investigation are defined and measured on various aspects of two systems. The two systems are selected and developed based on the same user requirements, development technologies, and methodologies. By comparing the two systems against the investigated metrics, we aim to reveal whether the dependency injection improve the code design. Then four test suites from both systems are evaluated in relation to testability. The results demonstrate that the dependency injection does not seem to improve the code design if comparing on the selected metrics. Even though it does not score better, its effect is evident in other software aspects. The testability of the two systems is similar and suffers from the same problem. Meanwhile, mock helps assist software testing and improve testability. The effect of mock technique can be witnessed, especially when it is applied with other test techniques. Explanations and discussions on these findings are addressed in the paper.

Identiferoai:union.ndltd.org:UPSALLA1/oai:DiVA.org:uu-226214
Date January 2014
CreatorsVeng, Mengkeang
PublisherUppsala universitet, Informationssystem
Source SetsDiVA Archive at Upsalla University
LanguageEnglish
Detected LanguageEnglish
TypeStudent thesis, info:eu-repo/semantics/bachelorThesis, text
Formatapplication/pdf
Rightsinfo:eu-repo/semantics/openAccess

Page generated in 0.0048 seconds