/go-unittest

GoLang unit tesings are done with simple codes and a testing technique using which individual modules are tested to determine if there are any issues by the developer himself.

Primary LanguageGo

go-unittest

                             GoLang unit tesings are done with simple codes. 
  • Unit testing is a software testing method by which individual units of source code, sets of one or

more computer program modules together with associated control data, usage procedures, and operating procedures, are tested to determine whether they are fit for use.

  • Unit testing, a testing technique using which individual modules are tested to determine if there are

any issues by the developer himself. It is concerned with functional correctness of the standalone modules.

APPLICATIONS:

Extreme programming: Unit testing is the cornerstone of extreme programming, which relies on an 
automated unit testing framework. This automated unit testing framework can be either third party,
created within the development group.

Unit testing frameworks: Unit testing frameworks are most often third-party products that are not
distributed as part of the compiler suite. They help simplify the process of unit testing, having 
been developed for a wide variety of languages.

Language-Level unit testing Support: Some programming languages directly support unit testing. 
Their grammar allows the direct declaration of unit tests without importing a library 
(whether third party or standard).Additionally, the boolean conditions of the unit tests
can be expressed in the same syntax as boolean expressions used in non-unit test code, 
such as what is used for if and while statements.

ADVANTAGES:

  • It makes the coding process more agile.
  • Unit testing improves the quality of the code. It identifies every defect that may have come up before code is sent further for integration testing. It exposes the edge cases and makes you write better code.
  • Issues are found at an early stage. Since unit testing is carried out by developers who test individual code before integration, issues can be found very early and can be resolved then and there without impacting the other pieces of the code.
  • Unit testing reduces defects in the newly developed features or reduces bugs when changing the existing functionality.
  • Unit testing provides documentation of the system. Developers looking to learn what functionality is provided by a unit and how to use it can look at the unit tests to gain a basic understanding of the unit’s interface (API).
  • Unit testing helps simplify the debugging process. If a test fails, then only the latest changes made in the code need to be debugged.
  • This not only keeps you focused; it makes you create better designs. Testing a piece of code forces you to define what that code is responsible for.

Drawbacks:

  • Time consuming.
  • Does not show absence of errors.
  • Hard to set up realistic, useful tests.
  • Integration errors or system errors can be missed.
  • May be necessary to use a version control system.
  • Need to have a review process for test case failures.
  • Test program cannot be run in actual deployment environment.
  • Test code is likely to be at least as buggy as the code it is testing.