Functions are methods of a class that must have an input and output type in addition to their code-based logic.
You can write unit tests in your Functions repository.
Before you can write and test Functions written on your Ontology objects, your object types (and link types as needed) must be imported into your project.
Once imported, your object or link type API name is the key to writing Functions on top of it.