Subscribe

Infrastructure-as-code demands constant testing

By Marilyn de Villiers
Johannesburg, 12 Oct 2018

With the advent of 'composable infrastructure', also known as infrastructure-as-code, it has become more important than ever to create and implement reliable, repeatable infrastructure that's been tested, and retested, every step of the way before it is put into production.

That's the message Obsidian's Karl Fisher delivered to developers at LinuxConf [ZA] 2018, a Linux and open source conference run as part of Open Source Week in South Africa this week.

Infrastructure-as-code (IaC), which is also sometimes referred to as 'software defined infrastructure', is a type of IT setup in which developers and/or operations teams automatically manage and provision the technology stack for an application through software, rather than using a manual process to configure separate hardware devices and operating systems.

Rather than rely on system administrators in a DevOps environment, for example, software developers can use code to provision and deploy servers and applications. The developer could write an IaC process to provision and deploy a new application before operations takes over for live deployment in production.

Testing first

"But what if operations wants to shift production forward, and you haven't tested it yet? You can't simply test in production, that would be ridiculous. Testing has to take place before going live," stressed Fischer.

That is where test-driven development (TDD) would solve the problem. TDD is a software development process that relies on the repetition of a very short development cycle - testing just enough code that could potentially fail, to ensure that the if the test does in fact fail, the functional code can be updated and retested to pass new tests. This process is repeated until all functional code has been tested, updated, and retested.

"The important thing to remember is that the rules for testing have to be the same. The best way to do this is to automate the tests, make them repeatable, to ensure the testing is valid. It does not matter what you use to do the testing, but it has to enable you to build the same way over and over and over again.

"Ultimately the goal is to write a test for your infrastructure that allows you to see that whatever you are building is as it should be," he concluded.

Share