E: Unit TestsΒΆ
Below is a table of the unit tests included within this project.
The unit tests are associated with an appropriate requirement to allow for traceability, and the tests aim to check that the code works for any associated requirements. Not all requirements have associated tests, and vice versa - this is because some requirements cannot be explicitly unit tested, and some tests do not link up directly to a requirement, but are still needed to ensure the code functions as intended.
There is a criticality measure against each test, for both acceptance and unit tests - this is to represent how important the test is to the overall function of the code. Criticality is on a scale - high criticality means that if that test fails, the project will not function at all; low criticality means that if the test fails, the project will still mostly function as intended.
| ID | Test Name | Purpose | Criticalit y | Class | Req ID | Result |
| 1.01 | testDescri ption | Verifies clue descriptio n is returned correctly | Medium | Clue | 5.1.2 | passed |
| 1.02 | testEquali ty | Verifies clues can be compared correctly for equality | Medium | Clue | 5.2.1 | passed |
| 1.03 | testName | Verifies clue name is returned correctly | High | Clue | 5.1.2 | passed |
| 1.04 | testTileCo ordinates | Verifies clue has the correct coordinate for the map | High | Clue | 5.1.1 | passed |
| 1.05 | testPerson ality | Verifies the NPC personalit y is returned correctly | Medium | NPC | 3.1.5 | passed |
| 1.06 | testGetName | Verifies NPC name is returned correctly | Low | NPC | 3.1.2 | passed |
| 1.07 | doesPlayer Move | Verifies the player move function works correctly | High | Player | 2.1.4 | passed |
| 1.08 | testPlayer Personality | Verifies the player personality is set and get correctly | Medium | Player | 2.1.1 | passed |
| 1.09 | testPlayer Name | Verifies the player name is returned correctly | Low | Player | _ | passed |
| 1.10 | testAddTra nsition | Verifies transitions between rooms can be added | High | Room | 4.1.1 | passed |
| 1.11 | testGetTra nsition | Verifies transitions between rooms can be performed | High | Room | 4.1.1 | passed |
| 1.12 | testMatRot ation | Verifies direction of room transition is correctly returned | Medium | Room | _ | passed |
| 1.13 | testTrigge r | Verifies function to check if a tile is a trigger to perform an action | High | Room | _ | passed |
| 1.14 | testWalkab le | Verifies that a tile returns the correct property for walkabilit y | Low | Room | _ | passed |