This glossary contains the author's definitions of the terms used throughout this book.
acceptance test
Also known as
User Acceptance Test (UAT)
A customer test that the customer of the software plans to run to help the customer decide whether he or she will accept the software system. Acceptance tests are usually run manually after all automated customer tests have passed. They exercise all layers of the system—from the user interface back to the database—and should include any integration with other systems on which the application depends.
accessor
A method that provides access to an instance variable of an object either by returning its value or by providing a way to set its value.
ACID
The four qualities of transactions that modern databases ensure:
- Atomic: A transaction is all or nothing.
- Consistent: All operations within a transaction see the same view of the world.
- Independent: Transactions are independent of one another (no cross-transaction leakage of changes).
- Durable: Once committed, the changes made within a transaction are permanent (they don't just vanish for no reason!).
agile method
A method of executing projects (typically, but not always, restricted to software) that reduces the cost of change and allows customers of the software to have more control over how much they spend and what they get for their money. Agile methods include eXtreme Programming , SCRUM, Feature-Driven Development (FDD), and Dynamic Systems Development Method (DSDM), among many others. A core practice of most agile methods is the use of automated unit tests .
annotation
A way of indicating something about something. JUnit version 4.0 uses annotations to indicate which classes are Testcase Classes and which methods are Test Methods ; NUnit uses .NET attributes for this purpose.
anonymous inner class
An inner class in Java that is defined without a unique name. Anonymous inner classes are often used when defining Hard-Coded Test Doubles .
anti-pattern
A pattern that shouldn't be used because it is known to produce less than optimal results. Code smells , or their underlying causes, are a kind of anti-pattern.
application programming interface (API)
The means by which other software can invoke some piece of functionality. In object-oriented software, an API consists of the classes and their publicly accessible methods. In procedural software, it consists of the module or package name plus the publicly accessible procedures.
aspect-oriented programming
An advanced software modularization technique that allows improved separation of concerns by "weaving" cross-cutting concerns into code after the affected software has been built but before it is executed.
assertion
A statement that something should be true. In xUnit -style Test Automation Frameworks , an assertion takes the form of an Assertion Method that fails when the actual outcome passed to it does not match the expected outcome.
asynchronous test
A test that runs in a separate thread of control from the system under test (SUT) and interacts with it using asynchronous (i.e., "real") messages. An asynchronous test must coordinate its steps with those of the SUT because this interaction is not managed automatically by the runtime system. An asynchronous test may have to include delays to give the SUT enough time to finish execution before inspecting the outcome. Contrast this with a synchronous test, which interacts with the SUT via simple method calls.
attribute
A characteristic of something. The members of the xUnit family for the .NET languages use class and method attributes to indicate which classes are Testcase Classes and which methods are Test Methods. The term attribute is also a synonym for " instance variable " in some circles.
back door
An alternative interface to a system under test (SUT) that test software can use to inject indirect inputs into the SUT. A database is a common example of a back door, but it could also be any component that can be either manipulated to return test-specific values or replaced by a Test Double . Contrast this with the front door: the application programming interface (API) .
BDUF
"Big design up front" is the classic "waterfall" approach to software design. In BDUF, all requirements must be understood early in the project, and the software is designed to support those requirements in a single design "phase." Contrast this with the emergent design favored by agile projects.
behavior-driven development
A variation on the test-driven development process wherein the focus of the tests is to clearly describe the expected behavior of the system under test (SUT) . The emphasis is on Tests as Documentation rather than merely using tests for verification.
Behavior-driven development can be done using traditional members of the xUnit family. New "members" of the family, however, have been built specifically to emphasize the change in focus. They include changes in terminology (e.g., "test" becomes "spec"; "fixture" becomes "context") and more explicit framework support for clarity of the specification.
behavior smell
A test smell we encounter while compiling or running tests. We don't have to be particularly observant to notice behavior smells, as they will present themselves to us via compile errors or test failures. See also: code smell , project smell .
black box
A piece of software that we treat as an opaque object whose internal workings cannot be seen. Tests written for the black box can verify only externally visible behavior and are independent of the implementation inside the system under test (SUT) .
block
A block of code that can be run. Many programming languages (most notably, Smalltalk and Ruby) use blocks (also known as " block closures ") as a way of passing a chunk of code to a method, which can then run the code in its own context. Java's anonymous inner classes are a way to achieve the same thing without direct support for blocks. C# uses delegates for the same purpose.
block closure
See block .
boundary value
An input value for a system under test (SUT) that is immediately adjacent to the boundary between two equivalence classes . Tests using two adjacent boundary values help us verify that the behavior changes with exactly the right input and that we don't have "off by one" problems.
built-in self-test
A means of organizing test code in which the tests live inside the same module or class as the production code and are run automatically when the system is initialized.
business logic
The core logic related to the domain model of a business system. Because business logic usually reflects the results of many independent business decisions, it often seems anything but logical!
class attribute
An attribute that is placed on a class in the source code to tell the compiler or runtime system that this class is "special." In some variants of xUnit , class attributes are used to indicate that a class is a Testcase Class .
class method
A method that is associated with a class rather than an object. Class methods can be invoked using a classname.methodname notation [e.g., Assert.assertEquals(message, expected, actual); ] and do not require an instance of the class to be invoked. Class methods cannot access instance methods or instance variables of objects; that is, they do not have access to self or this . In Java, a class method is called a static method . Other languages may use different names or keywords.
class variable
A variable that is associated with a class rather than an instance of the class and is typically used to access information that all instances need to share. In some languages, class variables can be accessed using the syntax classname.variablename (e.g., TestHelper.lineFeedCharacter; ). That is, they do not need to be accessed via self or this . In Java, a class variable is called a static variable . Other languages may use different names or keywords.
closure
See block .
code smell
The "classic" bad smell, as first described by Martin Fowler in [Ref] . Test automaters must recognize code smells that arise as they maintain test code. Code smells typically affect maintenance cost of tests but may also be early warning signs of behavior smells to follow.
See also: test smell , behavior smell , project smell .
component
A larger part of the overall system that is often separately deployable. Component-based development involves decomposing the overall functionality into a series of individual components that can be built and deployed separately. This allows sharing of the components between applications that need the same functionality. Each component is a consequence of one or more design decisions, although its behavior may also be traced back to some aspect of the requirements.
Components can take many forms, depending on the technology being employed. The Windows platform uses dynamic linked libraries (DLLs) or assemblies as components. The Java platform uses Java Archives (JARs). A service-oriented architecture (SOA) uses Web Services as its large-grained components . The components may implement front-end logic (e.g., a "File Open Dialog") or back-end logic (e.g., a "Customer Persistence" component ). A component can and should be verified using component tests before the overall application is tested using customer tests .
component test
A test that verifies the behavior of some component of the overall system. The component is a consequence of one or more design decisions, although its behavior may also be traced back to some aspect of the requirements. There is no need for component tests to be readable, recognizable, or verifiable by the customer or business domain expert. Contrast this with a customer test, which is derived almost entirely from the requirements and should be verifiable by the customer, and with a unit test, which verifies a much smaller component. A component test lies somewhere in between these two extremes.
During test-driven development , component tests are written after the customer tests are written and the overall design is solidified. They are written as the architectural decisions are made but before the individual units are designed or coded. They are usually automated using a member of the xUnit family.
constructor
A special method used in some object-oriented programming languages to construct a brand-new object. It often has the same name as the class and is typically called automatically by the runtime system whenever the special operation new is invoked. A Complete Constructor Method [SBPP] returns a ready-to-use object that requires no additional tweaking; this usually implies arguments must be passed to the constructor.
continuous integration
The agile software development practice of integrating software changes continuously. In practice, developers typically integrate their changes every few hours to days. Continuous integration often includes the practice of an automated build that is triggered by each check-in. The build process typically runs all automated tests and may even run tests that aren't run before check-in because they take too long. The build is considered to have "failed" if any tests fail. When the build fails, teams typically consider getting the build working again to be the top priority; only code changes aimed at fixing the build are allowed until a successful build has occurred.
control point
How the test asks the system under test (SUT) to do something for it. A control point could be created for the purpose of setting up or tearing down the fixture or it could be used during the exercise SUT phase of the test. It is a kind of interaction point . Some control points are provided strictly for testing purposes; they should not be used by the production code because they bypass input validation or short-circuit the normal life cycle of the SUT or some object on which it depends.
customer test
A test that verifies the behavior of a slice of the visible functionality of the overall system. The system under test (SUT) may consist of the entire system or a fully functional top-to-bottom slice ("module") of the system. A customer test should be independent of the design decisions made while building the SUT . That is, we should require the same set of customer tests regardless of how we choose to build the SUT . (Of course, how the customer tests interact with the SUT may be affected by high-level software architecture decisions.)
data access layer
A way of keeping data access logic from permeating the application code by putting it into a separate component that encapsulates the database.
Also known as
data access object (DAO), data abstraction layer (DAL)
depended-on component (DOC)
An individual class or a large-grained component on which the system under test (SUT) depends. The dependency is usually one of delegation via method calls. In test automation, the DOC is primarily of interest in that we need to be able to observe and control its interactions with the SUT to get complete test coverage.
design pattern
A pattern that we can use to solve a particular software design problem. Most design patterns are programming language independent; the language-specific ones are typically called "coding idioms." Design patterns were first popularized by the book Design Patterns [GOF] .
design for testability
A way of ensuring that code is easily tested by making sure that testing requirements are considered as the code is designed. When doing test-driven development , design for testability occurs as a natural side effect of development
Also known as
DfT
developer test
Another name for an automated unit test that is prepared by someone playing the developer role on an eXtreme Programming project.
DfT
See design for testability .
direct input
A test may interact with the system under test (SUT) directly via its "front door" or public application programming interface (API) or indirectly via its "back door." The stimuli injected by the test into the SUT via its front door are direct inputs of the SUT . Direct inputs may consist of method or function calls to another component or messages sent on a message channel (e.g., MQ or JMS) and the arguments or contents thereof.
direct output
A test may interact with the system under test (SUT) directly via its "front door" or public application programming interface (API) or indirectly via its "back door." The responses received by the test from the SUT via its front door are direct outputs of the SUT . Direct outputs may consist of the return values of method or function calls, updated arguments passed by reference, exceptions raised by the SUT, or messages received on a message channel (e.g., MQ or JMS) from the SUT.
document-driven development
A development process that focuses on producing documents that describe how the code will be structured and then coding from those documents. Document-driven development is normally associated with "big design up front" (BDUF, also known as "waterfall") software development. Contrast this with test-driven development, which focuses on producing working code one test at a time.
domain layer
The layer of a Layered Architecture [ DDD , PEAA , WWW ] that corresponds to the domain model . See Eric Evans' book, Domain-Driven Design [DDD] .
domain model
A model of the problem domain that may form the basis of the object model in the business domain layer of a software application. See Eric Evans' book, Domain-Driven Design [DDD] .
DTO
Short for the Data Transfer Object [CJ2EEP] design pattern.
dynamic binding
Deferring the decision about which piece of software to transfer control to until execution time. The same method name can be used to invoke different behavior (method bodies) based on the class of the object on which it is invoked; the latter class is determined only at execution time. Dynamic binding is the opposite of static binding ; it is also called polymorphism (from the Latin, meaning "taking on many shapes").
EDD
See example-driven development .
emergent design
The opposite of BDUF (big design up front). Emergent design involves letting the right design be discovered as the software slowly evolves to pass one test at a time during test-driven development .
endoscopic testing
A testing technique pioneered by the authors of the original Mock Object paper [ET] , which involves testing software from the inside.
entity object
An object that represents an entity concept from a domain. Entity objects typically have a life cycle that is represented as their state. Contrast this with a service object, which has no single state. EJB Entity Beans are one example of an entity object.
Also known as
domain object
equivalence class
A test condition identification technique that reduces the number of tests required by grouping together inputs that should result in the same output or that should exercise the same logic in the system. This organization allows us to focus our tests on key boundary values at which the expected output changes.
example-driven development (EDD)
A reframing of the test-driven development process to focus on the "executable specification" aspect of the tests. The act of providing examples is more intuitive to many people; it doesn't carry the baggage of "testing" software that doesn't yet exist.
exercise SUT
After the fixture setup phase of testing, the test stimulates the system under test (SUT) logic that is to be tested. This phase of the testing process is called exercise SUT.
expectation
What a test expects the system under test (SUT) to have done. When we are using Mock Objects to verify the indirect outputs of the SUT , we load each Mock Object with the expected method calls (including the expected arguments); these are called the expectations.
expected outcome
The outcome that we verify after exercising the system under test (SUT) . A Self-Checking Test verifies the expected outcome using calls to Assertion Methods .
exploratory testing
Interactive testing of an application without a specific script in hand. The tester "explores" the system, making up theories about how it should behave based on what the application has already done and then testing those theories to see if they hold up. While there is no rigid plan, exploratory testing is a disciplined activity that is more likely to find real bugs than rigidly scripted tests.
eXtreme Programming
An agile software development methodology that showcases pair programming, automated unit testing, and short iterations.
factory
A method, object, or class that exists to build other objects.
false negative
A situation in which a test passes even though the system under test (SUT) is not working properly. Such a test is said to give a false-negative indication or a "false pass."
See also: false positive .
false positive
A situation in which a test fails even though the system under test (SUT) is working properly. Such a test is said to give a false-positive indication or a "false failure." The terminology comes from statistical science and relates to our attempt to calculate the probability of some observation error occurring. For example, in medicine we run tests to find out if a medical condition is present; if it is, the test is "positive." It is useful to know the probability that a test might indicate that a condition (such as diabetes) is present when it is not—that is, a false "positive." If we think of software tests as a way of determining whether a condition (a particular defect or bug) is present, a test that reports a defect (a test failure or error) when it is not, in fact, present is giving us a false positive.
See also: false negative . Wikipedia [Wp] has an extensive description under the topic "Type I and type II errors."
fault insertion test
A kind of test in which a deliberate fault is introduced in one part of the system to verify that another part reacts to the error appropriately. Initially, the faults were related to hardware but the same concept is now applied to software faults as well. Replacing a depended-on component (DOC) with a Saboteur that throws an exception is an example of a software fault insertion test.
feature
A testable unit of functionality that can be built onto the evolving software system. In eXtreme Programming , a user story corresponds roughly to a feature.
Fit test
A test that uses the Fit testing framework; most commonly a customer test .
fixture
See test fixture (disambiguation) .
fixture (Fit)
In Fit , the Adapter [GOF] that interprets the Fit table and invokes methods on the system under test (SUT), thereby implementing a Data-Driven Test . For meanings in other contexts, see test fixture (disambiguation) , test fixture (in xUnit), and test fixture (in NUnit) .
fixture holding class variable
A class variable of a Testcase Class that is used to hold a reference to the test fixture . It typically holds a reference to a Shared Fixture .
fixture holding instance variable
An instance variable of a Testcase Object that is used to hold a reference to the test fixture . It typically holds a reference to a Fresh Fixture that is set up using Implicit Setup .
fixture holding local variable
A local variable of a Test Method that is used to hold a reference to the test fixture . It typically holds a reference to a Fresh Fixture that is set up within the test method using In-line Setup or returned from Delegated Setup.
fixture setup
Before the desired logic of the system under test (SUT) can be exercised, the pre-conditions of the test need to be set up. Collectively, all objects (and their states) are called the test fixture (or test context ), and the phase of the test that sets up the test fixture is called fixture setup.
fixture teardown
After a test is run, the test fixture that was built by the test should be destroyed. This phase of the test is called fixture teardown.
fluent interface
A style of object constructor API that results in easy-to-understand statements. The Configuration Interface provided by the Mock Object toolkit JMock is an example of a fluent interface.
front door
The public application programming interface (API) of a piece of software. Contrast this with the back door .
function pointer
From Wikipedia [Wp] : "A function pointer is a type of pointer in C, C++, D, and other C-like programming languages. When dereferenced, a function pointer invokes a function, passing it zero or more arguments like a normal function."
Also known as
procedure variable, delegate in .NET languages
functional test (common usage)
A black-box test of the end-user functionality of an application. The agile community is trying to avoid this usage of "functional test" because of the potential for confusion when talking about verifying functional (as opposed to nonfunctional or extra-functional properties) properties of a unit or component . This book uses the terms " customer test" and " acceptance test" for a functional test of the entire application and " unit test" for a functional test of an individual unit of the application.
functional test (contrast with extra-functional test)
A test that verifies the functionality implemented by a piece of software. Depending on the scope of the software, a functional test may be a customer test , a unit test, or a component test .
In some circles a functional test is a customer test. This usage becomes confusing, however, when we talk about testing nonfunctional or extra-functional properties of the system under test (SUT) . This book uses the terms " customer test" and " acceptance test" for a functional test of the entire application and " unit test" for a functional test of an individual unit of the application.
garbage collection
A mechanism that automatically recovers the memory used by any objects that are no longer accessible. Many modern object-oriented programming environments provide garbage collection.
global variable
A variable that is global to a whole program. A global variable is accessible from anywhere within the program and never goes out of scope, although the memory to which it refers can be deallocated explicitly.
green bar
Many Graphical Test Runners portray the progress of the test run using a progress bar. As long as all tests have passed, the bar stays green. When any tests fail, the indicator changes to a red bar .
GUI
Graphical user interface.
happy path
The "normal" path of execution through a use case or through the software that implements it; also known as the "sunny day" scenario. Nothing goes wrong, nothing out of the ordinary happens, and we swiftly and directly achieve the user's or caller's goal.
Hollywood principle
What directors in Hollywood tell aspiring actors at mass-casting calls: "Don't call us; we'll call you (if we want you)." In software, this concept is often called inversion of control (IOC) .
IDE
Integrated development environment. An environment that provides tools to edit, compile, execute, and (typically) test code within a single development tool.
incremental delivery
A method of building and deploying a software system in stages and releasing the software as each stage, called an "increment," is completed. This approach results in earlier delivery to the user of a working system, where the capabilities of the system increase over time. In agile methods, the increment of functionality is the feature or user story . Incremental delivery goes beyond iterative development and incremental development, however, by actually putting the functionality into production on a regular basis. This idea is summarized by the following mantra: "Deliver early, deliver often."
incremental development
A method of building a software system in stages such that the functionality built to date can be tested before the next stage is started. This approach allows for the earlier delivery to the user of a working system, where the capabilities of the system increase over time (see incremental delivery ). In agile methods, the increment of functionality is the feature or user story . Incremental development goes beyond iterative development, however, in that it promises to produce working, testable, and potentially deployable software with every iteration. With incremental delivery , we also promise to "Deliver early, deliver often."
indirect input
When the behavior of the system under test (SUT) is affected by the values returned by another component whose services it uses, we call those values the indirect inputs of the SUT . Indirect inputs may consist of actual return values of functions, updated (out) parameters of procedures or subroutines, and any errors or exceptions raised by the depended-on component (DOC) . Testing of the SUT behavior with indirect inputs requires the appropriate control point on the "back side" of the SUT . We often use a Test Stub to inject the indirect inputs into the SUT .
indirect output
When the behavior of the system under test (SUT) includes actions that cannot be observed through the public application programming interface (API) of the SUT but that are seen or experienced by other systems or application components, we call those actions the indirect outputs of the SUT . Indirect outputs may consist of method or function calls to another component, messages sent on a message channel (e.g., MQ or JMS), and records inserted into a database or written to a file. Verification of the indirect output behaviors of the SUT requires the use of appropriate observation points on the "back side" of the SUT . Mock Objects are often used to implement the observation point by intercepting the indirect outputs of the SUT and comparing them to the expected values.
See also: outgoing interface .
Also known as
outgoing interface
inner class
A class in Java that is defined inside another class. A nonymous inner classes are defined inside a method, whereas inner classes are defined outside a method. Inner classes are often used when defining Hard-Coded Test Doubles .
Also known as
member variable
instance method
A method that is associated with an object rather than the class of the object. An instance method is accessible only from within or via an instance of the class. It is typically used to access information that is expected to differ from one instance to another.
The exact syntax used to access an instance method varies from language to language. The most common syntax is objectReference.methodName(). When referenced from within other methods on the object, some languages require an explicit reference to the object (e.g., this.methodName() or self methodName); other languages simply assume that any unqualified references to methods are references to instance methods .
instance variable
A variable that is associated with an object rather than the class of object. An instance variable is accessible only from within or via an instance of the class. It is typically used to access information that is expected to differ from one instance to another.
Also known as
member function
interaction point
A point at which a test interacts with the system under test (SUT) . An interaction point can be either a control point or an observation point .
interface
In general, a fully abstract class that defines only the public methods that all implementers of the interface must provide. In Java, an interface is a type definition that does not provide any implementation. In most single-inheritance languages, a class may implement any number of interfaces, even though it can extend (subclass) only one other class.
inversion of control (IOC)
A control paradigm that distinguishes software frameworks from "toolkits" or components. The framework calls the software plug-in (rather than the reverse). In the real world, inversion of control is often called the Hollywood principle . With the advent of automated unit testing , a class of framework known as an inversion of control framework has sprung up specifically to simplify the replacement of depended-on components (DOCs) with Test Doubles .
IOC
See inversion of control .
iterative development
A method of building a software system using time-boxed "iterations." Each iteration is planned and then executed. At the end of the "time box," the status of all the work is reviewed and the next iteration is planned. The strict time-boxing prevents "runaway development," where the state of the system is never assessed because nothing is ever finished. Unlike incremental development , iterative development does not require working software to be delivered at the end of each iteration.
layer-crossing test
A test that either sets up the fixture or verifies the outcome using Back Door Manipulation, which involves using a "back door" of the system under test (SUT) such as a database. Contrast this with a round-trip test .
legacy software
In the test-driven development community, any software that does not have a Safety Net of Fully Automated Tests .
liveware
The people who use our software. They are usually assumed to be much more intelligent than either the software or the hardware but they can also be rather unpredictable.
Also known as
wetware, mushware
local variable
A variable that is associated with a block of code rather than an object or class. A local variable is accessible only from within the code block; it goes out of scope when the block of code returns to its caller.
manual test
A test that is executed by a person interacting with the system under test (SUT) . The user may be following some sort of "test script" (not to be confused with a Scripted Test ) or doing ad hoc or exploratory testing.
meta object
An object that holds data that controls the behavior of another object. A meta object protocol is the interface by which the meta object is constructed or configured.
metatest
A test that verifies the behavior of one or more tests. Such a test is mostly used during test-driven development, when we are writing tests as examples or course material and we want to ensure that tests are, indeed, failing to illustrate a particular problem.
method attribute
An attribute that is placed on a method in the source code to tell the compiler or runtime system that this method is "special." In some xUnit family members, method attributes are used to indicate that a method is a Test Method .
mixin
Functionality intended to be inherited by another class as part of that class's implementation without implying specialization ("kind of" relationship) of the providing class.
"The term mixin comes from an ice cream store in Somerville, Massachusetts, where candies and cakes were mixed into the basic ice cream flavors. This seemed like a good metaphor to some of the object-oriented programmers who used to take a summer break there, especially while working with the object-oriented programming language SCOOPS" ( SAMS Teach Yourself C++ in 21 Days, 4th ed., p. 458).
module
In legacy programming environments (and probably a few current ones, too): An independently compilable unit of source code (e.g., the "file I/O module") that is later linked into the final executable. Unlike a component , this kind of module is typically not independently deployable. It may or may not have a corresponding set of unit tests or component tests .
When describing the functionality of a software system or application: A complete vertical chunk of the application that provides a particular piece of functionality (e.g., the "Customer Management Module") that can be used somewhat independently of the other modules . It would have a corresponding set of acceptance tests and may be the unit of incremental delivery .
need-driven development
A variation on the test-driven development process where code is written from the outside in and all depended-on code is replaced by Mock Objects that verify the expected indirect outputs of the code being written. This approach ensures that the responsibilities of each software unit are well understood before they are coded, by virtue of having unit tests inspired by examples of real usage. The outermost layer of software is written using storytest-driven development. It should have examples of usage by real clients (e.g., a user interface driving the Service Facade [CJ2EEP] ) in addition to the customer tests .
object-relational mapping (ORM)
A middleware component that translates between the object-oriented domain model of an application and the table-oriented view presented by a relational database management system.
observation point
The means by which the test observes the behavior of the system under test (SUT) . This kind of interaction point can be used to inspect the post-exercise state of the SUT or to monitor interactions between the SUT and its depended-on components. Some observation points are provided strictly for the tests; they should not be used by the production code because they may expose private implementation details of the SUT that cannot be depended on not to change.
ORM
See object-relational mapping .
outgoing interface
A component (e.g., a class or a collection of classes) often depends on other components to implement its behavior. The interfaces it uses to access these components are known as outgoing interfaces, and the inputs and outputs transmitted via test interfaces are called indirect inputs and indirect outputs . Outgoing interfaces may consist of method or function calls to another component, messages sent on a message channel (e.g., MQ or JMS), or records inserted into a database or written to a file. Testing the behavior of the system under test (SUT) with outgoing interfaces requires special techniques such as Mock Objects to intercept and verify the usage of outgoing interfaces.
pattern
A solution to a recurring problem. A pattern has a context in which it is typically applied and forces that help you choose one pattern over another based on that context. Design patterns are a particular kind of pattern. Organizational patterns are not discussed in this book.
pattern language
A collection of patterns that work together to lead the reader from a very high-level problem to a very detailed solution customized for his or her particular context. When a pattern language achieves this goal, it is said to be "generative"; this characteristic differentiates a pattern language from a simple collection of patterns. Refer to "A Pattern Language for Pattern Writing" [APLfPW] to learn more about how to write a pattern language.
polymorphism
Dynamic binding . The word is derived from the Latin, meaning "taking on many shapes."
presentation layer
The part of a Layered Architecture [ DDD , PEAA , WWW ] that contains the presentation logic .
presentation logic
The logic embedded in the presentation layer of a business system. It decides which screen to show, which items to put on menus, which items or buttons to enable or disable, and so on.
Also known as
function pointer, delegate (in .NET languages)
procedure variable
A variable that refers to a procedure or function rather than a piece of data. It allows the code to be called to be determined at runtime (dynamic binding) rather than at compile time. The actual procedure to be invoked is assigned to the variable either during program initialization or during execution. Procedure variables were a precursor to true object-oriented programming languages (OOPLs). Early OOPLs such as C++ were built by using tables (arrays) of data structures containing procedure variables to implement the method (member function) dispatch tables for classes.
production
In IT shops, the environment in which applications being used by real users run. This environment is distinguished from the various testing environments, such as "acceptance," "integration," "development," and "qual" (short for "quality assessment or assurance").
production code
In IT shops, the environment in which applications run is often called production . Production code is the code that we are writing for eventual deployment to this environment, whether the code is to be shipped in a product or deployed into " production." Compare to " test code."
programmer test
A developer test .
project smell
A symptom that something has gone wrong on the project. Its underlying root cause is likely to be one or more code smells or behavior smells. Because project managers rarely run or write tests, project smells are likely the first hint they have that something may be less than perfect in test automation land.
Also known as
pull system
pull
A concept from lean manufacturing that states that things should be produced only once a real demand for them exists. In a "pull system," upstream (i.e., subcomponent) assembly lines produce only enough products to replace the items withdrawn from the pool that buffers them from the downstream assembly lines. In software development, this idea can be translated as follows: "We should only write methods that have already been called by other software and only handle those cases that the other software actually needs." This approach avoids speculation and the writing of unnecessary software, which is one of software development's key forms of inventory (which is considered waste in lean systems).
red bar
Many Graphical Test Runners portray the progress of the test run using a progress bar that starts off green in color. When any tests fail, this indicator changes to a red bar.
refactoring
Changing the structure of existing code without changing its behavior. Refactoring is used to improve the design of existing code, often as a first step before adding new functionality. The authoritative source for information on refactoring is Martin Fowler's book [Ref] .
reflection
The ability of a software program to examine its own structure as it is executing. Reflection is often used in software development tools to facilitate adding new capabilities.
regression test
A test that verifies that the behavior of a system under test (SUT) has not changed. Most regression tests are originally written as either unit tests or acceptance tests, but are subsequently included in the regression test suite to keep that functionality from being accidentally changed.
result verification
After the exercise SUT phase of the Four-Phase Test , the test verifies that the expected (correct) outcome has actually occurred. This phase of the test is called result verification.
Also known as
postmortem, postpartum
retrospective
A process whereby a team reviews its processes and performance for the purpose of identifying better ways of working. Retrospectives are often conducted at the end of a project (called a project retrospective) to collect data and make recommendations for future projects. They have more impact if they are done regularly during a project. Agile projects tend to do retrospectives after at least every release (called a release retrospective) and often after every iteration (called an iteration retrospective.)
root cause analysis
A process wherein the cause of a failure or bug is traced back to all possible contributing factors. A root cause analysis helps us avoid treating symptoms by identifying the true sources of our problems. A number of techniques for doing root cause analysis exist, including Toyota's "five why's" [TPS] .
round-trip test
A test that interacts only via the "front door" (public interface) of the system under test (SUT) . Compare with layer-crossing test .
service object
An object that provides a service to other objects. Service objects typically do not have a life cycle of their own; any state they do contain tends to be an aggregate of the states of the entity objects that they vend. The interface of a service object is often defined via a Service Facade [CJ2EEP] class. EJB Session Beans are one example of a service object.
Also known as
service component
setter
A method provided by an object specifically to set the value of one of its attributes. By convention, it either has the same name as the attribute or its name includes the prefix "set" (e.g., setName ).
smell
A symptom of a problem. A smell doesn't necessarily tell us what is wrong, because it may have several possible causes. A smell must pass the "sniffability test"—that is, it must grab us by the nose and say, "Something is wrong here." To figure out exactly what the smell means, we must perform root cause analysis .
We classify smells based on where we find them. The most common kinds are (production) code smells , test smells, and project smells . Test smells may be either (test) code smells or behavior smells .
spike
In agile methods such as eXtreme Programming , a time-boxed experiment used to obtain enough information to estimate the effort required to implement a new kind of functionality.
stateless
An object that does not maintain any state between invocations of its operations. That is, each request is self-contained and does not require that the same server object be used for a series of requests.
static binding
Resolving exactly which piece of software we will transfer control to at compile time. Static binding is the opposite of dynamic binding .
static method
In Java, a method that the compiler resolves at compile time (rather than at runtime using dynamic binding). This behavior is the opposite of dynamic (or virtual in C++). A static method is also a class method because only class methods can be resolved at compile time in Java. A static method is not necessarily a class method in all languages, however. For example:
Assert.assertEquals(message, expected, actual);
static variable
In Java, a variable (field) that the compiler resolves at compile time rather than at runtime using dynamic binding . A static variable is also a class variable because only class variables can be resolved at compile time in Java. Being static (i.e., not dynamic) does not necessarily imply that something is associated with a class (rather than an instance) in all languages.
STDD
See storytest-driven development .
story
See user story .
storytest
A customer test that is the "confirmation" part of the user story "trilogy": card, conversation, confirmation [XPC] . When the storytests are written before any software is developed, we call the process storytest-driven development .
storytest-driven development (STDD)
A variation of the test-driven development process that entails writing (and usually automating) customer tests before the development of the corresponding functionality begins. This approach ensures that integration of the various software units verified by the unit tests results in a usable whole. The term "storytest-driven development" was first coined by Joshua Kerievsky as part of his methodology "Industrial XP" [IXP] .
STTCPW
"The simplest thing that could possibly work." This approach is commonly used on XP projects when someone is over-engineering the software by trying to anticipate future requirements.
substitutable dependency
A software component may depend on any number of other components. If we are to test this component by itself, we must be able to replace the other components with Test Doubles —that is, each component must be a substitutable dependency. We can turn something into a substitutable dependency in several ways, including Dependency Injection , Dependency Lookup, and Test-Specific Subclass .
synchronous test
A test that interacts with the system under test (SUT) using normal (synchronous) method calls that return the results that the test will make assertions against. A synchronous test does not need to coordinate its steps with those of the SUT ; this activity is managed automatically by the runtime system. Contrast this with an asynchronous test, which runs in a separate thread of control from the SUT .
Also known as
AUT, CUT, MUT, OUT
system under test (SUT)
Whatever thing we are testing. The SUT is always defined from the perspective of the test. When we are writing unit tests, the SUT is whatever class (also known as CUT), object (also known as OUT), or method (also known as MUT) we are testing; when we are writing customer tests , the SUT is probably the entire application (also known as AUT) or at least a major subsystem of it. The parts of the application that we are not verifying in this particular test may still be involved as a depended-on component (DOC) .
task
The unit of work assignment (or volunteering) in eXtreme Programming . One or more tasks may be involved in delivering a user story (a feature ).
TDD
See test-driven development .
test
A procedure, whether manually executed or automated, that can be used to verify that the system under test (SUT) is behaving as expected. Often called a test case .
test automater
The person or project role that is responsible for building the tests . Sometimes a "subject matter expert" may be responsible for coming up with the tests to be automated by the test automater.
test case
Usually a synonym for " test ." In xUnit, it may also refer to a Testcase Class, which is actually a Test Suite Factory as well as a place to put a set of related Test Methods .
test code
Code written specifically to test other code (either production or other test code).
test condition
A particular behavior of the system under test (SUT) that we need to verify. It can be described as the following collection of points:
- If the SUT is in some state S1, and
- We exercise the SUT in some way X, then
- The SUT should respond with R and
- The SUT should be in state S2.
test context
Everything a system under test (SUT) needs to have in place so that we can exercise the SUT for the purpose of verifying its behavior. For this reason, RSpec calls the test fixture (as used in xUnit) a "context."
Context: a set fruits with
contents = {apple, orange, pear}
Exercise: remove orange from the fruits set
Verify: fruits set contents = {apple, pear}
In this example, the fixture consists of a single set and is created directly in the test. How we choose to construct the fixture has very far-reaching ramifications for all aspects of test writing and maintenance.
test database
A database instance that is used primarily for the execution of tests. It should not be the same database as is used in production !
test debt
I first became aware of the concept of various kinds of debts via the Industrial XP mailing list on the Internet. The concept of "debt" is a metaphor for "not doing enough of" something. To get out of debt, we must put extra effort into the something we were not doing enough of. Test debt arises when we do not write all of the necessary tests. As a result, we have "unprotected code" in that the code could break without causing any tests to fail.
test-driven bug fixing
A way of fixing bugs that entails writing and automating unit tests that reproduce each bug before we begin debugging the code and fixing the bug; the bug-fixing extension of test-driven development .
test-driven development (TDD)
A development process that entails writing and automating unit tests before the development of the corresponding units begins. TDD ensures that the responsibilities of each software unit are well understood before they are coded. Unlike test-first development , test-driven development is typically meant to imply that the production code is made to work one test at a time (a characteristic called emergent design ).
See also: storytest-driven development .
test driver
A person doing test-driven development .
test driving
The act of doing test-driven development .
test error
When a test is run, an error that keeps the test from running to completion. The error may be explicitly raised or thrown by the system under test ( SUT) or by the test itself, or it may be thrown by the runtime system (e.g., operating system, virtual machine). In general, it is much easier to debug a test error than a test failure because the cause of the problem tends to be much more local to where the test error occurs. Compare with test failure and test success .
test failure
When a test is run and the actual outcome does not match the expected outcome. Compare with test error and test success .
test-first development
A development process that entails writing and automating unit tests before the development of the corresponding units begins. Test-first development ensures that the responsibilities of each software unit are well understood before that unit is coded. Unlike test-driven development , test-first development merely says that the tests are written before the production code ; it does not imply that the production code is made to work one test at a time ( emergent design ). Test-first development may be applied at the unit test or customer test level, depending on which tests we have chosen to automate.
test fixture (disambiguation)
In generic xUnit: All the things we need to have in place to run a test and expect a particular outcome. The test fixture comprises the pre-conditions of the test; that is, it is the "before" picture of the SUT and its context. See also: test fixture (in xUnit) and test context .
In NUnit and VbUnit: The Testcase Class . See also: test fixture (in NUnit) .
In Fit: The adapter that interprets the Fit table and invokes methods on the system under test (SUT), thereby implementing a Data-Driven Test .
See also: fixture (Fit) .
test fixture (in NUnit)
In NUnit (and in VbUnit and most .NET implementations of xUnit): The Testcase Class on which the Test Methods are implemented. We add the attribute [ TestFixture ] to the class that hosts the Test Methods .
Some members of the xUnit family assume that an instance of the Testcase Class "is a" test context ; NUnit is a good example. This interpretation assumes we are using the Testcase Class per Fixture approach to organizing the tests. When we choose to use a different way of organizing the tests, such as Testcase Class per Class or Testcase Class per Feature , this merging of the concepts of test context and Testcase Class can be confusing. This book uses " test fixture" to mean "the pre-conditions of the test" (also known as the test context ) and Testcase Class to mean "the class that contains the Test Methods and any code needed to set up the test context ."
Also known as
Testcase Class
test fixture (in xUnit)
In xUnit: All the things we need to have in place to run a test and expect a particular outcome (i.e., the test context . Some variants of xUnit keep the concept of the test context separate from the Testcase Class that creates it; JUnit and its direct ports fall into this camp. Setting up the test fixture is the first phase of the Four-Phase Test . For meanings of the term "test fixture" in other contexts, see test fixture (disambiguation) .
Also known as
test context
test-last development
A development process that entails executing unit tests after the development of the corresponding units is finished. Unlike test-first development , test-last development merely says that testing should be done before the code goes into production ; it does not imply that the tests are automated. Traditional QA (quality assurance) testing is inherently test-last development unless the tests are prepared as part of the requirements phase of the project and are shared with the development team.
test maintainer
The person or project role responsible for maintaining the tests as the system or application evolves. Most commonly, this person is enhancing the system with new functionality or fixing bugs. The test maintainer could also be whoever is called in when the automated tests fail for whatever reason. If the test maintainer is doing the enhancements by writing tests first, he or she is also a test driver .
test package
In languages that provide packages or namespaces, a package or name that exists for the purpose of hosting Testcase Classes .
test reader
Anyone who has reason to read tests, including a test maintainer or test driver . This individual may be reading the tests primarily for the purpose of understanding what the system under test (SUT) is supposed to do ( Tests as Documentation ) or as part of a test maintenance or software development activity.
test result
A test or test suite can be run many times, each time yielding a different test result.
test run
A test or test suite can be run many times, each time yielding a different test result . Some commercial test automation tools record the results of each test run for prosperity.
test smell
A symptom of a problem in test code . A smell doesn't necessarily tell us what is wrong because it may have several possible causes. Like all smells , a test smell must pass the "sniffability test"—that is, it must grab us by the nose and say, "Something is wrong here."
test-specific equality
Tests and the system under test (SUT) may have different ideas about what constitutes equality of two objects. In fact, this understanding may differ from one test to another. It is not advisable to modify the definition of equality within the SUT to match the tests' expectations, as this practice leads to Equality Pollution . Making individual Equality Assertions on many attributes of an object is not the answer either, as it can result in Obscure Tests and Test Code Duplication . Instead, build one or more Custom Assertions that meets your tests' needs.
test stripper
A step or program in the build process that removes all the test code from the compiled and linked executable.
test success
A situation in which a test is run and all actual outcomes match the expected outcomes. Compare with test failure and test error .
test suite
A way to name a collection of tests that we want to run together.
Unified Modeling Language (UML)
From Wikipedia [Wp] : "[A] nonproprietary specification language for object modeling. UML is a general-purpose modeling language that includes a standardized graphical notation used to create an abstract model of a system, referred to as a UML model."
unit test
A test that verifies the behavior of some small part of the overall system. What turns a test into a unit test is that the system under test (SUT) is a very small subset of the overall system and may be unrecognizable to someone who is not involved in building the software. The actual SUT may be as small as a single object or method that is a consequence of one or more design decisions, although its behavior may also be traced back to some aspect of the functional requirements. Unit tests need not be readable, recognizable, or verifiable by the customer or business domain expert. Contrast this with a customer test, which is derived almost entirely from the requirements and which should be verifiable by the customer. In eXtreme Programming , unit tests are also called developer tests or programmer tests .
use case
A way of describing the functionality of a system in terms of what its users are trying to achieve and what the system needs to do to achieve their goals. Unlike user stories , use cases may cover many different scenarios yet are often not testable independently.
user acceptance test (UAT)
See acceptance test .
user story
The unit of incremental development in eXtreme Programming . We must INVEST in good user stories—that is, each user story must be Independent, Negotiable, Valuable, Estimatable, Small, and Testable [XP123] . A user story corresponds roughly to a " feature" in non- eXtreme Programming terminology and is typically decomposed into one or more tasks to be carried out by project team members.
Also known as
story, feature
verify outcome
After the exercise SUT phase of the test, the test compares the actual outcome—including returned values, indirect outputs, and the post-test state of the system under test (SUT)— with the expected outcome. This phase of the test is called the verify outcome phase.