Table of Contents
Fetching ...

The role of slicing in test-driven development

Oscar Dieste, Ayse Tosun, Sira Vegas, Adrian Santos, Fernando Uyaguari, Jarno Kyykka, Natalia Juristo

TL;DR

The paper tackles the unclear foundations of test-driven development by proposing a contract-based, slice-oriented theory that views each TDD cycle as a nano vertical slice guided by implicit pre/post-conditions. It formalizes the idea that tests instantiate contracts, while the evolving code constitutes contract-based slices that progressively cover a problem’s specification. An industrial experiment provides empirical support: slicing significantly improves external quality during TDD, but not during ITLD, highlighting the conditional impact of vertical slices. The work offers a conceptual framework linking TDD, contracts, and slicing, with practical implications for refining TDD practice and guiding future research into more robust, contract-aware development environments.

Abstract

Test-driven development (TDD) is a widely used agile practice. However, very little is known with certainty about TDD's underlying foundations, i.e., the way TDD works. In this paper, we propose a theoretical framework for TDD, with the following characteristics: 1) Each TDD cycle represents a vertical slice of a (probably also small) user story, 2) vertical slices are captured using contracts, implicit in the developers' minds, and 3) the code created during a TDD cycle is a sliced-based specification of a code oracle, using the contracts as slicing pre/post-conditions. We have checked the connections among TDD, contracts, and slices using a controlled experiment conducted in the industry.

The role of slicing in test-driven development

TL;DR

The paper tackles the unclear foundations of test-driven development by proposing a contract-based, slice-oriented theory that views each TDD cycle as a nano vertical slice guided by implicit pre/post-conditions. It formalizes the idea that tests instantiate contracts, while the evolving code constitutes contract-based slices that progressively cover a problem’s specification. An industrial experiment provides empirical support: slicing significantly improves external quality during TDD, but not during ITLD, highlighting the conditional impact of vertical slices. The work offers a conceptual framework linking TDD, contracts, and slicing, with practical implications for refining TDD practice and guiding future research into more robust, contract-aware development environments.

Abstract

Test-driven development (TDD) is a widely used agile practice. However, very little is known with certainty about TDD's underlying foundations, i.e., the way TDD works. In this paper, we propose a theoretical framework for TDD, with the following characteristics: 1) Each TDD cycle represents a vertical slice of a (probably also small) user story, 2) vertical slices are captured using contracts, implicit in the developers' minds, and 3) the code created during a TDD cycle is a sliced-based specification of a code oracle, using the contracts as slicing pre/post-conditions. We have checked the connections among TDD, contracts, and slices using a controlled experiment conducted in the industry.
Paper Structure (33 sections, 1 equation, 2 figures, 8 tables)

This paper contains 33 sections, 1 equation, 2 figures, 8 tables.

Figures (2)

  • Figure 1: Slicing $\times$ Task interaction. (left) ITLD. (right) TDD.
  • Figure 2: Programmers' productivity in TDD. (left) $Slicing \times Task$ interaction considering only subjects that used different types of specifications in the 1st and 2nd sessions. (right) Using the same same type of specification.