Test - Unit Test

Testing Infrastructure

About

Generally, in xUnit framework, a test is a function with one assertion.

A test is just a sort of IF statement written in a method. A lot of framework use a collection of assertion method.

Example:

assertEquals(object1, object2)

Tests Make Software.

If you haven't seen a test fail, you don't know if the test works.

Advantage:

  • You can write a test once and run it as often as necessary without any additional cost.
  • drive the design of software, known as test-driven design

Whenever you are tempted to type something into a print statement or a debugger expression, write it as a test instead.

Martin Fowler

Unit Tests are primarily written as a good practice to help developers identify and fix bugs, to refactor code and to serve as documentation for a unit of software under test. To achieve these benefits, unit tests ideally should cover all the possible paths in a program. One unit test usually covers one specific path in one function or method. However a test method is not necessary an encapsulated, independent entity. Often there are implicit dependencies between test methods, hidden in the implementation scenario of a test.

Adrian Kuhn et. al.

When

Whenever you are tempted to type something into a print statement or a debugger expression, write it as a test instead.

Martin Fowler

Documentation / Reference





Discover More
Code Refactoring
Code - Refactoring

The process of modifying the code structure, without modifying its current behavior, is called Refactoring. Refactoring is a method that search to improve the code quality of a program. code duplication...
Testing Infrastructure
Code - Testing (Software Quality Assurance|SQA|Validator|Checker)

A test is performed to verify that the system is conformed to the specification and is the most important part of code quality. In a “Test-driven_developmenttest-driven software development (tdd)”...
Testing Infrastructure
Code Test - Assertion Library

in a code testing context. assertiontest method onlytest framework . An assertion library helps you write your result expectation of a code in a unit test between: the value that you get from your...
Card Puncher Data Processing
Test

See
Testing Infrastructure
Test - Fixture (Start State)

A test fixture represents the preparation needed to perform one or more tests, and any associate cleanup actions. One of the most time-consuming parts of writing tests is writing the code to set the...
Testing Infrastructure
Test - Given When Then

Structure of an unit test Then when phase is called setting a fixture.
Testing Infrastructure
Test - Report Format

The runners of unit test produce an output with a pre-defined format. Xunit Format apache/maven-surefire/blob/master/maven-surefire-plugin/src/site/resources/xsd/surefire-test-report.xsdMaven...
Testing Infrastructure
Test - Setup

The setup function in a test framework is called before a test method and is sometimes called a fixture
Testing Infrastructure
Test - Suite

A test suite is a standard way to aggregate a collection of tests to be run under a common test harness.
Testing Infrastructure
Test - Vector

A test vector is a set of inputs provided to a system in order to test that system. In software development, test vectors are a methodology of software testing. Generating test vectors is tedious, since...



Share this page:
Follow us:
Task Runner