D3. Test Plan

First: What we would complete given time

Unit Testing

  • Write tests for each iteration of the filter and ensure optimal functionality
  • Write tests for the watch connectivity to ensure the connect of the watch and phone is reliable
  • Write tests checking the data we receive from the gyroscope and accelerometer api
  • Write tests for the accelerometer and gyroscope data transfer

Integration and System Testing

  • Integrate the watch development and the kalman filter development into the main code base
  • Test filter with the data received from the camera and aruco markers
  • Test filter with the data that is being generated from the watch ( accelerometer and gyroscope)
  • Test filter with both streams of data (camera/aruco markers and accelerometer/gyroscope)
  • Ensure the noise is being calmed with the filters vs. the initial implementation of the App

Descriptions of Tools Used

  • XCTest will be used for the unit testing of the Swift code

Descriptions of Types of End Users

  • A Neurosurgeon performing neurosurgery
  • Any hospital staff assisting with the surgery that is taking place

Performance, Reliability, etc. Testing

  • Test reliability of watch data over a long session of use
  • Optimize the performance of the kalman filters

Acceptance Testing

  • Show client our progress and confirm the code and testing is sufficient
  • Ideally end testing for this product would be tested in a surgery type of environment with an animal test subject since this product is intended to be used during human neurosurgery

Second: What our team will test in the time given

Unit Testing

  • Write tests that check the delay of data streamlining form the apple watch to the iPhone
  • Write tests to check the accuracy of multiple layers of data checking (Acceleration, Position, Velocity checks)

Integration and System Testing

  • N/A

Descriptions of Tools Used

  • XCTest will be used for the unit testing of the Swift code

Descriptions of Types of End Users

  • A Neurosurgeon performing neurosurgery
  • Any hospital staff assisting with the surgery that is taking place

Performance, Reliability, etc. Testing

  • Optimize the performance of the kalman filters

Acceptance Testing

  • Show client our progress and confirm the code and testing is sufficient


Unit Test Code:
import XCTest
@testable import KalmanFilter

class KalmanFilterTests: XCTestCase {
    
    func testInitialization() {
        let initialState = SIMD3<Double>(1.0, 1.0, 1.0)
        let initialErrorCovariance = SIMD3<Double>(1.0, 1.0, 1.0)
        let filter = KalmanFilter(initialState: initialState, initialErrorCovariance: initialErrorCovariance)

        XCTAssertEqual(filter.state, initialState)
        XCTAssertEqual(filter.errorCovariance, initialErrorCovariance)
    }

    func testUpdateMethod() {
        let filter = KalmanFilter(initialState: SIMD3<Double>(0.0, 0.0, 0.0), initialErrorCovariance: SIMD3<Double>(1.0, 1.0, 1.0))
        let measurement = SIMD3<Double>(2.0, 2.0, 2.0)
        filter.update(measurement: measurement)
    }

    func testProcessAccelerometerData() {
        let filter = KalmanFilter(initialState: SIMD3<Double>(0.0, 0.0, 0.0), initialErrorCovariance: SIMD3<Double>(1.0, 1.0, 1.0))
        let newData = SIMD3<Double>(3.0, 3.0, 3.0)
        filter.processAccelerometerDataWithKalmanFilter(newData: newData)
    }
}