No New Legacy Code

A journey to write software that is maintainable, flexible, high-quality, and hand-crafted to last

By Jeremy R. Sellars (@agentjsellars)

About

Why does no one want to touch that beautiful code I wrote?

Why does "new code" become disgusting "legacy code" so quickly?

How can we stop writing disappointing code?

I asked myself these questions, and the blame fell on the face in the mirror. So I set out on a journey toward writing *No New Legacy Code.* I am learning from gurus in the field in an attempt to stop writing code that just makes people want to re-write it.

As professionals, we want software that is, well, "soft" -- maintainable, flexible, high-quality, and hand-crafted to last. This is possible, but it requires professional practices. My first decade of writing software created programs that worked, but quickly became legacy - no unit tests, little separation of concerns, and no one really knows what exactly the users wanted it to do in the first place.

Join me on my journey to "No New Legacy Code."

Articles

Decisions are always in context 2019-02-14

Summary: Long before writing code, there are many decisions to make. Each decision can have a profound and lasting effect (you might even say a legacy!), whether thoughtfully considered or not. When teams share a common vocabulary for decisions and the context in which decisions are made, decisions can be made more effectively.

Generative Testing Part 6 – The DNA of Test Framework Assistance 2019-02-11

  • In part 5 of this discussion of "generative testing", we began to see areas where randomly generated data didn't quite fit into the unit testing way of doing things.
    • Tests need to be extensible, so it often isn't sufficient to merely provide one set of generators for use in all tests. We will look at ways of selecting arbitrary generators to use for particular tests.
    • It is easy to generate a bunch of random tests, but when you try to run a specific test again, that example may not have been generated again, then the testing framework can't find the test because different tests were generated each time (both a help and a hindrance). How do generative testing frameworks help?
      F_Parameterized_Test_With_Better_Generators 509 373

Generative Testing Part 5 – The hard way 2019-02-07

In part 4 of this discussion of "generative testing", we began transforming and assembling these generators to do much more powerful tasks. This time we will compose better sheepish-like strings in an attempt to trick the sheep-bleat? function with our unit tests.

Generative Testing Part 4 – Composing Generators 2018-11-25

In part 3 of this discussion of "generative testing", we started generating a simple types of data, integers and constants, but in order generate data useful for complicated applications, we'll need to assemble these generators to do much more powerful tasks.

Generative Testing Part 3 – Simple Generators 2018-11-11

In part 2 of this discussion of "generative testing", we skipped the first word, "generative", and went straight to "testing." This time, we'll move back to automatic test-case generation.