Quantcast
Channel: XPlorations Archives - XP123
Browsing all 118 articles
Browse latest View live

Image may be NSFW.
Clik here to view.

Refactor: Parallel Arrays to Array of Objects

Your code sometimes evolves to have two or more arrays operating in parallel. If these arrays work in lockstep, it might be better to have one array with objects instead. Let’s look at an example...

View Article


Image may be NSFW.
Clik here to view.

Chartering and more: What happens before user stories?

Some teams try to start projects directly with user stories, but many important things need to happen earlier to make those effective. Chartering (aka Liftoff) provides a better way to structure the...

View Article


Image may be NSFW.
Clik here to view.

State Machines: Part 1, Principles

State machines are a very useful abstraction for behavior, but not everybody has run across them. This tool is useful for programmers, and for anybody else who is trying to create or understand a...

View Article

Image may be NSFW.
Clik here to view.

State Machines, Part 2: Interpreter Code

In Part 1, we looked at state machines and some common variants. This time we’ll look at code: how can you implement state machines? We’ll look at several approaches, in two classes: interpreter and...

View Article

Image may be NSFW.
Clik here to view.

State Machines, Part 3: Direct Code

Today we’ll look at how to implement state machines as direct code. In part 1, we looked at what state machines are. In part 2, we looked at how you might implement them with an interpreter that...

View Article


Image may be NSFW.
Clik here to view.

State Machines, part 4: Testing

State machines are useful, but how do we know they’re correct? We’ll look at several aspects of testing state machines: the machines themselves, and the interpreter and direct code implementations....

View Article

Image may be NSFW.
Clik here to view.

Refactor Template Method to Strategy

The Template Method design pattern defines an algorithm in an abstract class, and defers some steps to its subclasses. A Strategy defines a family of pluggable implementations. We’ll see how to...

View Article

Time Troubles – Binary Timer Overflow

A fixed-size counter (triggered by some sort of pulse) is a common way to represent time. #mc_embed_signup{background:#e8e8e8; clear:left; font:14px Helvetica,Arial,sans-serif; } /* Add your own...

View Article


Image may be NSFW.
Clik here to view.

Parameterized Unit Testing

Duplication in production code leads to errors, but certain duplication in test code causes problems too. When test after test has the same structure, the part that varies (aka the interesting part)...

View Article


Image may be NSFW.
Clik here to view.

Zero-One-Many in Test-Driven Development

The Zero-One-Many principle says that zero, one, and many are the three cases that make sense. (“A few” is more trouble than many.) This principle can guide you in splitting or expanding capabilities...

View Article

Image may be NSFW.
Clik here to view.

Observability, Constructor Test, Invariants – TDD Patterns

In Test-Driven Development (TDD), it’s hard to know what the next test should be – even if you know about Zero-One-Many or ZOMBIES. We’ll look at the challenge of observability – understanding an...

View Article

Image may be NSFW.
Clik here to view.

Building a Builder – TDD Patterns

A Builder (design pattern) lets you create an object piecemeal rather than requiring the data all at once. Let’s look at what’s involved in testing one into existence. Builder A builder has a...

View Article

Value Objects – TDD Patterns

How do you know if two objects are equal? One breakdown is to classify objects as value objects or reference objects. Value objects compare as equal when their component values are equal. Reference...

View Article


Image may be NSFW.
Clik here to view.

7+ Ways to Track User Stories

How do you track user stories? Does it help your team work better? We’ll compare multiple different approaches. Bonus: Tracking StoriesGet a free one-pager on state machines summarizing the key ideas....

View Article

Image may be NSFW.
Clik here to view.

TDD is an Alchemy Trick: Points and Partitions

Alchemists sought to transmute lead into gold. TDD turns a small set of examples into code that handles the whole range of inputs. Quite a trick – how does it work? TDD often implicitly uses the idea...

View Article


Image may be NSFW.
Clik here to view.

Integers, Floats, and Partitions – TDD Patterns

Partitions can help us divide up our input space for testing purposes, but what drives the partitions we use, and how do we choose suitable examples for TDD? We’ll look at several concerns:...

View Article

Image may be NSFW.
Clik here to view.

Primitives, Products, and Sums – TDD Patterns

Primitive types are the basis of others. They’re typically small (ish), and don’t involve repetition or recursion. We’ve already looked at numbers; today we’ll look at Booleans, characters, and simple...

View Article


Image may be NSFW.
Clik here to view.

Local Refactorings

To refactor is to systematically “improve the design of existing code”. There are many ways to classify refactorings, but one distinction stands out to me: local refactorings. A local refactoring...

View Article

Image may be NSFW.
Clik here to view.

List-Like Objects – TDD Patterns

List-like objects include linked lists, arrays (somewhat), stacks, queues, deques, heaps, etc. While we can often just pull one from a standard library, other times we have to create our own “linear”...

View Article

Image may be NSFW.
Clik here to view.

TDD: Balancing Progress with Stability

Bonus: TDD MovesGet a mini-poster of moves you make in TDD. Email Address Since Source Content Upgrades INVEST-ebook Testing-Graphics-Summary TDD-Impact-Calculator S-Curve Intensifying-Stories...

View Article
Browsing all 118 articles
Browse latest View live