Week 2: Presentation proposal (samkh & atheers) #2372
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Assignment Proposal
Title
Property-based testing in Python using Hypothesis
Names and KTH ID
Deadline
Category
Description
We want to explain the topic of property-based testing,
where the coder defines the properties that the test cases must satisfy,
which then automatically generates test cases that enforce these properties.
We will look at how this is done in practice in Python using Hypothesis,
which is a library for creating unit tests in Python, based on property-based testing.
Instead of normal example-based testing, which we have seen in school where we manually define input-output pairs,
property-based testing instead tests a wider range of inputs to make sure that the code keeps true to the properties the coder has defined.
Relevance
Usually, example based testing is used when writing unit tests, where the programmer has to come up with various test inputs and define what the expected results are.
This is tedious and error-prone in the long run, thus one can utilize property-based testing to speed up the processes.
Property-based testing also explores more inputs and conditions, which makes it easier to uncover edge cases.
This is relevant to DevOps as it concerns test automation as well as being able to significantly enhance the testing suite.