Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f1e98e8

Browse files
committed
Minor updates to documentation.
- Updated Key features in readme.md - Added link to documentation in readme.md - Added cheat-sheet - Updated best-practices.md
1 parent b130306 commit f1e98e8

4 files changed

Lines changed: 59 additions & 18 deletions

File tree

docs/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ The framework follows industry standards and best patterns of modern Unit Testin
1616
- [Using reporters](userguide/reporters.md)
1717
- [Reporting errors](userguide/exception-reporting.md)
1818
- [Code coverage](userguide/coverage.md)
19+
- [Cheat Sheet](utplsql-v3-cheat-sheet.pdf)
1920
- About
2021
- [Project Details](about/project-details.md)
2122
- [License](about/license.md)

docs/userguide/best-practices.md

Lines changed: 34 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,45 @@
22

33
The following are best practices we as utPLSQL have learned about PL/SQL and Unit Testing.
44

5-
6-
## Test Interaction
7-
8-
- Tests should not depend on a specific order to run.
9-
- Tests should not depend on other tests to execute.
10-
- A developer should be able to run one or more tests of their choosing with out any prerequisites.
5+
## Test Isolation and Dependency
6+
7+
- Tests should not depend on a specific order to run
8+
- 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
11+
12+
13+
## Writing tests
14+
15+
- Tests should not mimic / duplicate the logic of tested code
16+
- Tests should contain zero logic (or as close to zero as possible)
17+
- The 3A rule:
18+
- Arrange (setup inputs/data/environment for the tested code)
19+
- Act (execute code under test)
20+
- Assert (validate the outcomes of the execution)
21+
- Each tested procedure/function/trigger (code block) should have more than one test
22+
- Each test should check only one behavior (one requirement) of the code block under test
23+
- 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
25+
26+
## Gaining value from the tests
27+
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?
1132

1233
## Tests are not for production
1334

14-
Tests generate will generate fake data, so it should go without saying. You should not deploy your tests to a production database.
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.
1536

1637
## Tests and their relationship to code under test.
17-
- Code that you want to test, and the tests should be in separate packages.
18-
- Test code commonly will be the same schema as code
19-
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.
2040

2141
## Version Control
2242

23-
Use a version control system for your code. Don't just trust the database for code storage. This includes both the code you have under test, and the unit tests you develop as well.
24-
43+
Use a version control system for your code.
44+
Don't just trust the database for code storage.
45+
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.

docs/utplsql-v3-cheat-sheet.pdf

60 KB
Binary file not shown.

readme.md

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,20 @@ utPLSQL is a Unit Testing framework for Oracle PL/SQL and SQL.
2020
The framework follows industry standards and best patterns of modern Unit Testing frameworks like [JUnit](http://junit.org/junit4/) and [RSpec](http://rspec.info/)
2121

2222

23+
# Key features
24+
25+
- multiple ways to compare data with [matchers](docs/userguide/expectations.md)
26+
- native comparison of complex types (objects/collections/cursors)
27+
- in-depth and consistent reporting of failures and errors for tests
28+
- tests identified and configured by [annotations](docs/userguide/annotations.md)
29+
- hierarchies of test suites configured with annotations
30+
- automatic (configurable) transaction control
31+
- Build-in [coverage](docs/userguide/coverage.md) reporting
32+
- Integration with SonarQube, Coveralls, Jenkins and Teamcity with [reporters](docs/userguide/reporters.md)
33+
- plugin architecture for reporters and matchers
34+
- flexible and simple test invocation
35+
- multi-reporting from test-run from [command line](docs/userguide/ut_run-script.md)
36+
2337
# Primary features
2438
- Support for all basic scalar data-types except ROWID and RAW
2539
- Support for User Defined Object Types and Collections
@@ -38,12 +52,16 @@ The framework follows industry standards and best patterns of modern Unit Testin
3852
- Published upgrade/conversion path from version 2 ( TODO )
3953

4054
Requirements:
41-
- Version of Oracle under [Extend Support](http://www.oracle.com/us/support/library/lifetime-support-technology-069183.pdf) (Currently 11.2 and above)
55+
- Version of Oracle under [extended support](http://www.oracle.com/us/support/library/lifetime-support-technology-069183.pdf) (Currently 11.2 and above)
4256

43-
__Download__
57+
# Download
4458

4559
Published releases are available for download on the [utPLSQL GitHub Releases Page.](https://github.com/utPLSQL/utPLSQL/releases)
4660

61+
# Documentation
62+
63+
Full documentation of the project is automatically published on [utPLSQL github pages](https://utplsql.github.io/utPLSQL/)
64+
4765
# Contributing to the project
4866

4967
We welcome new developers to join our community and contribute to the utPLSQL project.
@@ -223,7 +241,7 @@ __Project Directories__
223241
* .travis - contains files needed for travis-ci integration
224242
* client_source - Sources to be used on the client-side. Developer workstation or CI platform to run the tests.
225243
* development - Set of useful scripts and utilities for development and debugging of utPLSQL
226-
* docs/md - Markdown version of the documentation
227-
* examples - contains example unit tests.
228-
* source - contains the installation code for utPLSQL
229-
* tests - contains the tests for utPLSQL framework
244+
* docs - Documentation of the project
245+
* examples - Example source code and unit tests
246+
* source - The installation code for utPLSQL
247+
* tests - Tests for utPLSQL framework

0 commit comments

Comments
 (0)