Continuous Integration is Absurd without Unit Testing

von

Continuous Integration is Absurd Without Unit Testing

Imagine this conversation between colleagues:

“We are pioneers of DevOps,” my colleague says, pointing towards the Dell Inspiron humming away on the edge of his desk. On the screen, a mass of red boxes blinks into life while a cartoon man, grinning in a bowtie, watches on from the top left.

“Nice. What does it do?” asks Kelly from the test team.

“Checks out our code and builds it…” A pause, I assume for dramatic effect, “…. We are now performing,” he waggles his fingers in an air quotes gesture, “Continuous Integration.”

My eyes roll.

Continuous integration testing is a critical aspect of software engineering, involving the repeated application of quality control processes to every small, discrete change or addition. However, it’s important to note that continuous integration testing is more than just installing Jenkins on a spare machine.

The benefits of continuous integration testing are numerous. By catching issues early on, developers can save time and resources that would otherwise be wasted on debugging. Moreover, continuous integration testing helps identify and resolve integration problems before they can cause last-minute chaos during release dates.

Benefits of Continuous Integration Testing:

  1. Instant feedback on broken and incompatible code.
  2. Early notification of conflicting changes.
  3. Immediate testing of changes.
  4. Constant availability of a build for testing, demo, or release purposes.
  5. Feedback to developers on the quality, functionality, or system-wide impact of their code.
  6. Frequent code check-ins motivate developers to create modular, less complex solutions.

In summary, continuous integration testing helps catch issues early in the development process, allows for more efficient testing and debugging, and encourages developers to create better, more modular code.

In agile development, every code commit initiates a build cycle with quality gates and dynamic testing and analysis tools. Only successful results allow clean, functional code to move from development to the release branch. This approach breaks down traditional software development phases and enables simultaneous development and testing.

“Why is everything red?” asks Kelly.

“Ah… when we make a code change, the unit tests run. Your team hasn’t delivered updated tests yet, and so the old tests always fail against the new code.”

“But how do we deliver working unit tests before they have checked the code in?”

“Errrr…”

Ensuring updated unit tests accompany every code change is crucial for maintaining code quality and preventing regressions. To streamline this process, it’s important to have a robust and user-friendly desktop development environment with built-in unit testing capabilities. Ideally, unit tests should be checked in along with updated code to enable automated regression tests during the continuous integration (CI) build stages.

“It’s OK,” says Kelly unfazed, “I’ll just get our guys to work in partnership with the development team, so we can push updated tests at the same time as the code.”

DevOps is a movement that breaks down silos and adopts continuous integration techniques. This organizational shift has led to numerous benefits, including improved project performance and employee satisfaction.

Automated regression testing is a crucial aspect of continuous integration. With effective unit testing at every stage of development, teams can receive valuable feedback and realize the true benefits of DevOps.

RELATED RESOURCES