|
Mock Unit Testing with Dependency Injection
Get the complete article here
In software development, unit testing is performed to validate a small module or portion of functionality at a fundamental level. Test cases are written at the function or procedure level to validate inputs and outputs. Several test cases can be written to validate a given piece of functionality and then, when new functionality is added or changed, the existing test cases can be used to validate that existing functionality has not been affected. In theory, unit testing sounds like an effective tool that can be used to improve application quality. The improved quality comes at a price however, because developers must take into account the additional effort required to develop useful and relevant test cases while still meeting deadlines. To complicate matters, many application components rely upon other components and domain state to function properly, increasing the test effort. An application component may require a database, a web service, or even the current outside temperature in order to work properly.
Get the complete article here |
|