Software engineeringLesson 3 of 3 in the course Testing and maintenance

Test-Driven Development: Cycles, Test Design, and Trade-offs

5 flashcards · 5 quiz questions · 5 match pairs · 5 fill-in sentences · English

Lesson progress
0 / 5

Your progress is kept in this browser only.Sign up to save it

Summary

Test-driven development (TDD) is a way of building software in short, testable steps. Instead of writing a feature first and testing it afterward, a developer writes a test for a desired behavior, observes it fail, implements enough code to pass, and then improves the design. This lesson introduces TDD, its origins, and its core development cycle.

Test-driven development is a programming approach in which automated tests guide the creation and improvement of production code. A developer typically focuses on a unit such as a function, class, or module and writes a test for one specific behavior at a time.

All flashcards

Test-driven development (TDD)
A development approach in which automated tests guide the creation and improvement of production code.
Acceptance-test-driven development (ATDD)
A practice in which customers, developers, and testers clarify requirements through acceptance criteria.
Test double
A stand-in for a real collaborator that helps test a unit quickly and in isolation.
High cohesion and low coupling
Design qualities that keep a unit focused and limit its dependencies, improving testability.
Limits of passing tests
Passing tests provide evidence about tested behavior but do not prove that the whole system is correct.

Quiz questions

  1. How do TDD, ATDD, and BDD differ in their primary focus?Answer: TDD guides unit implementation, ATDD aligns stakeholders on acceptance criteria, and BDD collaboratively describes expected behavior.
  2. What does a passing unit test that uses a test double establish?Answer: The unit behaves as expected with the double, but communication with the real dependency remains unverified.
  3. What is the main purpose of a focused test oracle?Answer: To check the outcomes needed to validate a scenario without adding brittle, unrelated checks.
  4. What does scenario modeling describe in a complex system?Answer: A system-level execution path, including its stimulus and the sequence of component interactions.
  5. What did a 2013 meta-analysis of 27 TDD studies report about overall results?Answer: A small positive effect on external quality and little or no overall effect on productivity.

Based on the Wikipedia article Test-driven development, licensed CC BY-SA 4.0. Adapted into a summary, flashcards and quizzes.

All Software engineering lessons