Skip to content

Instantly share code, notes, and snippets.

5 pitfalls faced migrating from manual testing to automated testing

When using Continuous Delivery you need to have confidence that your code is correct and to have that confidence you need a system in place. Humans are fallible and we're all going to push buggy or broken code eventually; that's why we have procedures and systems in place to try and keep us on the right path.

Before migrating to continuous deployment our system relied on manual testing. We'd push our changes to a test environment and get our changes validated by a dedicated tester. Then, when it came to going to production, we'd get a sprint's worth of work into a staging environment, have the testers validate it there before finally deploying to a live environment.

Naturally, you can't rely on manual testing in continuous delivery - if you have to wait an indefinite period after you finish development the process can't really be called continuous. Instead, you rely on a battery of automated tests to pick up the slack - raise your pull

@AHarman
AHarman / blogpost-next-state.md
Last active May 13, 2022 13:07
# Persisting client-side state in Next.js using hooks and local storage

Persisting client-side state in Next.js using hooks and local storage

Tl;Dr

I set up some custom React hooks that wrapped useState, saving the React state in the browser's local storage and used the useEffect hook to avoid the pitfall of accessing local storage during static/serverside rendering.

The problem

I ran into a challenge when I wanted to be able to persist some simple state between pages of a Next.js app. Normally, in a React single page application, state is preserved between "pages" because there's no actual page change - routing and page rendering is all done in the same Javascript context whereas different pages in a Next.js app will all have a separate context. Conventional state management tools, such as React Redux or the Context API, rely on this shared context and state will be lost on a browser refresh or native browser navigation unless efforts are made to store the state in an external store.

Additionally, I wanted to take advantage of Next.js' ability to render pages sta

package com.alexharman.stitchathon.settings
import android.content.Context
import android.text.InputType
import android.util.AttributeSet
import androidx.preference.EditTextPreference
class EditNumberTextPreference(context: Context, attrs: AttributeSet, defStyleAttr: Int, defStyleRes: Int):
EditTextPreference(context, attrs, defStyleAttr, defStyleRes) {