# Testing helpers

The `_getModelData()` and `_setModelData()` functions exposed by [model developer utilities](../../api/module_engine_dev-utils_model.md) and [view developer utilities](../../api/module_engine_dev-utils_view.md) are useful development helpers.

They allow for “stringifying” the [model](../architecture/editing-engine.md#model) and [view](../architecture/editing-engine.md#view) structures, selections, ranges, and positions as well as for loading them from a string. They are often used when writing tests.

> **Note**
>
> Both tools are designed for prototyping, debugging, and testing purposes. Do not use them in production-grade code.

For instance, to take a peek at the editor model, you could use the [`_getModelData()`](../../api/module_engine_dev-utils_model.md#constant-_getModelData) helper:

**NPM**

```js
import { _getModelData } from 'ckeditor5';

// More imports.
// ...

ClassicEditor
	.create( {
		root: { initialData: '<p>Hello <b>world</b>!</p>' }
	} )
	.then( editor => {
		console.log( _getModelData( editor.model ) );
		// -> '<paragraph>[]Hello <$text bold="true">world</$text>!</paragraph>'
	} );
```

**CDN**

```js
const { _getModelData } = CKEDITOR;

// More imports.
// ...

ClassicEditor
	.create( {
		root: { initialData: '<p>Hello <b>world</b>!</p>' }
	} )
	.then( editor => {
		console.log( _getModelData( editor.model ) );
		// -> '<paragraph>[]Hello <$text bold="true">world</$text>!</paragraph>'
	} );
```

See the [helper documentation](../../api/module_engine_dev-utils_model.md#constant-_getModelData) to learn more about useful options.

---

Full index of the CKEditor 5 documentation: [llms.txt](../../../llms.txt)
