-
Notifications
You must be signed in to change notification settings - Fork 65
Behavioural, functional and unit testing suite
Automated testing is really needed in some key areas as it's not possible to understand all the repercussions a simple change can have. It can also help detect changes in core
.
There is a lot of documentation on the Internet about the whys and the hows. This is just a short summary of how we think it should work in this project.
Speed | Coverage |
---|---|
☀️☀️☀️ | ✔ |
Tests each method in isolation by mocking and stubbing the objects, scalars, arrays it uses
- 100% coverage is not necessary as the law of diminishing returns does apply here
- Private and static methods are testable if needed, just use the right tool for the job
Speed | Coverage |
---|---|
☀️☀️ | ✔ |
Tests components together, especially the interaction with core
components
- Key components which interact with ownCloud's public API should be tested. Things like Environment, Preview and FilesService
- Any method which involves a lot of mocking should be part of an integration test to try and cover many cases without spending too much time writing the test
Speed | Coverage |
---|---|
☀️ | ✔ |
It's a good way to make sure the response the frontend gets are in line with what's happening in the backend.
- Tests the controllers and the services they use.
- Validates status codes, error messages, content-type, etc.
- Makes sure the published REST APIs always works
Speed | Coverage |
---|---|
☁️ | ✘ |
This is to make sure that the user interface behaves as expected. It's really easy to silently break something in Javascript per example and by automating the detection of elements and using the interface as a user, we can make sure we don't let down users by shipping a broken product.
- Can take screenshots of the entire journey
- Can be cross-browser tested
- Writing unit tests for PHPUnit
- Writing unit tests for Codeception (if you want to use the BDD style syntax)
- Testing web services using Codeception
https://github.com/owncloud/gallery/blob/master/tests/README.MD
- General
- Installation
- Configuration
- OCC commands
- Developers