Home » Software Development (page 4)

Software Development

How can I write a Test if the Code is not there?

Introducing TDD is a lot more psychological than you think. When we start introducing TDD we need to think about how people new will react. For example, the first question that people ask is:   How am I going to write the test if I don’t know what the code does?   For people who are already doing TDD the ...

Read More »

How Can You Move From Manual Testing to Test Automation?

Manual testing is not what it was five years ago. The number of pure manual testing jobs is low and when such a job is available, the competition is fierce. It is common these days to meet manual testers that have a difficult time finding a new job. Due to budget restrictions for the testing team, there are also cases ...

Read More »

From Legacy Code to Testable Code #7 – Introduce Parameter

Today we’re going to talk about the Introduce Parameter refactoring pattern. This is one of the more useful patterns to clear code from dependencies. Here’s a method we’d like to test: public int Calculate(int x, int y) { if (OperationManager.ShouldAdd()) return x+y; else return x-y; } As we can see, there’s a nasty dependency right there in the middle. Since in this ...

Read More »

Matching string prefixes using a prefix-trie 2

After discussion the general problem of matching string prefixes two weeks ago, we starting on the implementation of a prefix-trie to solve the problem efficiently last week. Our implementation so far is able to quickly construct a prefix-trie from a list of strings. What is still missing is any kind of functionality to query the data structure for information. Today ...

Read More »

The Ugly Truth about Emergent Design

If the 2nd D in TDD is design, then we’re talking about emergent design. The tests drive the design, which emerges from thin air, and step by step reveals itself in all its glory. Emergent design has got to be superior to upfront design, right? Well, it depends. If we’re doing a design up-front, we need to take into account ...

Read More »

Matching string prefixes using a prefix-trie

Last week we discussed the problem of matching string prefixes and designed algorithms on the basis of a sorted list of strings. Our solutions had good runtimes given the constraint, however we can do much better by using a specialised data structure instead. The data structure in question is a trie, also called radix tree or prefix tree. Today we ...

Read More »

What is a Microservice?

Abstract In this article, excerpted from my upcoming book Microservices in .NET, I will talk about the characteristics that help you recognize a Microservice when you see one and that help you scope and implement your services in way that enable the benefits of Microservices A Microservice is a service with one and only one very narrowly focused capability. That ...

Read More »

Creating a Unit Testing Strategy – Part V

This is the 5th and final part of the series about analyzing what we’re coding, and therefore what to test. Last time, we actually got to writing the tests. Let’s do some cleanup. Step 8: Review Once we have the tests, it’s time to review both the code and tests. But we do those on a couple of levels. At the ...

Read More »

jq error – Cannot iterate over null (null)

I’ve been playing around with the jq library again over the past couple of days to convert the JSON from the Stack Overflow API into CSV and found myself needing to deal with an optional field. I’ve downloaded 100 or so questions and stored them as an array in a JSON array like so: $ head -n 100 so.json [ ...

Read More »