owncloud / owncloud/android

[EPIC] Tests refactoring

Open
#4,063 2 comments 0 reactions 2 assignees View on GitHub

Nobody has claimed this yet.

Epic QA
Dominant language
Kotlin
Stars
4.2k
Forks
3.1k
Avg merge
1d 12h
Merged PRs (30d)
7

Description

Current status of tests in ownCloud Android app

We're in the process of refactoring some of the tests or the way we test in the app. We have 2 types of tests in code: unit tests and UI tests.

Unit tests

We want to create unit tests for classes that on the one hand check that their methods return the expected result and on the other hand verify that their methods call the corresponding inner methods:

owncloudData module:

Things to discuss

  • Check migration tests and remove them if not useful
    Answer:
  • Check why authentication.datasources.implementation is instrumented
    Answer: it needs the context, so we need the test to be instrumented to get it
  • Move providers to another package called providers?
    Answer: yes, they will be moved
UI tests

👷🏼‍♂️ (We'll discuss about this and update this section...)

Things to discuss

  • Naming of the tests: which format should we follow? testSomethingReturnsFoo or something - ok - returns foo
    Answer: for the moment, we decided to follow the convention: {name of the method} returns {foo} when {conditions or environment}
  • Are tests which expect exceptions necessary?
    Answer: if they just make a mock throw an exception, without the method being tested catching it and doing something with it, they are not necessary since we're not testing real code

Related issues

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.