|By Anders Wallgren||
|October 2, 2015 12:45 PM EDT||
Measure Twice - Cut Once: The Benefits of Test-Driven Development
Automated software testing continues to play a vital role in enterprise software delivery and the speed with which software-driven organizations can begin to produce value. You want to ensure quality software, alongside fast time to market. How do you balance the need for speed with the need to test everything to deliver high-quality software to the end user?
At last year's DevOps Enterprise Summit, which Electric Cloud hosts in partnership with Gene Kim, author of The Phoenix Project, Kim asked every speaker to end their presentation with a slide that covered one of the two following topics: "Here's what I don't know how to do" or "Here's what I'm looking for help with." This gave all attendees at the summit insight into the top enterprise IT problems facing the DevOps community at large. It came as no surprise that several of the top challenges revolved around the concept of testing, and more specifically, the focus on better strategies and tactics for creating automated tests for legacy applications.
DevOps and test-driven development
I'm fascinated with the concept of testing in the software development cycle because this is where a lot of the value lies. What good is a killer feature if it doesn't work or a new release if it gets postponed for months as you try to fix various bugs? Streamlining and accelerating testing not only speeds up your feedback loops-and your entire delivery pipeline-but also serves as the most immediate gratification and validation point in your process: you've developed a new feature, and you've proven that your code works!
Talking with customers, it becomes obvious that there's no "one size fits all" in DevOps in general and in software testing in particular. Organizations need to develop the patterns and processes that make the most sense for their teams and their business. For some, test-driven development (TDD) may prove an effective practice to promote both product quality and faster delivery time.
In many developers' minds, TDD might seem like a completely backwards process-the idea that a test dictates how and what you develop might seem topsy-turvy. But in reality, TDD is an incredibly effective development method that can lead to robust, stable, and high-quality releases. I want to share some of the issues I've faced with my work in TDD, along with ways to overcome them in your journey to take advantage of TDD as an effective tool in your development arsenal.
When following a TDD approach, the developer first writes an automated test case to test a new functionality or revision to the code. This initial test case will fail, at first. Then the developer writes the minimum amount of code in order to pass the test. Once the test passes, the developer refactors the code to acceptable standards, to eliminate redundancy. This process is then repeated over and over again as the code evolves and more functionality is added. TDD is therefore an iterative, incremental way to add value to your code while you gain more confidence that the code is viable and working with each new iteration all the way into production.
Pros and cons
Before we dive any deeper, let's talk about the good news and bad news.
Starting with the bad news: approaching software development with a TDD mindset can be intimidating. When you sit down to start developing a new feature, you first need to think of all the things for which you need to build a test, which requires some planning. For less experienced developers, it can be overwhelming. They might feel it's better to dive in to the code first before designing a suitable test. It takes practice and experience to determine the minimum viable test for validating each limited set of functionality that's being developed and expand on that initial test case as your code evolves. It's a matter of finding the right balance.
To validate that your code does what it's supposed to do, you have to make sure you address as many plausible issues as possible as you flesh out the functionality. Then again, you also need to be mindful not to go down a rabbit hole of designing a test for each rare corner case that might never occur. Finally, you don't want to be thrown off track by designing test cases that are so complex that it takes too long to complete the corresponding codebase to test against.
One straightforward way to address these two issues is a trick called "hazard analysis": the process of identifying probable issues, putting them in order of most to least likely, and then beginning the mitigation effort from there. By building a list that lets you decide what's most worthy of your time, you won't be chasing those one-in-a-billion bugs that are next to undetectable. A hazard analysis allows you to stay focused and keep your eyes on the prize. Catching bugs earlier, as part of your development process (rather than having to wait for QA, or worst yet, discovering them in production) is the best, most cost-effective way to ensure that quality code makes it to end users faster.
A mindset shift
While TDD requires developers to invest the time and effort to hone their testing skills, the organization benefits from creating a design of the right procedures to test code more efficiently. Still, beyond the technical hurdles (assuming we're all accomplished engineers), another common hurdle to TDD for developers is psychological-the feeling that they're not actually getting anything done. Traditional development is like building a house-you spend a whole day working, you've laid some foundation, and you can clearly measure your progress. With TDD, you spend the first day (or week, or month) just figuring out how your foundation might crack and where it might need extra support, and it might feel like you have nothing to show for it. That can be a tough feeling to overcome.
Approaching this issue with the right frame of mind can help you get past it. TDD is just like the age-old carpenter's saying, "measure twice-cut once." By spending your time building tests and looking for potential issues (measuring), by the time you actually get to the development of your release (cutting), you can feel pretty confident that your code will work the way it should. And if it doesn't, the development team will have a quick feedback loop through which to discover that. So while the developers who start coding their new feature on day one might feel like they've reached the finish line faster, in the grand scheme of things (especially if any bugs are discovered downstream), fixing them will take much longer when you're trying to stabilize your code for release.
Along those same lines, don't think you won't feel any sense of accomplishment with TDD. Once you have your tests in place and you're working single-mindedly on passing them, you get the satisfaction of knowing your code passes the test and that you're the new best friend of all your QA colleagues who won't need to spend as much time on your code when it reaches the testing stage. For me, watching the light turn green on one of my tests is as much a feeling of accomplishment as launching an entire release.
Another key adjustment in TDD is the fact that it's slow, or at least it feels slow. When you're spending so much time building tests and thinking of possible pitfalls, your actual development process can feel like it's slowed down-especially if you're used to throwing your code over the wall to QA and letting them find the bugs for you. I often warn people who are just starting with TDD to take whatever development time they're used to and then double it. While it may sound like a big investment, you have to think about what you're getting for your additional efforts.
When starting your development process by testing first, you won't have to do nearly as many tests at the end of your development cycle-and once you do deploy, things are much less likely to go south. It's much easier to fix something that's broken before it's released, rather than after it's in the hands of the user. Imagine if I told you that never again will one of your releases break once it's out in the wild-doesn't that sound nice? While TDD can't promise that, it significantly decreases the likelihood of your code breaking after you've released it. Hitting the "go" button and knowing that you put a lot of time and effort into preventing any potential snags feels so much better than hoping and praying that nothing goes wrong.
TDD isn't for everyone, and for some people, the shift in mindset can be challenging. But if you can really focus on the "measure twice-cut once" mentality of TDD, you can see some amazing results. I hope you give it a try and see for yourself how TDD can fit into your next development cycle.
To see this article in its original publication visit TechBeacon.com (http://techbeacon.com/measure-twice%E2%80%94cut-once-benefits-test-drive...)
Developers want to create better apps faster. Static clouds are giving way to scalable systems, with dynamic resource allocation and application monitoring. You won't hear that chant from users on any picket line, but helping developers to create better apps faster is the mission of Lee Atchison, principal cloud architect and advocate at New Relic Inc., based in San Francisco. His singular job is to understand and drive the industry in the areas of cloud architecture, microservices, scalability and availability. In a keynote presentation, he spoke to a standing-room-only crowd at New York's Cloud Expo about how highly available, highly scalable systems can help developers attain the goal of better apps faster.
Apr. 26, 2017 03:00 AM EDT Reads: 3,440
SYS-CON Events announced today that T-Mobile will exhibit at SYS-CON's 20th International Cloud Expo®, which will take place on June 6-8, 2017, at the Javits Center in New York City, NY. As America's Un-carrier, T-Mobile US, Inc., is redefining the way consumers and businesses buy wireless services through leading product and service innovation. The Company's advanced nationwide 4G LTE network delivers outstanding wireless experiences to 67.4 million customers who are unwilling to compromise on quality and value.
Apr. 26, 2017 02:45 AM EDT Reads: 1,001
Everyone wants to use containers, but monitoring containers is hard. New ephemeral architecture introduces new challenges in how monitoring tools need to monitor and visualize containers, so your team can make sense of everything. In his session at @DevOpsSummit, David Gildeh, co-founder and CEO of Outlyer, will go through the challenges and show there is light at the end of the tunnel if you use the right tools and understand what you need to be monitoring to successfully use containers in your environments.
Apr. 26, 2017 01:45 AM EDT Reads: 1,969
New competitors, disruptive technologies, and growing expectations are pushing every business to both adopt and deliver new digital services. This ‘Digital Transformation’ demands rapid delivery and continuous iteration of new competitive services via multiple channels, which in turn demands new service delivery techniques – including DevOps. In this power panel at @DevOpsSummit 20th Cloud Expo, moderated by DevOps Conference Co-Chair Andi Mann, panelists will examine how DevOps helps to meet the demands of Digital Transformation – including accelerating application delivery, closing feedback loops, enabling multi-channel delivery, empowering collaborative decisions, improving user experience, and ultimately meeting (and exceeding) business goals.
Apr. 26, 2017 12:45 AM EDT Reads: 1,309
Grape Up is a software company, specialized in cloud native application development and professional services related to Cloud Foundry PaaS. With five expert teams that operate in various sectors of the market across the USA and Europe, we work with a variety of customers from emerging startups to Fortune 1000 companies.
Apr. 25, 2017 11:15 PM EDT Reads: 2,308
@DevOpsSummit at Cloud taking place June 6-8, 2017, at Javits Center, New York City, is co-located with the 20th International Cloud Expo and will feature technical sessions from a rock star conference faculty and the leading industry players in the world. The widespread success of cloud computing is driving the DevOps revolution in enterprise IT. Now as never before, development teams must communicate and collaborate in a dynamic, 24/7/365 environment. There is no time to wait for long development cycles that produce software that is obsolete at launch. DevOps may be disruptive, but it is essential.
Apr. 25, 2017 11:00 PM EDT Reads: 2,184
SYS-CON Events announced today that Interoute, owner-operator of one of Europe's largest networks and a global cloud services platform, has been named “Bronze Sponsor” of SYS-CON's 20th Cloud Expo, which will take place on June 6-8, 2017 at the Javits Center in New York, New York. Interoute is the owner-operator of one of Europe's largest networks and a global cloud services platform which encompasses 12 data centers, 14 virtual data centers and 31 colocation centers, with connections to 195 additional third-party data centers across Europe. Its full-service Unified ICT platform serves international enterprises and many of the world’s leading service providers, as well as governments and universities.
Apr. 25, 2017 10:30 PM EDT Reads: 1,880
DevOps is often described as a combination of technology and culture. Without both, DevOps isn't complete. However, applying the culture to outdated technology is a recipe for disaster; as response times grow and connections between teams are delayed by technology, the culture will die. A Nutanix Enterprise Cloud has many benefits that provide the needed base for a true DevOps paradigm.
Apr. 25, 2017 10:30 PM EDT Reads: 667
Today we can collect lots and lots of performance data. We build beautiful dashboards and even have fancy query languages to access and transform the data. Still performance data is a secret language only a couple of people understand. The more business becomes digital the more stakeholders are interested in this data including how it relates to business. Some of these people have never used a monitoring tool before. They have a question on their mind like “How is my application doing” but no idea how to get a proper answer.
Apr. 25, 2017 10:30 PM EDT Reads: 7,138
SYS-CON Events announced today that Juniper Networks (NYSE: JNPR), an industry leader in automated, scalable and secure networks, will exhibit at SYS-CON's 20th International Cloud Expo®, which will take place on June 6-8, 2017, at the Javits Center in New York City, NY. Juniper Networks challenges the status quo with products, solutions and services that transform the economics of networking. The company co-innovates with customers and partners to deliver automated, scalable and secure networks with agility, performance and value.
Apr. 25, 2017 10:15 PM EDT Reads: 1,203
Cloud Expo, Inc. has announced today that Aruna Ravichandran, vice president of DevOps Product and Solutions Marketing at CA Technologies, has been named co-conference chair of DevOps at Cloud Expo 2017. The @DevOpsSummit at Cloud Expo New York will take place on June 6-8, 2017, at the Javits Center in New York City, New York, and @DevOpsSummit at Cloud Expo Silicon Valley will take place Oct. 31-Nov. 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA.
Apr. 25, 2017 08:30 PM EDT Reads: 2,508
DevOps is often described as a combination of technology and culture. Without both, DevOps isn't complete. However, applying the culture to outdated technology is a recipe for disaster; as response times grow and connections between teams are delayed by technology, the culture will die. A Nutanix Enterprise Cloud has many benefits that provide the needed base for a true DevOps paradigm. In his Day 3 Keynote at 20th Cloud Expo, Chris Brown, a Solutions Marketing Manager at Nutanix, will explore the ways that Nutanix technologies empower teams to react faster than ever before and connect teams in ways that were either too complex or simply impossible with traditional infrastructures.
Apr. 25, 2017 08:15 PM EDT Reads: 548
Translating agile methodology into real-world best practices within the modern software factory has driven widespread DevOps adoption, yet much work remains to expand workflows and tooling across the enterprise. As models evolve from pockets of experimentation into wholescale organizational reinvention, practitioners find themselves challenged to incorporate the culture and architecture necessary to support DevOps at scale. In his session at @DevOpsSummit at 20th Cloud Expo, Anand Akela, Senior Director of DevOps Solutions at CA Technologies, will discuss how existing adopters are employing unified agile and DevOps techniques to engage functional processes and toolchains that deliver increased software quality, faster time-to-market and measurably improved customer experience.
Apr. 25, 2017 07:45 PM EDT Reads: 1,782
Join IBM November 2 at 19th Cloud Expo at the Santa Clara Convention Center in Santa Clara, CA, and learn how to go beyond multi-speed it to bring agility to traditional enterprise applications. Technology innovation is the driving force behind modern business and enterprises must respond by increasing the speed and efficiency of software delivery. The challenge is that existing enterprise applications are expensive to develop and difficult to modernize. This often results in what Gartner calls "Bimodal IT," where business struggle to apply modern tools and practices to traditional monolithic applications. But these existing assets can be modernized and made more efficient without having to be completely overhauled. By leveraging methodologies like DevOps and agile, alongside emerging technologies like cloud-native services and containerization, traditional applications and teams can be ...
Apr. 25, 2017 07:15 PM EDT Reads: 3,139
Did you know that you can develop for mainframes in Java? Or that the testing and deployment can be automated across mobile to mainframe? In his session at @DevOpsSummit at 20th Cloud Expo, Vaughn Marshall, Sr. Principal Product Owner at CA Technologies, will discuss and demo how increasingly teams are developing with agile methodologies using modern development environments and automating testing and deployments, mobile to mainframe.
Apr. 25, 2017 06:15 PM EDT Reads: 1,169
In recent years, containers have taken the world by storm. Companies of all sizes and industries have realized the massive benefits of containers, such as unprecedented mobility, higher hardware utilization, and increased flexibility and agility; however, many containers today are non-persistent. Containers without persistence miss out on many benefits, and in many cases simply pass the responsibility of persistence onto other infrastructure, adding additional complexity.
Apr. 25, 2017 06:15 PM EDT Reads: 2,200
Most companies are adopting or evaluating container technology - Docker in particular - to speed up application deployment, drive down cost, ease management and make application delivery more flexible overall. As with most new architectures, this dream takes a lot of work to become a reality. Even when you do get your application componentized enough and packaged properly, there are still challenges for DevOps teams to making the shift to continuous delivery and achieving that reduction in cost and increase in speed.
Apr. 25, 2017 05:45 PM EDT Reads: 3,722
SYS-CON Events announced today that Twistlock, the leading provider of cloud container security solutions, will exhibit at SYS-CON's 20th International Cloud Expo®, which will take place on June 6-8, 2017, at the Javits Center in New York City, NY. Twistlock is the industry's first enterprise security suite for container security. Twistlock's technology addresses risks on the host and within the application of the container, enabling enterprises to consistently enforce security policies, monitor and audit activity and identify and isolate threats in a container or cluster of containers.
Apr. 25, 2017 05:15 PM EDT Reads: 3,551
While some vendors scramble to create and sell you a fancy solution for monitoring your spanking new Amazon Lambdas, hear how you can do it on the cheap using just built-in Java APIs yourself. By exploiting a little-known fact that Lambdas aren’t exactly single threaded, you can effectively identify hot spots in your serverless code. In his session at 20th Cloud Expo, David Martin, Principal Product Owner at CA Technologies, will give a live demonstration and code walkthrough, showing how to overcome the challenges of monitoring S3 and RDS. This presentation will provide an overview of necessary Amazon Lambda concepts and discuss how to integrate the monitoring data with other tools.
Apr. 25, 2017 04:15 PM EDT Reads: 404
SYS-CON Events announced today that Grape Up will exhibit at SYS-CON's 21st International Cloud Expo®, which will take place on Oct. 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Grape Up is a software company specializing in cloud native application development and professional services related to Cloud Foundry PaaS. With five expert teams that operate in various sectors of the market across the U.S. and Europe, Grape Up works with a variety of customers from emerging startups to Fortune 1000 companies.
Apr. 25, 2017 04:15 PM EDT Reads: 2,036
In his keynote at 19th Cloud Expo, Sheng Liang, co-founder and CEO of Rancher Labs, discussed the technological advances and new business opportunities created by the rapid adoption of containers. With the success of Amazon Web Services (AWS) and various open source technologies used to build private clouds, cloud computing has become an essential component of IT strategy. However, users continue to face challenges in implementing clouds, as older technologies evolve and newer ones like Docker containers gain prominence. He explored these challenges and how to address them, while considering how containers will influence the direction of cloud computing.
Apr. 25, 2017 04:00 PM EDT Reads: 2,617
SYS-CON Events announced today that CollabNet, a global leader in enterprise software development, release automation and DevOps solutions, will be a Bronze Sponsor of SYS-CON's 20th International Cloud Expo®, taking place from June 6-8, 2017, at the Javits Center in New York City, NY. CollabNet offers a broad range of solutions with the mission of helping modern organizations deliver quality software at speed. The company’s latest innovation, the DevOps Lifecycle Manager (DLM), supports Value Stream Mapping for the development and operations tool chain by offering DevOps Tool Chain Integration and Traceability; DevOps Tool Chain Orchestration; and DevOps Insight and Intelligence. CollabNet also offers traditional application lifecycle management, ALM, for the enterprise through its TeamForge product.
Apr. 25, 2017 03:00 PM EDT Reads: 529
SYS-CON Events announced today that CA Technologies has been named "Platinum Sponsor" of SYS-CON's 20th International Cloud Expo®, which will take place on June 6-8, 2017, at the Javits Center in New York City, New York, and 21st International Cloud Expo, which will take place in November in Silicon Valley, California.
Apr. 25, 2017 01:30 PM EDT Reads: 2,295
SYS-CON Events announced today that Hitachi, the leading provider the Internet of Things and Digital Transformation, will exhibit at SYS-CON's 20th International Cloud Expo®, which will take place on June 6-8, 2017, at the Javits Center in New York City, NY. Hitachi Data Systems, a wholly owned subsidiary of Hitachi, Ltd., offers an integrated portfolio of services and solutions that enable digital transformation through enhanced data management, governance, mobility and analytics. We help global organizations open new revenue streams, increase efficiencies, improve customer experience and ensure rapid time to market in the digital age. Only Hitachi Data Systems powers the digital enterprise by integrating the best information technology and operational technology from across the Hitachi family of companies. We combine this experience with Hitachi expertise in the internet of things to d...
Apr. 25, 2017 12:15 PM EDT Reads: 1,028
DevOps is being widely accepted (if not fully adopted) as essential in enterprise IT. But as Enterprise DevOps gains maturity, expands scope, and increases velocity, the need for data-driven decisions across teams becomes more acute. DevOps teams in any modern business must wrangle the ‘digital exhaust’ from the delivery toolchain, "pervasive" and "cognitive" computing, APIs and services, mobile devices and applications, the Internet of Things, and now even blockchain.
Apr. 25, 2017 12:15 PM EDT Reads: 2,558