Skip to content

Commit cb4fa1b

Browse files
authored
Merge pull request #349 from john-otoole/documentation-fixes
Minor updates to the MD documentation files
2 parents d160610 + ebd0369 commit cb4fa1b

File tree

9 files changed

+80
-80
lines changed

9 files changed

+80
-80
lines changed

development/readme.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Build Folder
22

3-
Contains the build scripts that can be run locally on a developers machine to build run and test utPLSQL.
3+
Contains the build scripts that can be run locally on a developer's machine to build, run and test utPLSQL.
44

5-
These scripts are also used by Jenkins Continuous integration server to check each pull request before it is merged.
5+
These scripts are also used by the Jenkins Continuous Integration server to check each pull request before it is merged.
66

development/releasing.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
Release process is automated in following way:
2-
1) with every build, the build process on travis updatse files with appropriate version number before deployment into db.
1+
The release process is automated in the following way:
2+
1) With every build, the build process on Travis updates files with an appropriate version number before deployment into the database.
33
This is to confirm that the update of versions works properly.
4-
2) when build is executed on a branch named `release/v1.2.3-something` then additional steps are taken:
5-
- project version in files: `sonar-project.properties`, `VERSION` is updated from the version number derived from release branch
6-
- changes on those two files are committed and and pushed - this should happen only once, when the release branch is initially created on the main repo
4+
2) When a build is executed on a branch named `release/v1.2.3-something` then additional steps are taken:
5+
- the project version in files: `sonar-project.properties`, `VERSION` is updated from the version number derived from the release branch
6+
- changes to those two files are committed and pushed - this should happen only once, when the release branch is initially created on the main repo
77
3) To create a release, just create a tag on the code to be released. The tag name must match the regex pattern: `^v[0-9]+\.[0-9]+\.[0-9]+.*$`
88
- When a tag build is executed, the documentation is built and files are uploaded to the tag.
99
- The version number is derived from the tag name.
10-
4) Release version do not provide access to unversioned source files (the default zip file from github is empty).
11-
The sources for release are provided in separate zip files delivered from travis build process.
10+
4) The release version does not provide access to unversioned source files (the default zip file from GitHub is empty).
11+
The sources for release are provided in separate zip files delivered from the Travis build process.

docs/about/CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## How to contribute ##
22

3-
The following are the guidelines, everyone should use to contribute to utPLSQL.
3+
The following are the guidelines everyone should use to contribute to utPLSQL.
44
Changes are welcome from all members of the Community.
55

66
## Getting Started ##

docs/about/support.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# How to get support
22

3-
- Feel free post questions, bugs or issues in the [issues area of GitHub](https://github.com/utPLSQL/utPLSQL/issues).
4-
- Join developers the [utPLSQL team](http://utplsql-slack-invite.herokuapp.com) on [Slack](https://slack.com/)
3+
- Feel free to post questions, bugs or issues in the [issues area of GitHub](https://github.com/utPLSQL/utPLSQL/issues)
4+
- Join developers at the [utPLSQL team](http://utplsql-slack-invite.herokuapp.com) on [Slack](https://slack.com/)

docs/userguide/annotations.md

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ Procedure annotations are defined right before the procedure they reference, no
1717

1818
If a package specification contains `%suite` annotation, it is treated as a test package and processed by the framework.
1919

20-
Some annotations accept parameters like `%suite`, `%test` `%displayname`. The parameters for annotations need to be placed in brackets. Values for parameters should be provided without any quotation marks.
20+
Some annotations accept parameters like `%suite`, `%test` and `%displayname`. The parameters for annotations need to be placed in brackets. Values for parameters should be provided without any quotation marks.
2121

22-
# <a name="example"></a>Example of annotated test package
22+
# <a name="example"></a>Example of an annotated test package
2323

2424
```sql
2525
create or replace package test_pkg is
@@ -87,9 +87,9 @@ end test_pkg;
8787

8888
It is very likely that the application for which you are going to introduce tests consists of many different packages or procedures/functions. Usually procedures can be logically grouped inside a package, there also might be several logical groups of procedure in a single package or even packages themselves might relate to a common module.
8989

90-
Lets say you have a complex insurance application the operates with policies, claims and payments. The payment module contains several packages for payment recognition, charging, planning etc. The payment recognition module among others contains a complex `recognize_payment` procedure that associates received money to the policies.
90+
Let's say you have a complex insurance application that deals with policies, claims and payments. The payment module contains several packages for payment recognition, charging, planning etc. The payment recognition module among others contains a complex `recognize_payment` procedure that associates received money to the policies.
9191

92-
If you want to create tests for your application it is recommended to structure your tests similarly to the logical structure of you application. So you end up with something like:
92+
If you want to create tests for your application it is recommended to structure your tests similarly to the logical structure of your application. So you end up with something like:
9393
* Integration tests
9494
* Policy tests
9595
* Claim tests
@@ -98,7 +98,7 @@ If you want to create tests for your application it is recommended to structure
9898
* Payments set off
9999
* Payouts
100100

101-
The `%suitepath` annotation is used for such grouping. Even though test packages are defined in a flat structure the `%suitepath` is used by the framework to form a hierarchical structure of them. Your payments recognition test package might look like:
101+
The `%suitepath` annotation is used for such grouping. Even though test packages are defined in a flat structure the `%suitepath` is used by the framework to form them into a hierarchical structure. Your payments recognition test package might look like:
102102

103103
```sql
104104
create or replace package test_payment_recognition as
@@ -136,10 +136,10 @@ create or replace package test_payment_set_off as
136136
end test_payment_set_off;
137137
```
138138

139-
When you execute tests for your application, the framework constructs test suite for each test package. Then in combines suites into grouping suites by the `%suitepath` annotation value so that the fully qualified path to the `recognize_by_num` procedure is `USER:payments.test_payment_recognition.test_recognize_by_num`. If any of its expectations fails then the test is marked as failed, also the `test_payment_recognition` suite, the parent suite `payments` and the whole run is marked as failed.
140-
The test report indicates which expectation has failed on the payments module. The payments recognition submodule is causing the failure as `recognize_by_num` has is not meeting the expectations of the test. Grouping tests into modules and submodules using the `%suitepath` annotation allows you to logically organize your projects flat structure of packages int functional groups.
139+
When you execute tests for your application, the framework constructs a test suite for each test package. Then it combines suites into grouping suites by the `%suitepath` annotation value so that the fully qualified path to the `recognize_by_num` procedure is `USER:payments.test_payment_recognition.test_recognize_by_num`. If any of its expectations fails then the test is marked as failed, also the `test_payment_recognition` suite, the parent suite `payments` and the whole run is marked as failed.
140+
The test report indicates which expectation has failed on the payments module. The payments recognition submodule is causing the failure as `recognize_by_num` has not met the expectations of the test. Grouping tests into modules and submodules using the `%suitepath` annotation allows you to logically organize your project's flat structure of packages into functional groups.
141141

142-
Additional advantage of such grouping is the fact that every element level of the grouping can be an actual unit test package containing module level common setup for all of the submodules. So in addition to the packages mentioned above you could have following package.
142+
An additional advantage of such grouping is the fact that every element level of the grouping can be an actual unit test package containing a common module level setup for all of the submodules. So in addition to the packages mentioned above you could have the following package.
143143
```sql
144144
create or replace package payments as
145145

@@ -153,38 +153,38 @@ create or replace package payments as
153153

154154
end payments;
155155
```
156-
A `%suitepath` can be provided in tree ways:
157-
* schema - execute all test in the schema
158-
* [schema]:suite1[.suite2][.suite3]...[.procedure] - execute all tests in all suites from suite1[.suite2][.suite3]...[.procedure] path. If schema is not provided, then current schema is used. Example: `:all.rooms_tests`.
159-
* [schema.]package[.procedure] - execute all tests in the test package provided. The whole hierarchy of suites in the schema is build before, all before/after hooks of partn suites for th provided suite package are executed as well. Example: `tests.test_contact.test_last_name_validator` or simply `test_contact.test_last_name_validator` if `tests` is the current schema.
156+
A `%suitepath` can be provided in three ways:
157+
* schema - execute all tests in the schema
158+
* [schema]:suite1[.suite2][.suite3]...[.procedure] - execute all tests in all suites from suite1[.suite2][.suite3]...[.procedure] path. If schema is not provided, then the current schema is used. Example: `:all.rooms_tests`
159+
* [schema.]package[.procedure] - execute all tests in the specified test package. The whole hierarchy of suites in the schema is built before all before/after hooks or part suites for the provided suite package are executed as well. Example: `tests.test_contact.test_last_name_validator` or simply `test_contact.test_last_name_validator` if `tests` is the current schema.
160160

161161
# Using automatic rollbacks in tests
162162

163-
By default, changes performed by every setup, cleanup and test procedure is isolated using savepoint.
164-
This solution is suitable for use-cases, where the code that is getting tested as well as the unit tests themselves do not use transaction control (commit/rollback) or DDL commands.
163+
By default, changes performed by every setup, cleanup and test procedure are isolated by savepoints.
164+
This solution is suitable for use-cases where the code that is getting tested as well as the unit tests themselves do not use transaction control (commit/rollback) or DDL commands.
165165

166166
In general, your unit tests should not use transaction control as long as the code you are testing is not using it too.
167-
Keeping the transactions uncommitted allows your changes to be isolated and the execution of tests is not impacting others that might be using a shared development database.
167+
Keeping the transactions uncommitted allows your changes to be isolated and the execution of tests does not impact others who might be using a shared development database.
168168

169-
If you are in situation, where the code you are testing, is using transaction control (common case with ETL code), then your tests probably should not use the default automatic transaction control.
170-
In that case use the annotation `-- %rollback(manual)` on the suite level to disable automatic transaction control for entire suite.
169+
If you are in a situation where the code you are testing uses transaction control (common case with ETL code), then your tests probably should not use the default automatic transaction control.
170+
In that case use the annotation `-- %rollback(manual)` on the suite level to disable automatic transaction control for the entire suite.
171171
If you are using nested suites, you need to make sure that the entire suite all the way to the root is using manual transaction control.
172172

173173
It is possible with utPLSQL to change the transaction control on individual suites or tests that are part of complex suite.
174-
It is strongly recommended not to have mixed transaction control in suite.
174+
It is strongly recommended not to have mixed transaction control in a suite.
175175
Mixed transaction control settings will not work properly when your suites are using shared setup/cleanup with beforeall, afterall, beforeeach or aftereach annotations.
176-
Your suite will most probably fail with error or warning on execution. Some of the automatic rollbacks will most probably fail to execute depending on the configuration you have.
176+
Your suite will most likely fail with error or warning on execution. Some of the automatic rollbacks will probably fail to execute depending on the configuration you have.
177177

178-
In some cases it is needed to perform DDL as part of setup or cleanup for the tests.
179-
It is recommended to move such DDL statements to a procedure with `pragma autonomous_transaction` to eliminate implicit commit in the main session that is executing all your tests.
180-
Doing so, allows your test to use automatic transaction control of the framework and release you from the burden of manual cleanup of data that was created or modified by test execution.
178+
In some cases it is necessary to perform DDL as part of setup or cleanup for the tests.
179+
It is recommended to move such DDL statements to a procedure with `pragma autonomous_transaction` to eliminate implicit commits in the main session that is executing all your tests.
180+
Doing so allows your tests to use the framework's automatic transaction control and releases you from the burden of manual cleanup of data that was created or modified by test execution.
181181

182-
When you are running test of code that is performing an explicit or implicit commit, you may set the test procedure to run in autonomous transaction with `pragma autonomous_transaction`.
183-
Keep in mind, that when your tests runs in autonomous transaction it will not see the data prepared in setup procedure unless the setup procedure committed the changes.
182+
When you are testing code that performs explicit or implicit commits, you may set the test procedure to run as an autonomous transaction with `pragma autonomous_transaction`.
183+
Keep in mind that when your tests runs in autonomous transaction it will not see the data prepared in setup procedure unless the setup procedure committed the changes.
184184

185185
# Order of execution
186186

187-
When processing the test suite `test_pkg` defined in [Example of annotated test package](#example), the execution will be done in the following order.
187+
When processing the test suite `test_pkg` defined in [Example of annotated test package](#example), the order of execution will be as follows.
188188

189189
```
190190
create a savepoint 'beforeall'

docs/userguide/best-practices.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
# Best Practices
22

3-
The following are best practices we as utPLSQL have learned about PL/SQL and Unit Testing.
3+
The following are best practices we at utPLSQL have learned about PL/SQL and Unit Testing.
44

55
## Test Isolation and Dependency
66

77
- Tests should not depend on a specific order to run
88
- Tests should not depend on other tests to execute
9-
- Tests should not depend on specific database state, they should setup the expected state before run
10-
- Tests should keep environment unchanged post execution
9+
- Tests should not depend on specific database state, they should setup the expected state before being run
10+
- Tests should keep the environment unchanged post execution
1111

1212

1313
## Writing tests
@@ -21,26 +21,26 @@ The following are best practices we as utPLSQL have learned about PL/SQL and Uni
2121
- Each tested procedure/function/trigger (code block) should have more than one test
2222
- Each test should check only one behavior (one requirement) of the code block under test
2323
- Tests should be maintained as thoroughly as production code
24-
- Every test needs to be build so that it can fail, tests that do not fail when needed are useless
24+
- Every test needs to be built so that it can fail, tests that do not fail when needed are useless
2525

2626
## Gaining value from the tests
2727

28-
- Tests are only valuable if they are executed frequently, ideally - with every change to the project code
29-
- Tests need to run very fast, the slower the tests - the longer you wait. Build tests with performance in mind (do you need to have 10k rows to run the tests?)
30-
- Tests, that are not executed frequently enough get rotten pretty fast and bring burden instead of value. Maintain tests as you maintain code.
31-
- Tests that are failing, need to be addressed immediately. How can you trust tour tests when 139 of 1000 tests are failing for a month? Will you be able to see each time that it is still the same 139 tests?
28+
- Tests are only valuable if they are executed frequently; ideally with every change to the project code
29+
- Tests need to run very fast; the slower the tests, the longer you wait. Build tests with performance in mind (do you really need to have 10k rows to run the tests?)
30+
- Tests that are executed infrequently can quickly become stale and end up adding overhead rather than value. Maintain tests as you would maintain code.
31+
- Tests that are failing need to be addressed immediately. How can you trust your tests when 139 of 1000 tests are failing for a month? Will you recognise each time that it is still the same 139 tests?
3232

3333
## Tests are not for production
3434

35-
Tests generate will generate and operate on fake data. They might insert/update and delete data. You don't want tests to run on production database and touch on real-life data.
35+
Tests will generate and operate on fake data. They might insert, update and delete data. You don't want tests to run on a production database and affect real life data.
3636

37-
## Tests and their relationship to code under test.
38-
- Code under test and tests should be in separate packages. This is fundamental separation of responsibilities.
39-
- Test code commonly will be in the same schema as the tested code. This removes the need to manage privileges for the tests.
37+
## Tests and their relationship to code under test
38+
- Tests and the code under test should be in separate packages. This is a fundamental separation of responsibilities.
39+
- It is common for test code to be in the same schema as the tested code. This removes the need to manage privileges for the tests.
4040

4141
## Version Control
4242

4343
Use a version control system for your code.
4444
Don't just trust the database for code storage.
4545
This includes both the code under test, and the unit tests you develop as well.
46-
Treat database as target, destination for your code not as a source of it.
46+
Treat the database as a target/destination for your code, not as a source of it.

0 commit comments

Comments
 (0)