Testing Strategy

As a client side application, we test our code thoroughly with a coverage of over 90%+ (if we can count them). Therefore, we are delivering our product to client with great confidence.

Fully-automated:

  • Unit testing
  • Integration testing
  • Performance testing

Semi-automated:

  • Responsive Design testing
  • Compatibility testing
  • User Acceptance testing

Besides pure testing, we also use Continuous Integration (CI) with Travis, Jazzy documentation coverage and swiftformat code-linter formatting as part of our quality assurance process.

alternative

Unit Testing

Unit tests were among the first type of testing strategy we introduced to our application. It was initially aimed towards DataModels, APIs, and Controllers, and later expanded to all parts of the application, including Views and ViewControllers.

Contrary to common belief, ViewControllers are standalone instantiable with our Storyboard setup.

alternative

We were able to instantiate all ViewControllers on its own and feed it custom data in unit tests, hence providing a higher coverage.


Integration Testing

Our first tests written for UI are integration tests on the application as whole. Since Xcode does provide underlying support for UITesting, we utilised its built-in method and wrote our integration tests.

We made our best attempt to analyse our UI Hierarchy, and call UITesting module with accurate element tap. This gives us higher coverage, especially among UI components.

alternative

These 2 automated testing types altogether covers more than 90% of the code, as shown the coverage summary collected from LLVM below.

alternative

Performance Tests

We used Xcode's built-in XCTest for performance testing, in aspects of launching, loading a video and loading a 4K60FPS video.

alternative

Sample code of how are able to measure time is shown above.

With multiple optimisations made during our implementation stage, and making full use of the multi-threading and pre-fetching strategy, we are able to archive better results then a main-stream education resource application.

All data below are collected on Patrick's iPhone XS Max, Apple A12 Bionic@2x2.5GHz, 4x1.6GHz, 4GB RAM, testing X5GON-Mobile v0.3 and Coursera v3.6.

alternative

Responsive Design Testing

Although we have tested our application with integration UI testing on multiple platforms, we would also have to deploy them manually and try them out ourselves to make sure these UI elements are placed correctly and clearly visible to the end user.

alternative alternative

With our limited knowledge, we didn't find a way to automate this process, nor are we rich enough to own every Apple Device. However, as shown above, we made our best attempt to make full use of the simulator and adapted our application to multiple screen sizes.

Compatibility Testing

As an application developed with Swift 5 and upgraded to Swift 5.1 during the development cycle, we have very limited support for older devices. However, we do aim to support all devices with Operating System version newer than iOS 13.0 and iPadOS 13.0.

To do backwards compatibility testing, we provided CI test scripts so as to test on earlier platforms we do not have.

See actual scripts below for detailed information.

alternative

User Acceptance Testing

To gain an overview of how our application is doing and find out about potential improvements, we asked 4 people from various backgrounds to test our application and subsequently recorded their feedbacks.

Testers

alternative

Monica

alternative

Mark

alternative

Bang

alternative

John

Tasks

Test Case 1

We gave a user account to testers and asked them to log in. After that we set them a task to search for content related to “Climate Change”. We want them to pick some and write notes while watching those contents. Finally, they will view their bookmarked contents on the user page.

Test Case 2

The testers were given the user manual, and were asked to play around with only two requirements, one being providing feedback on the content , the other one being finding the user history page.

Test Case 3

This task is to let the tester observe the player view and provide an explanation for each section that is visible to them.

Feedback

alternative

Feedback from Client

We are very proud to say that our client is very satisfied with our work, and everything is up to his standard.

Continuous Integration

We utilised Continuous Integration extensively throughout the validation process of our application. Since version v0.1 (prototype 1), we imported Travis as our CI platform and tested almost all PRs with CI before merging.

Since then, we have made more than 350 builds and 40 types of tests. We believe this is also an important part on how we deploy our testing strategies to everyday development.

alternative

Documentation Coverage

Technically speaking, as a client-facing application, documentation would not be such an urgent need like an API-based software. Despite this, we are proud to announce that we have archived a documentation coverage of higher than 85%.

alternative

Although documentation coverage is not an actual test, we take it as an validation process of making sure we understand every bit of our code, and make them ready to be presented to clients and to be developed in the future.

An online published version of documentation can be found here.

Testing and Formatting at Development Stage with Git Hook

We recognise the importance of eliminating human errors in code development and follow good automation practices. Therefore, we use swiftformat and hook it to Git, so as to force the execution of linting and formatting process before every single code commit

alternative

As developer ourselves, we are amazed at how automation could eliminate certain easy but hard-to-notice bugs to be committed into the code base. We believe that this is a key part of how we practice testing and validation in our development cycle.