Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bp 111 test procedures doc tasks for niaz #41

Merged
merged 3 commits into from Mar 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions documentation/docs/system-architecture/design.md
Expand Up @@ -60,6 +60,7 @@ classDiagram
class Sensor {
+sensorID: int
-sensorData: int[]
-calibration: Boolean

+getSensorData(): int[]
+recalibrateSensor()
Expand Down
27 changes: 26 additions & 1 deletion documentation/docs/testing/integration-testing.md
Expand Up @@ -57,4 +57,29 @@ Stubbed functional units: BlastPad website, example database with classrooms
## Integration Test for use case 3
- Runs `createNewGame()` unit tests.
- Runs `saveGame()` unit tests.
- Passes if all tests pass.
- Passes if all tests pass.

## Integration Test for Use Case 2

A user would like to develop a game using the BlastPad

Stubbed Functional Units: Blockly Code Editor, Device Manager, Gallery

### Assertions

1. Upon turning on the BlastPad the user is routed to the Homescreen (Device Manager: loadGallery() unit test)
2. Upon pressing the "Code Editor" button the user is sent to the Blockly Code Editor (Gallery: openCodeEditor() unit test)
3. Upon Pressing the "Create New Game" button the user is able to manipulate blocks in the editor and save the game to storage (BlocklyEditor: saveWorkSpace() unit test)

## Integration Test for Use Case 11

A user would like to configure the WiFi

Stubbed Functional Units: Configuration, Device Manager, Gallery

### Assertions

1. Upon turning on the BlastPad the user is routed to the Homescreen (Device Manager: loadGallery() unit test)
2. After pressing the "WiFi" button the user is sent to the WiFi configuration screen (Gallery: openConfiguration() unit test)
3. The user is shown a list of available networks on the Configuration screen (Configuration: scan() unit test)
4. Then a network is selected and the user enters in a security key and presses the "Connect" button (Configuration: connect(SSID, securityKey) unit test)
79 changes: 78 additions & 1 deletion documentation/docs/testing/unit-testing.md
Expand Up @@ -88,4 +88,81 @@ Unit test checks that the correct workspace has been loaded and displayed in the
### +compileGame()
- Creates a `Game` object with random attributes.
- Calls `compileGame()`.
- Passes if it returns `True`.
- Passes if it returns `True`.

## Sensor

### +getSensorData()
Stubbed Test Class: sensor
Requires hardware to be connected to a sensor

This unit test checks if sensorData is a non-empty array and if the calibration parameter is set to false.

- Creates a `Sensor` object
- Calls `getSensorData()`
- Passes if it returns a non-zero integer array and calibration is set to false

### +recalibrateSensor()
Stubbed Test Class: sensor
Requires hardware to be connected to a sensor

This unit test checks if the calibration parameter has been changed to True.

- Creates a `Sensor` object
- Calls `getSensorData()`
- Passes if the calibration parameter is set to True.

### +clearSensorData()
Stubbed Test Class: sensor
Requires hardware to be connected to a sensor

This unit test checks if the sensorData array is set to all zeroes.

- Creates a `Sensor` object
- Calls `clearSensorData()`
- Passes if the sensorData array is composed of all zeroes.

## Documentation

### +loadContent(type: String) : String
Stubbed Test Class: documentation
Requires an existing blockly documentation file assigned a type

This unit test checks if a documentation string has been returned from the requested dummy content (given by type).

- Creates a `Documentation` object
- `expected` is set to the documentation string manually
- Calls `loadContent(type)`
- Passes if `Documentation` returned equals `expected` string.

## Configuration

### +scan() : String[]
Stubbed Test Class: configuration
Requires absence of connections to any network

This unit test checks if scan returns a non-empty array of available networks to connect to.

- Creates a `Configuration` object
- Calls `scan()`
- Passes if returned String array is non-empty

### +connect(SSID: String, securityKey: String)
Stubbed Test Class: configuration
Requires access to the wireless adapter hardware

This unit test checks if connect(SSID, securityKey) sets the connectionStatus to True

- Creates a `Configuration` object
- Calls `connect(SSID, securityKey)`
- Passes if connectionStatus is True

### +close()
Stubbed Test Class: configuration
Requires a network connection

This unit test checks if close() sets the connectionStatus to False

- Creates a `Configuration` object
- Calls `close()`
- Passes if connectionStatus is False