Oversharing On Setup

Definition:

  • Where every test sets up a lot of shared data which only some tests need.

Code Example:

beforeEach(() => {
  databaseConnection = openDatabase();
  inputFile = loadBigFile();
  userList = loadUserList();
  imageData = loadImageBytes();
});

References:

Quality attributes

  • - Code Example

  • - Cause and Effect

  • - Frequency

  • - Refactoring