Skip to content

Commit d9ee5c9

Browse files
author
Amanda Butler
authored
Copy edit unit_testing.md
Copy edit file, mostly for active voice.
1 parent bac0962 commit d9ee5c9

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

docs/tools/testing/unit_testing.md

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
### Introduction
44

5-
Traditional software testing is defined into three main levels: unit testing, integration testing and system testing. These levels are often pictured as a pyramid to indicate the amount of testing per level.
5+
Traditional software testing is defined into three main levels: unit testing, integration testing and system testing. These levels are often pictured as a pyramid to indicate the amount of testing for each level.
66

77
```
88
^ Testing level
@@ -18,30 +18,28 @@ Traditional software testing is defined into three main levels: unit testing, in
1818
*-------------------> Amount of tests
1919
```
2020

21-
Integration and system testing are performed in an environment where the tests are run with full Mbed OS. Other testing tools for Mbed OS require specific embedded hardware and whole Mbed OS to be built, which means traditional unit testing is not possible.
21+
We perform integration and system testing in an environment where we run the tests with the full Mbed OS. Other testing tools for Mbed OS require specific embedded hardware, which means traditional unit testing is not possible.
2222

23-
Unit testing takes place in a build environment where each C/C++ class or module is tested in isolation. This means test suites are built into separate test binaries and all access outside is stubbed to remove dependency of any specific embedded hardware or software combination. This allows the testing to be done quickly using native compilers on the build machine.
23+
Unit testing takes place in a build environment where we test each C or C++ class or module in isolation. This means we build test suites into separate test binaries and stub all access outside to remove dependencies on any specific embedded hardware or software combination. This allows us to complete the testing using native compilers on the build machine.
2424

2525
### Using unit tests
2626

2727
#### Test code structure
2828

29-
Unit tests are located in Mbed OS repository under `UNITTESTS`. Each unit test should use identical directory tree structure to the file to be tested. This makes it easier to find unit tests for a particular class or a module. For example if the file to be tested is `rtos/Semaphore.cpp` then all the test files should be in `UNITTESTS/rtos/Semaphore` directory.
29+
Unit tests are located in Mbed OS repository under `UNITTESTS`. Each unit test uses an identical directory tree structure to the file to be tested. This makes it easier to find unit tests for a particular class or a module. For example, if the file to be tested is `rtos/Semaphore.cpp`, then all the test files are in the `UNITTESTS/rtos/Semaphore` directory.
3030

3131
##### Test discovery
3232

33-
Registering unit tests for running is automatic and handled by the test runner, but test files are not automatically assigned to be built. Unit tests are built using a separate build system, which will search for unit tests under `UNITTESTS` directory.
33+
Registering unit tests for running is automatic, and the test runner handles registration. However, test files are not automatically assigned to be built. We build unit tests by using a separate build system, which searches for unit tests under the `UNITTESTS` directory.
3434

35-
For the build system to find and build any test suite automatically, a unit test configuration file named `unittest.cmake` is required to be included with each unit test. This configuration file contains a name for the test and other source files required for the build.
35+
For the build system to find and build any test suite automatically, a unit test configuration file named `unittest.cmake` is required to be included with each unit test. This configuration file contains a name for the test and other source files the build requires.
3636

3737
##### Test names
3838

3939
Each test suite requires a name to be configured in the `unittest.cmake` file. This name is used for generated files and when running a subset of tests.
4040

4141
#### Building, running and writing tests
4242

43-
Unit testing requires external tools which need to be installed. See the developer [documentation](https://github.com/ARMmbed/mbed-os/blob/master/UNITTESTS/README.md) in GitHub for installation guide.
43+
Unit testing requires external tools you need to install. See the developer [documentation](https://github.com/ARMmbed/mbed-os/blob/master/UNITTESTS/README.md) in GitHub for the full installation guide.
4444

45-
You can build and run unit tests through Arm Mbed CLI. The tool can also be used to generate new test files. For information on using Mbed CLI, please see the [CLI documentation](/docs/development/tools/arm-mbed-cli.html).
46-
47-
For more information about the framework, the build process or how to write unit tests, see the GitHub documentation.
45+
You can build and run unit tests through Arm Mbed CLI. You can also use the tool to generate new test files. For information on using Mbed CLI, please see the [CLI documentation](/docs/development/tools/arm-mbed-cli.html).

0 commit comments

Comments
 (0)