You are not logged in. Your edit will be placed in a queue until it is peer reviewed.
We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.
- 2"In unit testing you must only test the functionality of one class". Absolute nonsense. The single biggest impediment to devs writing good automated tests is this crap about unit tests only being allowed to test a single class/method or whatever. Whoever dreamt up this claim made a mistake comparable to null mistake.David Arno– David Arno2021-09-15 08:26:17 +00:00Commented Sep 15, 2021 at 8:26
- @DavidArno, would you call that unittest? And how is it different from integration test? I am confused about unittest going through Zed Shaw's 'Leard Python the Hard Way' chp 47 on automated testing. Zed's test_ functions do not correspond 1-to-1 to the functions.Johan– Johan2024-01-03 11:18:16 +00:00Commented Jan 3, 2024 at 11:18
- 1@Johan - that is the debate about unit testing - does "unit" mean "unit of code", or "unit of work". If using "unit of code" you tend to mock everything, then you can end up with lots of strong coupling between implementation and tests, and also lots of low value tests (e.g. does my API method call the service method with exactly the same parameters passed into it?). Using "unit of work" (mocking only db/storage etc) then you lose the ability to exactly pin-point bugs and can easily blur the lines with integration/e2e testing. Which to use is more of a cultural rather than technical decisionJonathan Twite– Jonathan Twite2024-05-09 11:19:25 +00:00Commented May 9, 2024 at 11:19
Add a comment |
How to Edit
- Correct minor typos or mistakes
- Clarify meaning without changing it
- Add related resources or links
- Always respect the author’s intent
- Don’t use edits to reply to the author
How to Format
- create code fences with backticks ` or tildes ~ ```
like so
``` - add language identifier to highlight code ```python
def function(foo):
print(foo)
``` - put returns between paragraphs
- for linebreak add 2 spaces at end
- _italic_ or **bold**
- indent code by 4 spaces
- backtick escapes
`like _so_` - quote by placing > at start of line
- to make links (use https whenever possible) <https://example.com>[example](https://example.com)<a href="https://example.com">example</a>
How to Tag
A tag is a keyword or label that categorizes your question with other, similar questions. Choose one or more (up to 5) tags that will help answerers to find and interpret your question.
- complete the sentence: my question is about...
- use tags that describe things or concepts that are essential, not incidental to your question
- favor using existing popular tags
- read the descriptions that appear below the tag
If your question is primarily about a topic for which you can't find a tag:
- combine multiple words into single-words with hyphens (e.g. design-patterns), up to a maximum of 35 characters
- creating new tags is a privilege; if you can't yet create a tag you need, then post this question without it, then ask the community to create it for you