Published inStackademic·Aug 14Server-Side Rendering with Kotlin, Javalin, jteThere’s a recurring hype nowadays. Everyone creates reusable web APIs to serve a single client, typically a React app. Most products don’t demand the separation of frontend and backend into two distinct apps. — Let’s talk about the alternative pragmatic alternative: a server-side rendered web app that condenses development into a single application and tech stack. We’ll follow a minimalistic approach with Kotlin, Javalin, and jte (the templating engine).Jte7 min readJte7 min read
Jul 26Member-only#NoSprintsFocusing on delivering value and continuous improvement is more crucial than adhering to a 2-week timebox. — Across many sprints in distinct teams from the past, I can hardly recall a successful one. Sometimes, we did overtime to fulfill the sprint commitment. Wrong predictions and trade-offs on quality were standard. In demos, I remember the team’s frustration and self-blaming and the customer’s deception. “We can’t do it…Noestimates4 min readNoestimates4 min read
Published inCodeX·May 12Member-onlyWhat is a user story? Debunking the mythsA user story is not a task, a request, or a requirement; it’s solely a user problem you need to work on. — User stories are not technical “Tech stories” are developers’ to-dos since they materialize what they have in mind to accomplish something meaningful. But what is that meaning? Tech tasks lack connection with the business domain; meaning exists only in the developers’ minds, which is not a good idea. “Tech stories” are tasks masked as user…User Story Card8 min readUser Story Card8 min read
Published inCodeX·May 6Member-onlyUnit Testing: Values and PrinciplesWhat’s a unit test? A function test? Can it interact with the outside? That’s meaningless if we don’t start with why we do testing in the first place. — Why do we write tests? I heard sentences like “because we need to have coverage”, “if you have a public class it needs a test”, and “because it’s part of our methodology”. None of that addresses why we test things… and we end up with a mechanical and blind approach…Testing11 min readTesting11 min read
Published inBetter Programming·Mar 16Member-onlyStory Slicing, a Practical GuideUser stories can always be broken down into smaller, more consumable pieces. Let me tell you how. — Why split? Make sure you read Part I first: The benefits of breaking down user stories How breaking down problems into smaller, more consumable pieces can improve predictability, feedback cycles, and…medium.com When to split? Should a user story always be split? My rule of thumb is to split always; not because it’s big but due to all the benefits of splitting which greatly exceed their overhead. …Software Engineering8 min readSoftware Engineering8 min read
Published inBetter Programming·Feb 8Member-onlyMisconceptions About Domain-Centric ArchitecturesThe benefits of segregating business and technical code extend far beyond replaceability. — ‘Domain’ is short for ‘business domain’ if the intent is commercial. However, the domain is used here in a broader sense to refer to the real-world problem the app is set out to solve (e.g., a to-do list, an online shop, or a game).Clean Architecture8 min readClean Architecture8 min read
Published inCodeX·Nov 22, 2022Deploying a Kotlin app to Railway (a Slack bot)We will deploy a “Hello world” Slack bot to Railway, sourced from GitHub (written in Kotlin). — Now that Heroku has no free plan anymore, it’s time to find a new home for our experimental JVM apps. Railway does the job. 1. Codebase Create a new Kotlin project. If you haven’t yet made git init, you should do it now. Make sure you have a .gitignore …Railway3 min readRailway3 min read
Published inCodeX·Nov 7, 2022The Testing Library meets SeleniumThe Testing Library enables testing as a user. It’s available for multiple JavaScript frameworks (e.g. React, Vue, Cypress). I realized it was possible and valuable to bring it to Kotlin’s Selenium. — The more your tests resemble the way your software is used, the more confidence they can give you. (Kent C. Dodds) What I developed a set of custom Selenium locators (e.g. ByRole, ByText) that wrap the corresponding Testing Library queries (specifically, the DOM Testing Library):Automated Testing6 min readAutomated Testing6 min read
Oct 14, 2022Selenium waitsWaiting for things to happen can be a source of slow and flaky tests. Let’s learn how to properly wait with Selenium (Kotlin). — Implicit wait In Selenium, you can query a page with: // wait until it's found, else throw a timeout exception driver.findElement(By.id("4-door")) // wait until at least one element is found, else return empty list when the the time out is reached driver.findElements(By.tagName("mat-option"))Selenium4 min readSelenium4 min read
Published inCodeX·Oct 4, 2022Member-onlyA testing strategy for a domain-centric architecture (e.g. hexagonal)I’ll propose a testing strategy for the hexagonal architecture. — Hexagonal architecture The hexagonal architecture and the clean architecture are domain-centric architectural patterns. They’re powerful and adaptable to your needs; even simple apps like command-line tools benefit from centralizing the domain (to separate the I/O from the actual algorithm). Here’s what you need to know: The main principle is that the app…Hexagonal Architecture11 min readHexagonal Architecture11 min read