Skip to main content

Posts

Showing posts from August, 2016

Past Mistakes - ORMs and Bounded Contexts

Sticking with the theme of documenting past mistakes, it's worth expanding a real life scenario where I was unaware of the use of bounded contexts and fully understanding the tools you use.Ignoring a Bounded ContextA fellow developer set upon a quest to rid numerous projects of duplicated records, which was effectively the active record pattern. This was a huge under taking split across hundreds of thousands of lines of code, over numerous separate projects. Close to completing the task I assisted and finally the shared library containing a single record for each type was complete. Each project now referenced the shared copy. This was versioned as each build was completed.For a while this worked with no problems. It certainly felt nice to see the reduction in duplicated code. Sadly sometime later myself and another developer made a seemingly innocent change. In terms of relation, the change was as far removed from the production error that we had just been alerted to was. There wa…

Test Your Live System using Live Service Tests

Traditionally there are three categories of functional tests.AcceptanceIntegrationUnitThis is often refereed to as the testing pyramid. Unit tests form the bulk of your suite, followed by a smaller subset of integration tests. Acceptance tests that cover features should be the tip of your testing strategy, few in number. These are great but there is a missing suite of tests - live service tests.Live Service TestsAcceptanceIntegrationUnitLive Service Tests.The role of live service tests (LST) is to test the live system against the production environment and configuration. LST would be fewer in number than acceptance tests. Unlike acceptance tests, these should run constantly. Once a run has completed, kick of a new test run. This will require a dedicated machine or piece of infrastructure, but the value provided is well worth it.LST should focus on journeys instead of functionality or features. In contrast to acceptance tests a user journey would be the core purpose of the system. Fo…

Why You Should Do Code Katas

Code katas are simple exercises that are meant to be repeated. They are great for learning a new language or tool. The goal is to learn something, not to complete them. In fact, if you don't finish a kata that is perfectly normal as long as you take something away. The beauty of code katas is they are small enough to be repeated and possibly completed within small time slots.TakeawaysBeginner or expert there will be something you can learn or take away. Beginners should take away language skills, tooling tricks and more. This is furthered when pair programming.Experts should be inclined to try new solutions rather than rinse repeat. Instead of solving the problem in the manner you do 9-5, try something completely new. Solving a kata ten times the same way is a waste. Instead solve it once, ten different ways. In short, experiment in code katas, not your production code.Going FurtherSadly a small minority seem such simple exercises as below them. No one is above doing a kata. Const…