rts

package
v0.0.0-...-e560ebb Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 13, 2021 License: BSD-3-Clause Imports: 0 Imported by: 0

README

Regression Test Selection (RTS)

Regression Test Selection (RTS) is a technique to intellegently select tests to run, without spending too much resources on testing, but still detecting bad code changes. Conceptually, a selection strategy for CQ accepts changed files as input and returns tests to run as output.

As of February 2021, most of the documention can be found at https://bit.ly/chromium-rts. This document is focused on particular tasks that a developer might need to perform in this code base.

note: TODO(nodir): move relevant parts from bit.ly/chromium-rts to this README.md.

Improving Chromium's selection strategy

Chromium's selection strategy can be found in ./cmd/rts-chromium/strategy.go. It is primarily based on ./filegraph with some Chromium-specific rules.

Changes to the selection strategy should be accompanied with the safety/efficiency scores before and after the change on the same dataset, in order to ensure that the change is in fact an improvement.

  1. Get yourself permissions to chrome-rts Cloud project by being a member of chrome-troopers@google.com group or by contacting nodir@google.com.
  2. Ensure you have the Chromium checkout: just src.git is enough. This doc assumes you have it at ~/chromium/src.
  3. Fetch a sample of rejections, e.g. for the past month of linux-rel:
    go run ./cmd/rts-chromium fetch-rejections \
      -builder linux-rel \
      -from 2021-02-01 -to 2021-03-01 \
      -out linux-rel.rej
    
  4. Fetch a sample of test durations, e.g. for for the past week of linux-rel.
    go run ./cmd/rts-chromium fetch-durations \
      -builder linux-rel \
      -from 2021-02-01 -to 2021-02-08 \
      -out linux-rel.dur
    
  5. Create the model and note the safety/efficiency scores before your changes:
    go run ./cmd/rts-chromium create-model \
      -checkout ~/chromium/src
      -rejections linux-rel.rej \
      -durations linux-rel.dur \
      -model-dir ./model \
    
  6. Change the selection strategy code.
  7. Create the model again on the same dataset and see if the scores improved. Iterate until they improve.
  8. Send the CL out and include the before/after scores in the CL description.

Model creation can take 30min on a powerful machine. If you are developing on your laptop, it is recommended to scp the binary to a more powerful machine and run the model creation there.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Affectedness

type Affectedness struct {
	// Distance is a non-negative number, where 0.0 means the code change is
	// extremely likely to affect the test, and +inf means extremely unlikely.
	// If a test's distance is less or equal than a given threshold, then the test
	// is selected.
	//
	// A selection strategy doesn't have to use +inf as the upper boundary.
	// It may use the range [0.0, 1.0] as well, as long as the threshold uses
	// the same scale.
	Distance float64
}

Affectedness is how much a test is affected by the code change. The zero value means a test is very affected.

Directories

Path Synopsis
cmd
rts-chromium
Command rts-chromium is Chromium-specific part of the generic RTS framework.
Command rts-chromium is Chromium-specific part of the generic RTS framework.
Package filegraph implements a directed weighted graph of files, where the weight of edge (x, y), called distance, represents how much y is affected by changes in x.
Package filegraph implements a directed weighted graph of files, where the weight of edge (x, y), called distance, represents how much y is affected by changes in x.
cli
Package cli implements filegraph command.
Package cli implements filegraph command.
git
Package git implements derivation of a file graph from git log and optionally from the file structure.
Package git implements derivation of a file graph from git log and optionally from the file structure.
internal
presubmit
eval
Package eval implements a framework for selection strategy evaluation.
Package eval implements a framework for selection strategy evaluation.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL