Supercharge Testing by Mocking
Aaditya M Nair (~AadityaNair) |
Testing is one of the cornerstones of good software engineering. It addition to help ensure that your code works as expected, it also has the advantage of iterating over your code faster. With sufficient tests, you can be pretty sure that your new code doesn't break any old ones. One of the biggest issue I find with writing tests is that there is a lot of boilerplate code that needs to be written to get even the basic unittests to work.
This talk will focus on
patch. These are awesome utilities provided with
unittest module to make your testing life much more painless but not a lot of people know about them. The flow of the talk will be as follows: [HTML_REMOVED]
- Intro to testing: Why do we actually need testing?
- The basic problem I find with testing: Boilerplate code. (with examples)
- Introduction to
- Applying them to real tests.
- Enhancing those tests: Assertions on mock.
- Caveats associated with their use.
Some basic knowledge about unit testing in Python would be great.
References:[HTML_REMOVED] https://docs.python.org/3/library/unittest.mock.html[HTML_REMOVED] https://docs.python.org/3/library/unittest.mock-examples.html
I am a student at IIIT-Hyderabad on the verge of completing my M.S. For the last two years, I have also been working part-time as a sysadmin for all institute servers and was involved in maintaining services like proxy, directory and the mail server.
I have previously interned as a Production Engineer for Facebook and am currently a Google Summer of Code intern with CCExtractor.