Skip to content

Latest commit

 

History

History
348 lines (248 loc) · 5.59 KB

slides.md

File metadata and controls

348 lines (248 loc) · 5.59 KB
theme class highlighter lineNumbers info drawings layout background
seriph
shiki
false
Continuous Regression Testing in Java
persist
cover

Continuous Regression Testing in Java

Chicago Java User Group, May 5, 2022

Pejman Ghorbanzade

<style> h1 { font-size: 2.5rem !important; } </style>

Format

  • Interactive
  • Hands-on Live Coding
  • Ask questions any time
<style> li { font-size: 1.25em; } </style>

Agenda

  • Motivation
  • Snapshot Testing
  • Regression Testing
  • Continuous Testing
<style> li { font-size: 1.25em; } </style>

layout: two-cols

About Me

  • 6 Years of Experience
    • VMWare Carbon Black
    • Canon Medical Informatics
  • Working full-time on touca.io
    • Continuous Regression Testing
  • Passionate about maintaining software at scale

::right::


layout: two-cols

Software Engineering

  • Programming
    • Theoretical problem solving
    • Like sport
  • Software Engineering
    • Problem solving within business constraints
    • Like gardening

Software Engineering is programming integrated over time

::right::


layout: two-cols

Business Value

  • Think like an engineer
    • Civil engineering: Building a house
    • Software engineering: Building with mud

Software is a tractable medium.

::right::


layout: two-cols

Software Testing Pyramid

  • Good tests are:
    • Cheap to Write
    • Easy to Read
    • Fast to Run
    • Easy to Change

Good tests have high return on investment.

::right::


layout: center


layout: center

Finding bugs after deployment 💰💰💰💰💰
Finding bugs before release 💰💰💰
Finding bugs during QA testing 💰💰
Finding bugs during code review 💰
Finding bugs during development

layout: center

It takes 23 days for software engineers to gain confidence that a given code change works as they expect.


layout: center

The Problem

How can we refactor half a million lines of code without causing any side effects?


Motivation

Candidate Solution A

Output newOutput = newSystem(testcase);
Output oldOutput = oldSystem(testcase);
compare(newOutput, oldOutput);

Disadvantages

  • Test is difficult to setup
  • Test system is inefficient to run
  • Test system is not reusable

Motivation

Candidate Solution B

Output newOutput = newSystem(testcase);
File newFile = writeToFile(testcase, newOutput);
File oldFile = findOldFile(testcase);
compare(newFile, newOutput);

Disadvantages

  • Dealing with files is no fun
  • Test system is hard to maintain
  • Test system is not reusable

layout: cover background:

Demo Time

Approval Testing


Motivation

Candidate Solution C

final Output newOutput = newSystem(testcase);
final Description newDescription = describe(testcase, newOutput);
submit(testcase, newDescription);

Disadvantages

  • Limited customization
  • Overkill for small projects
  • Requires remote computing resources

Motivation

Simple Example

public record Student(
  String username,
  String fullname,
  LocalDate dob,
  double gpa
) {}

public static Student findStudent(final String username) {
  // ...
}

Motivation

High-level API

import io.touca.Touca;

public final class StudentsTest {

  @Touca.Workflow
  public void findStudent(final String username) {
      Student student = Students.findStudent(username);
      Touca.assume("username", student.username);
      Touca.check("fullname", student.fullname);
      Touca.check("birth_date", student.dob);
      Touca.check("gpa", student.gpa);
  }

  public static void main(String[] args) {
    Touca.run(StudentsTest.class, args);
  }
}

Motivation

Design Requirements

  • Intuitive developer experience
  • Intrinsic support for common types
    • Must support integral types, fractional types, Strings, Iterables, and other common standard types
  • Extensible design to support user-defined types
    • Must allow users to introduce logic for handling custom types

layout: cover background:

Demo Time

Regression Testing


layout: center

Questions