This is week 2 of my software engineering course for my computer science degree. For this week, we are tasked to answer the following question "In lab 1 on Junit you used a Mock. In your own words describe what a Mock is and why it is useful in unit testing." This is in reference to the first lab, where we practice using mocks with unit testing. Essentially, a mock is a way of faking an aspect of a unit test that typically would be handled by a remote server or the like in the real world. Essentially, you can output fake data or a fake response to run your unit tests. This is incredibly useful incase you are developing offline, or you simply don't have access, or it could potentially cost money to run the test in a live environment. One example of this would be when uploading to an S3 bucket in AWS.
No comments:
Post a Comment