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.
Required fields*
-
Regardind input validation take a look at this answer.blunova– blunova2021-12-31 14:53:42 +00:00Commented Dec 31, 2021 at 14:53
-
1You do (or at least should) test your tests. In TDD you run them when you're expecting them to fail, and check that they fail for the reasons you're expecting (and give useful feedback when they do) - hence red, green, refactor. And once they're passing you're constantly rerunning them, so you'll find out if something changes and get to decide whether the test or the implementation needs changing as a result. There are also methods of testing (like mutation and fuzz testing) that can find the problems you forgot to check for.jonrsharpe– jonrsharpe2021-12-31 16:37:54 +00:00Commented Dec 31, 2021 at 16:37
-
8Your arguments here and in comments below all appear to assume that the objective of testing is 100% certainty that your code is correct. This is a strawman argument: it is an unrealistic goal, and is not the reason people test. The reason is that in practice we do catch errors in test. You do test your code in some way before delivering it, don't you? You don't just write so many lines of code and hand it over without actually trying it to see if it works, right?David K– David K2021-12-31 16:46:41 +00:00Commented Dec 31, 2021 at 16:46
-
2@jonrsharpe: And mutation testing is actually testing tests as well, or more precisely, testing test coverage. (Every mutation should lead to at least one failing test, indicating 100% coverage, but only a maximum small number of tests, indicating tightly focused tests.)Jörg W Mittag– Jörg W Mittag2022-01-01 10:18:00 +00:00Commented Jan 1, 2022 at 10:18
-
1Actually, if a Sudoku solver tells you there is no solution, you are stuck. If it tells you that the Sudoku follows the rules by having exactly one solution, you are stuck.gnasher729– gnasher7292022-01-26 19:45:28 +00:00Commented Jan 26, 2022 at 19:45
|
Show 3 more comments
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