Test Driven Development

Glossary and Languages Specific Packages or Code References

  • Unit Test: A test of a single functional code unit. (Python: unittest, nose, PyTest, Javascript: Jasmine, Mocha)
  • Mocking and Patching: Techniques that isolate a functional unit from its context and allow creating useful unit tests that would be impossible otherwise. (Python: mock.Mock and mock.patch)
  • Fixture: a part of the code that prepares the environment in order to perform one or more tests, and any associated cleanup actions. This may involve, for example, creating temporary or proxy databases, directories, or starting a server process. [snagged from Python's official docs] (in xUnit: setUp(), tearDown(). In BDD frameworks: beforeEach(), afterEach())
  • Test Runner: a framework that manages the running of unit tests and any associated tools such as coverage analysis and results reporting as well as environments (such as different web browsers). (Python: nose, Javascript: karma)
  • Code Coverage: a measure of the percentage of code that is reached through unit tests. Depending on how sophisticated the package, coverage may or may not measure if every logical pathway is being reached. (Python: coverage, Javascript: istanbul)
  • Cyclomatic Complexity: A way of measuring how complex code is. The higher the number the more spaghetti'ish. (Python: radon and flake8)
  • Acceptance Test (aka Functional Test, End-to-End Test, Black Box Test): A test that verifies the behavior of an application ensure that the product delivered to the end user behaves as expected. Often the behavior is defined in terms of a user story. (Lettuce - a port of Ruby's Cucumber/Gherkin, selenium - lets you automate testing through a browser)
  • Code Profiling: A test that measures the space and time complexity of various portions of code. (cProfile)
  • Performance Test: A test that aims to measure the performance of an application in a simulated real world environment. Two common types are Load Testing where many clients request services from the application, and Volume Testing where the application is run under real-world data volume conditions. (JMeter - for load testing)
  • Penetration Test: A test in which an attempt to breach the security of an application is simulated.
  • Smoke Test: A test that checks that key aspects of an application are working as expected and is usually part of a deployment process. (Lettuce)
  • Ping-Pong Programming: A TDD pair programming technique in which one developer writes the unit test while the other makes the tests pass, and then they switch roles.
  • Behavior Driven Devleopment: Another agile methodology similar to TDD in which acceptance tests drive development.