# Stateful Testing for Android App State Logic

DevFeed: [Stateful Testing for Android App State Logic](<https://devfeed.tech/articles/top-notch-stateful-testing-in-android-25693.md>)

Original publisher: [Read original article](<https://sergiosastre.hashnode.dev/top-notch-stateful-testing-in-android>)

Author: Sergio Sastre Florez

Published: 2022-08-31T05:59:40Z

Content type: tutorial

Language: en

Sources: [Sergio's little tech corner](<https://devfeed.tech/sources/sergio-s-little-tech-corner.md>)

Topics: [Testing](<https://devfeed.tech/topics/testing.md>), [Android](<https://devfeed.tech/topics/android.md>), [App](<https://devfeed.tech/topics/app.md>), [Requirements](<https://devfeed.tech/topics/requirements.md>), [test](<https://devfeed.tech/topics/test.md>), [ui](<https://devfeed.tech/topics/ui.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [android-app-development](<https://devfeed.tech/tags/android-app-development.md>), [java](<https://devfeed.tech/tags/java.md>), [keyboard](<https://devfeed.tech/tags/keyboard.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [requirements](<https://devfeed.tech/tags/requirements.md>), [state](<https://devfeed.tech/tags/state.md>), [stateful](<https://devfeed.tech/tags/stateful.md>), [tdd](<https://devfeed.tech/tags/tdd.md>), [test](<https://devfeed.tech/tags/test.md>), [testing](<https://devfeed.tech/tags/testing.md>), [ui](<https://devfeed.tech/tags/ui.md>), [unit-testing](<https://devfeed.tech/tags/unit-testing.md>), [view](<https://devfeed.tech/tags/view.md>)

## AI overview

This tutorial explains stateful testing for Android applications by modeling app state, user actions, preconditions, and postconditions. It uses a text editor with text changes, undo, and redo as an example.

## Source excerpt

Broadly speaking, in an app, state is any value that can change over time. All Android apps display state to the user, e.g. an enabled/disabled button, the text displayed in a View, etc. We expect users to modify the state by performing actions throu...