Skip to main content

Posts

Showing posts from June, 2016

Ten Lessons from Rewriting Software

It Will Take A Lot Longer Than EstimatedIts navie to actually think this but if a system has been in production for say five years, expecting to reproduce it in five weeks is not possible. You may be able to get 80% of the core functionality done, but the remaining 20% that was added to, iterated and stabilized over the remaining five years is what will destroy any form of schedule.If your estimate exceeds three months, you need to reasses what you are doing by breaking down the work, or changing plan. The bigger the estimate, the bigger the risk.Deploy Incrementally Via CIIf you aren't deploying to a live environment as soon as possible, any future releases are destined to be failures, troublesome or just plain difficult.Soft releases and feature toggles should be used to aid constant releases.Morale Will Drop The Longer It Goes OnProbably the biggest and most surprising realization is the drop in personal and team morale.If you miss a "deadline" or keep failing to ship…

DDD - Bounded Contexts

A single domain can grow large when applying Domain Driven Design. It can become very hard to contain a single model when using ubiquitous language to model the domain. Classic examples prevalent in many domains would be Customer or User models. A bounded context allows you to break down a large domain into smaller, independent contexts.In different contexts a customer may be something completely different, depending on who you ask and how you use the model. For example, take three bounded contexts within a typical domain that allows customer administration, customer notifications and general reporting.ExampleNotification ContextA customer is their account id, social media accounts, email and any marketing preferences. Anything that would be required to uniquely identify a customer, and send a notification. + Id + Email + Marketing Preferences + Social Reporting ContextWhen reporting customers are nothing more than statistics. A unique customer ID is more than enough j…

Given When Then Scenarios vs Test Fixtures

There are two common ways of writing automated tests which apply from unit to acceptance tests. These are typically known as test fixtures and Given-When-Then scenarios.Test FixtureTraditional method of writing tests.The common JUnit/NUnit approach. Other languages have very similar concepts.Single test fixture with multiple tests.Test fixture is usually named after the subject under test.Can grow large with many test cases.Works well with data driven tests.Suited to solitary tests such as integration tests where GWT syntax would be verbose or hard to include.ExampleGiven-When-ThenBehaviour driven approach (BDD style).Made popular by tools such as RSpec.Single test fixture per behaviour.Test fixtures named after the functionality being tested.Often nested within other test fixtures.Smaller test fixtures but more verbose due to fixture per functionality.Easy to see why a test failed due to naming convention - assertion message is optional.Suited to sociable tests where the focus is on …