# How to write unit testing in itk?

**URL:** <https://discourse.itk.org/t/how-to-write-unit-testing-in-itk/4371>\
**Category:** Beginner Questions\
**Tags:** itk\
**Created:** [August 26, 2021, 4:42pm UTC](https://discourse.itk.org/t/how-to-write-unit-testing-in-itk/4371 "2021-08-26T16:42:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![priyanka](https://discourse.itk.org/user_avatar/discourse.itk.org/priyanka/32/2399_2.png) [@priyanka](https://discourse.itk.org/u/priyanka)\
**Post date:** [August 26, 2021, 4:42pm UTC](https://discourse.itk.org/t/how-to-write-unit-testing-in-itk/4371/1 "2021-08-26T16:42:20Z")

</div>

I found “ITKTestHarness” in itk testing framework but I’m getting errors while building it.

I’m getting no idea how unit test for images in itk?

---

<div class="post-metadata">

**Author:** ![jhlegarreta](https://discourse.itk.org/user_avatar/discourse.itk.org/jhlegarreta/32/476_2.png) [@jhlegarreta](https://discourse.itk.org/u/jhlegarreta)\
**Post date:** [August 26, 2021, 7:46pm UTC](https://discourse.itk.org/t/how-to-write-unit-testing-in-itk/4371/2 "2021-08-26T19:46:04Z")

</div>

Where did you find “ITKTestHarnerss” should be related to ITK within the context of _The Insight Toolkit_? ITKTestHarnerss and _The Interoperability Toolkit_ seem to be related to the NHS message/document exchange system:

> **[ITK3 Test Harness - NHS Digital](https://digital.nhs.uk/services/interoperability-toolkit/developer-resources/itk3-test-harness)**
>
> NHS Digital has developed a set of generic FHIR messaging components to allow a standard approach to FHIR MessageHeaders and responses across NHS message and document flows in England. These components, along with NHS Digital payload specifications,...

and

> **[ITK Testbench - NHS Digital](https://digital.nhs.uk/services/interoperability-toolkit/developer-resources/itk-test-centre/itk-testbench)**
>
> The Interoperability Toolkit (ITK) Testbench is one of a number of resources provided by NHS Digital for ITK interface development and for those seeking ITK conformance.

So unrelated to what we understand by ITK within this discussion forum. It seems an unfortunate coincidence.

So if you are seeking help related to testing in _The Interoperability Toolkit_, please refer to the pages above to seek for help; if you are seeking help about testing in _The Insight Toolkit_, the [ITK Software Guide](https://itk.org/ItkSoftwareGuide.pdf), sections 9.4 and C.23, provides useful guidance to develop ITK tests. If you need further help, please post specific questions and we will try to answer to the best of our possibilities.
