This repository has been archived by the owner on Jan 26, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 117
Tests
Anatolij Zelenin edited this page May 14, 2014
·
1 revision
We want to improve the code quality of Mirakel.
- Models
- Helpers
- Sync
- Interactive stuff
- Sync
- The progress must be visible
- Measuring code quality
- Measuring test coverage
- Every new function must have a test for it (Otherwise no +2)
- Every new feature must have a functional test for it (Otherwise no +2)
- Every non-hotfix must have tests for the fixed
- A hotfix is:
- Many users are affected
- It's a critical crash
- Absolute sync failures
- A hotfix is:
- Every commit must improve the code quality
- No dirty hacks if there is an alternative
- Models
- Sync
- Helpers
- Loose functions
We should write a script which generates the test code. Basically we want to test the following:
let a
F.setA(a)
F.getA() == a
For every test class we need a clean demo database!
If possible we should write scripts for that
- count +1
- All old datasets exists
- a → insert → get → == a (except id)
- count ==
- all ids exist
- a → update → get → == a (repeat this x times)
- no changes where there shouldn't be
- as Update
- No wrong changes
- Only deleted what should be deleted
- Delete m:n stuff
Here we should be very careful!
- Test vis a vis with hand written select
- Test different variations
- Test all possible parameter variations
Here we should be very careful!
In doubt: rewrite constructors
Test table names in request <=> ALL_FIELDS array <=> Constructor param
Handwritten item => handwritten JSON == generated JSON => check correctness
Do not forget to test all possible params
Input String → parse → toJSON == Input
Input string → parse == handwritten JSON
Using the tests of taskwarrior
We should test every feature independently + random combinations + all data + syntax errors + UDA