, J](offline: Service[K, J], online: => ReadableStore[K, J]): CompoundService[K, J] =
    CompoundService(Some(offline), Some(() => online))
  def fromOffline[K, J](offline: Service[K, J]): CompoundService[K, J] =
    CompoundService(Some(offline), None)
  def fromOnline[K, J](online: => ReadableStore[K, J]): CompoundService[K, J] =
    CompoundService(None, Some(() => online))
}
Rather than being an afterthought for SCM, an appropriate testing strategy is what enables an SCM in an agile environment. To be more agile, you need to avoid the silo-based perspective of development, SCM, and testing being three different disciplines. Instead, think about how the processes in one part of your development ecosystem affects what you can do in the others.
Occasionally we hear the question, "What does testing have to with software configuration management, anyway?" Testing is essential for agile SCM environments and agile CM environments are built on testing. To explain this idea, we need to talk about what SCM is and how testing helps.
The traditional approaches to software change management focus on the software lifecycle and identifying and controlling what changes happen in what context. Identification of the facts of changes is important. What matters most to many stakeholders is less the fact of the change, but rather the impact of the change to them. People care that their system works as expected, that the functionality was added as desired and not removed accidentally. We want to ensure that the value of our configurations is increasing over time rather than decreasing! To verify these things you need to test the working application. In this sense, you can't fulfill the goals of SCM without testing.
As a system evolves, you want to know at what point risks increase. The more frequent and automated the testing, the easier it is to identify the point in time when a system is in a configuration that does not work. This is where something like continuous integration comes in. In his recent book Continuous Integration: Improving Software Quality and Reducing Risk, Paul Duvall discusses how a CI system is a central part of the software quality lifecycle. It allows testing not only for functionality, but also for various metrics.
We will now describe the trade-offs between and identification-based approach to SCM and a verification-based approach.
Progress: How quickly a codeline evolves to encompass new features or fixes. How to set the balance varies depending on the needs of the project. Stability is always important since, without stability it's difficult, if not impossible, to make progress. Stable in this sense means that little changes, but by this definition, stable can become stale rather quickly. A more useful definition of stable is that the quality of the code is staying as good as it was. With this sense of stable positive change can happen.
One way to ensure stability is to add controls and processes to ensure quality, but it is easy to make the controls interfere with the business of an organization: delivering new functionality. The classic example of this is requiring changes go through extensive (manual) review before being worked on and then requiring extensive (and time-intensive) testing before making a change. The idea behind this is well meaning: software is complicated and we don't know the effect of a change, so let's be very cautious in making changes. These rules will improve stability, at least on the surface but at a great risk to your rate of progress. In our previous article, The Illusion of Control we discuss that it is often better to have more visibility into effects of a change rather than attempt to guarantee that a change will be "safe." For more on how to emphasize transparency over traceability, see our 2007 September article Lean-Agile Traceability: Strategies and Solutions.
Each of these rules can also be validated through an automated process. Test coverage tools can allow you test whether new code has unit tests. For example, testing can check not only functional compliance (the code still works based on the tests) but process compliance, as well (the metrics that we consider important are also met).
Continuous Integration: Improving Software Quality and Reducing Risk has excellent practical advice on how to use your build process to measure various quality and policy metrics.
Another difference between this point of view and traditional SCM is that traditional SCM is often event-based, focused on baselines, individual changes, etc. Lean/agile SCM is focused on managing the flow of change across the value stream. In an event-based model, the fact that a developer made a change is of primary interest, and our infrastructure is focused on tracking (and perhaps preventing) the developers from making a change.
In the model that we are discussing here, the item of interest is the impact that the developer's change had on the system. We can use criteria like code quality to initiate action, rollback changes, etc. The difference is one of priorities and focus. We care about tracking the various events, as they allow us to recover when things start going in the wrong direction. We want to report on the impacts, however, and not simply the events.
During coding: Software developers write unit tests for any changes/additions that they are making, and frequently run the unit tests for other parts of the code to ensure that their change did not break anything. This might also be a good time to extend the functional test suite. When a developer feels that their work is ready to share, she updates her workspace, does a final build and runs the unit test suite.
Once code is submitted an automated integration build is run. This build might run all the unit tests as well as any integration tests.
Periodically, nightly or more frequently as possible, longer running automated regression or functional tests are fun.
As new featured appear on the scene, manual testing can happen for those features that do not yet have automated tests.
As mentioned above, there is a sense in some circles that testing is not relevant to the SCM community because testing is not part of build management or release engineering. The problem with this idea is that if SCM is about ensuring the integrity of the product, what other mechanisms do we have to do this? While we often speak in favor of cross-functional teams where people do not have traditional roles and everyone has a broad skill set, it is likely that many organizations have some sense of boundaries.
The software developer is responsible for writing unit tests for any code she touches and for running any tests available so as to verify the stability of the codeline might also work with the QA Engineer to write functional tests. She might also help maintain build scripts for modules they understand architecturally.
Many companies use workflow and tools to help automate their process, e.g. having defects being reported and going through a certain lifecycle with different sign-off points and different levels of authority. Agile teams tend to keep these processes as simple as possible - allowing people to make decisions flexibly based on their own judgement. What happens, though, if you are in a situation where this is not deemed sufficient? Don't forget that changing a process requires testing to ensure that the process now does something slightly different. It is very common to find organisations making process changes on the live system in a rather uncontrolled manner.
Change control and configuration management: Can you reliably report on what was changed and when? Can you roll back changes if they didn't work?
Testing as for code: Can you automate this and make sure the workflow still works and a minor change hasn't broken something else?
Release: Do you have a test environment so that changes can be made offline, tested and then applied to the live environment?
These things need to be taken into account when choosing the tool you will be using for your process: What reporting requirements are necessary, are there any licensing implications for test environments?
While not part of the traditional definition of SCM, testing is an enabler for an agile SCM environment. Rather than controlling risk by slowing change, you control risk by monitoring the state of your codeline after each change.
Writing tests where there are none is challenging, but necessary.Fat-bottomed stones you make the skimming world go round.
Stones skipping over water is one of the joys of holidays by lake or seaside, but it seems most of us have been doing it wrong for centuries, at least if you prefer quality of bounces over quantity. Generations of parents have taught their children different hand and arm movements, but most have agreed the flatter the rock, the better.
Sensible as this seems, in a new paper, mathematicians have proven the truth is more complex. The finding could have implications beyond giving an advantage in family stone-skimming contests. Asteroids have been spotted bouncing off the atmosphere like a skipped stone, and one even left a mineral trail over hundreds of kilometers from hitting the Earth at a low angle. The more we understand stones on water, the better placed we should be to anticipate how larger objects behave in circumstances that may prove rather important. Indeed, the stone-skipping discovery was an unexpected consequence of trying to make air travel safer.
Dr Ryan Palmer of Bristol University and Professor Frank Smith of University College London found that flat stones do indeed maximize the number of times a stone will skip. The reasons are probably what you would expect – a flat stone will face less air resistance if traveling in the right orientation, and will experience greater force from the water relative to its weight, improving the chance it will bounce.
However, Palmer’s computer modeling revealed stones with curved bottoms have their own attractions. They can experience a “super-elastic response” when they hit the water, causing them to rear