---
title: moduleName
framework: testing
role: symbol
role_heading: Instance Property
path: testing/sourcelocation/modulename
---

# moduleName

The name of the module containing the source file.

## Declaration

```swift
var moduleName: String { get }
```

## Discussion

Discussion The name of the module is derived from this instance’s fileID property. It consists of the substring of the file ID up to the first forward-slash character ("/".) For example, if the value of this instance’s fileID property is "FoodTruck/WheelTests.swift", the module name is "FoodTruck". The structure of file IDs is described in the documentation for the #fileID macro in the Swift standard library.

## See Also

### Related Documentation

- [fileID](testing/sourcelocation/fileid.md)
- [fileName](testing/sourcelocation/filename.md)
- [#fileID](swift/fileid().md)
