DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones AWS Cloud
by AWS Developer Relations
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones
AWS Cloud
by AWS Developer Relations
The Latest "Software Integration: The Intersection of APIs, Microservices, and Cloud-Based Systems" Trend Report
Get the report
  1. DZone
  2. Testing, Deployment, and Maintenance
  3. Testing, Tools, and Frameworks
  4. One-Click Builds End-to-End

One-Click Builds End-to-End

Creating one-click builds makes it a lot easier to refactor and rework code in a safe manner.

David Bernstein user avatar by
David Bernstein
CORE ·
May. 28, 19 · Opinion
Like (1)
Save
Tweet
Share
6.96K Views

Join the DZone community and get the full member experience.

Join For Free

We want to automate the build so that it is easy to use. We wanted it to be so brain-dead simple to use that we use it all the time and we invoke the build whenever we make even a minor change to the system. This is how we get the most value from our build — when we use it all the time.

To facilitate this we have the idea of the one-click build, which means that you can invoke the entire process with a single click. We can set this up so that when we save a change it re-compiles all of its dependencies on the local machine and then runs tests on the local machine. If these tests pass the changes are pushed up into the build server and a more complete set of tests are run against it. All of this should happen automatically. Ideally, we want the build to run fast and that means anywhere from a few seconds to a few minutes.

There is even a program called N-Crunch that watches you type keystrokes and when you enter in an executable line of code it automatically invokes the build so you don't even have to do the single click to kick it off. N-Crunche is for .NET and there's an equivalent program for the Java world called Infinitest.

The build should run fast and give clear results. A lot of times when I'm developing I only want to invoke my local build until I have a feature ready for integration. I still try to build the smallest behavior that I can so that I can quickly verify it and move on.

Our compilers, lint checkers, automated unit tests and everything else that we use in the field are powerful tools that require compilable and/or executable code. We need to be running these tools frequently. I try to integrate the smallest pieces of functionality that I can so I use these tools often.

As a result, I have become somewhat addicted to the green bar. I like to see the green bar when I'm coding and very often if you ask me how I am doing I'll respond by saying, "Green bar!"

That's my way of saying all is good.

I remember I was at the office early in the morning on the project about five years ago. I like coming in early in the morning because there is no one there and I can get a lot of work done. Anyway, I'm sitting there and I run my tests and then I sit there for a while and run my tests again.

I didn't know it but one of my colleagues came in and was sitting behind me watching. He said that he saw me run my tests in green bar twice without making any changes to the code and asked me why I did that. He was concerned that perhaps I thought that the build was flaky and was giving intermittent results because running tests without making any changes shouldn't change the test results. I said that wasn't the issue. I said, "It just feels good."

I must admit that I love being in the green bar. The green bar means safety because I can freely refactor my code while I'm in the green bar and I know that if I make a mistake my tests will catch it. This is the value of having a good and reliable build that is invoked through a single click. It has your back, and what more could you ask for?

Note: This blog post is based on a section in my book, Beyond Legacy Code: Nine Practices to Extend the Life (and Value) of Your Software called Seven Strategies for Seven Strategies for Agile Infrastructure.

Build (game engine) unit test

Published at DZone with permission of David Bernstein, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • Choosing the Right Framework for Your Project
  • Demystifying the Infrastructure as Code Landscape
  • Strategies for Kubernetes Cluster Administrators: Understanding Pod Scheduling
  • gRPC on the Client Side

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: