mirror of
https://github.com/simonmichael/hledger.git
synced 2024-11-08 07:09:28 +03:00
;doc: contributing: kent beck tests properties
[ci skip]
This commit is contained in:
parent
312e772468
commit
e0c511b5fc
@ -673,6 +673,24 @@ About testing in the hledger project, as of 201809.
|
||||
|
||||
### Kinds of tests
|
||||
|
||||
<div style="margin:1em 2em; font-style:italic;">
|
||||
"Here, then, is a list of properties of tests. Not all tests need to exhibit all properties. However, no property should be given up without receiving a property of greater value in return.
|
||||
|
||||
- Isolated — tests should return the same results regardless of the order in which they are run.
|
||||
- Composable — if tests are isolated, then I can run 1 or 10 or 100 or 1,000,000 and get the same results.
|
||||
- Fast — tests should run quickly.
|
||||
- Inspiring — passing the tests should inspire confidence
|
||||
- Writable — tests should be cheap to write relative to the cost of the code being tested.
|
||||
- Readable — tests should be comprehensible for reader, invoking the motivation for writing this particular test.
|
||||
- Behavioral — tests should be sensitive to changes in the behavior of the code under test. If the behavior changes, the test result should change.
|
||||
- Structure-insensitive — tests should not change their result if the structure of the code changes.
|
||||
- Automated — tests should run without human intervention.
|
||||
- Specific — if a test fails, the cause of the failure should be obvious.
|
||||
- Deterministic — if nothing changes, the test result shouldn’t change.
|
||||
- Predictive — if the tests all pass, then the code under test should be suitable for production."
|
||||
--[Kent Beck](https://medium.com/@kentbeck_7670/test-desiderata-94150638a4b3)
|
||||
</div>
|
||||
|
||||
1. Unit tests
|
||||
|
||||
Unit tests exercise small chunks of functionality. In hledger, that
|
||||
|
Loading…
Reference in New Issue
Block a user