-
Notifications
You must be signed in to change notification settings - Fork 20
Add testing to code principles #116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
ben-sagar
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some suggestions
|
|
||
| > We incorporate good security practice in all our code | ||
| ### We test our code |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some of these principles read like statements but some read like instructions - I feel we should try to get some consistency (although I don't have a good answer for this case!)
docs/principles/coding_principles.md
Outdated
| ### We test our code | ||
|
|
||
| > Tests can act as good documentation as well as avoiding bugs and regression issues. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This bit is generally a more detailed articulation of the principle, something like:
We are always able to prove that our code works and functions correctly by having a set of tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added. I've changed "set of tests" to "automated test suite".
Though I'm not sure if that's too restrictive. Do we have any cases where automated tests against code isn't possible/practical and manual tests alone are appropriate?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I do wonder if this is perhaps a bit too prescriptive
It's going to be right most of the time, but I don't know if people might get too hung up on the "automated" part?
We mention elsewhere about running unit tests as part of a CI pipeline, so I don't think we need to specify anything about automation here.
As this is a principles document rather than a technical standard, I think having a principle of "testing" is enough - other areas can cover the specifics of how we apply that principle in practice.
docs/principles/coding_principles.md
Outdated
|
|
||
| > Tests can act as good documentation as well as avoiding bugs and regression issues. | ||
| - It is usually self documenting |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This statement could be a bit misleading - should we put in the statement from your description instead?
- Acts as good documentation for the code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about "supporting documentation" as opposed to "good documentation"? To avoid the subjectivity of "good".
No description provided.