google / google/ground-android

[Code health] DrawArea* tests are fragile - consider revising

Open
#2,147 0 comments 0 reactions 1 assignee Claimed by @anandwana001 View on GitHub
type: code health
Dominant language
Kotlin
Stars
293
Forks
149
Avg merge
1d 16h
Merged PRs (30d)
42

Description

`DrawAreaTaskViewModel` and `DrawAreaTaskFragmentTest` contain helper functions with non-trivial branching logic ([TotT 07-2014](https://testing.googleblog.com/2014/07/testing-on-toilet-dont-put-logic-in.html), and occasionally test via internal methods rather than testing public behaviors ([ToTT 08-2013](https://testing.googleblog.com/2013/08/testing-on-toilet-test-behavior-not.html)). Consider simplifying tests accordingly. Each test method also tests multiple behaviors, leading to later failing checks being masked by checks run earlier. Instead, we should test one behavior per test method.

@shobhitagarwal1612 FYI.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.