mirror of
https://github.com/Stone-Red-Code/website.git
synced 2026-09-06 16:06:12 +02:00
style: format codebase with Prettier
This commit is contained in:
@@ -6,12 +6,13 @@ title: "Chapter 7: Testing"
|
||||
---
|
||||
|
||||
## Chapter 7: Testing.
|
||||
Im assuming most of the testing has been done by hand up to this point but this isn't really
|
||||
scalable as a long term solution. This is where unit testing comes in, all projects should have tests that cover
|
||||
at least the bare minimum of cases that are expected. This project is no different.
|
||||
|
||||
Pretty much all languages have some sort of unit test functionality, to make connections and assert things.
|
||||
We will need to write a bit of code to be able to facilitate the unit testing. You will now need to create a
|
||||
Im assuming most of the testing has been done by hand up to this point but this isn't really
|
||||
scalable as a long term solution. This is where unit testing comes in, all projects should have tests that cover
|
||||
at least the bare minimum of cases that are expected. This project is no different.
|
||||
|
||||
Pretty much all languages have some sort of unit test functionality, to make connections and assert things.
|
||||
We will need to write a bit of code to be able to facilitate the unit testing. You will now need to create a
|
||||
tcp client that can connect and you can send and receive lines via, this will help with testing the project as
|
||||
a whole.
|
||||
|
||||
@@ -23,16 +24,16 @@ fun test_get_definition() {
|
||||
assert(line == "ANSWER something interesting here\n");
|
||||
}
|
||||
```
|
||||
|
||||
The idea here is to try and test all the functionality of your program and use the above tests to identify what may be going wrong.
|
||||
|
||||
Coverage is a reasonably good metric for establishing if your code is well tested. Coverage is identifying what lines
|
||||
Coverage is a reasonably good metric for establishing if your code is well tested. Coverage is identifying what lines
|
||||
are covered by unit tests and what lines are not.
|
||||
|
||||
|
||||
## Goals
|
||||
|
||||
- Unit test any verbs defined in the previous chapter.
|
||||
|
||||
## Bonus goals
|
||||
|
||||
- Reach a 90% test coverage.
|
||||
- Reach a 90% test coverage.
|
||||
|
||||
Reference in New Issue
Block a user