Programmer documentation
Time-table and life cycle at the end of the project
Planned
- 2014/10/09 Requirement specification (costs, milestones, exact descripton, analysis, etc.) /project definition and analysis/
- 2014/12/04 Systemplan (classes, methods, input-output, data storage, etc.) /software architecture/
- 2014/12/20 The working program /implementation, testing, release/
- 2015/01/04 Developer documentation /support/
- 2015/01/12 User documentation /support/
Reality
- 2014/10/09 Requirement specification (costs, milestones, exact descripton, analysis, etc.) /project definition and analysis/ - This phase was done in time.
- 2014/12/04 Systemplan (classes, methods, input-output, data storage, etc.) /software architecture/ - This phase was done in time.
- 2015/01/10 The working program /implementation, testing, release/ - 3 weeks delay
- 2015/01/10 Developer documentation /support/ - 3 weeks delay
- 2015/01/11 User documentation /support/ - 1 day before due date
Implementation
Nearly every class uses only one other class from the project. It's like a linear line of the classes
(main program <- Handler <- Database <- Table <- HeaderElement and Row <- ValueElement). But there is structure which can contain every type of a value field, this is RowElement. And there are two enumeration types, those and RowElement are used in every classes, so they are in a special header file (header.h).
Table class has a private variable actualPosition, this variable counts the actual position in a row (when you add new element to a row). So when you use Table class without Database, you can make mistakes if you don't add enough (or you add too many) row elements to a row. When you use Database class, this part of Table is safe, because Database class handles the exceptions and tries to add the exact number of elements to tha Table.
You can't add conditions to the ROW LIST and ROW DELETE commands which tries to find rows that have NULL as value. It's because you don't have to indicate string type, so NULL in a condition is handled like a string value such as "NULL". And you should avoid making conditions which have '<', '>' or '=' characters in the search value (these are not tested).
Header elements of Tables can't contain '<', '>' or '=' characters, because when you want to give a condition, you don't have to indicate which part of the command is the header name, the operator and the search value. This case is not built into the program, so you can give name such as "this>is=wrong" to a header element, but when you want to list rows which match the condition "this>is=wrong=apple", then the program'll throw an exception (can't find a header with the given name "this").
Testing of the system
1. case of tests
During the development of the classes I wrote unit tests. Those unit tests are part of the project, with DEBUG_MODE predefinition a copy of the program can be built with those unit tests.
2. case of test
After creating the Handler class as well I tested the methods with incorrect values and types. I tested the system with values at the limits. I made a lot of test to make sure of the system's stability.
3. case of tests
- After creating the Handler class as well I tested the program with these commands.
- DATABASE CREATE test
- DATABASE CREATE test
Error: already exists
- DATABASE CREATE test2
- DATABASE OPEN test
- DATABASE OPEN test
Error: already opened database
- TABLE CREATE t1 WITH [id:0:INT,name:0:STRING,avg:1:DOUBLE,bentlako:0:BOOL]
- TABLE ADD tarokk:1:BOOL TO t1
- ROW LIST t1
- TABLE ADD tarokk:0:DOUBLE TO t1
Error: already exists
- TABLE ADD valami:2:DOUBLE TO t1
Error: format is bad
- TABLE ADD valami:1:DOBLE TO t1
Error: format is bad
- TABLE CREATE t1 WITH [pid:0:INT]
Error: already exists
- TABLE CREATE t2 WITH [pid:0:INT]
- ROW ADD [1] TO t2
- ROW ADD [2] TO t2
- ROW LIST t2
- TABLE EMPTY t2
- ROW LIST t2
- ROW ADD [1] TO t2
- ROW LIST t2
- TABLE DELETE t2
- TABLE DELETE t2
Error: no table 't2'
- ROW LIST t1
- ROW ADD [1,Kovacs Mate,NULL,TRUE,TRUE] TO t1
- ROW ADD [1,Kovacs Mate,NULL,NULL,TRUE] TO t1
Error: format is bad
- ROW ADD [1,Kovacs Mate,NULL,TRUE,NULL] TO t1
- ROW ADD [2,Horvath Adam,3.45,TRUE,FALSE] TO t1
- ROW ADD [3,Csaba Gyula,2.2,FALSE,NULL] TO t1
- ROW ADD [4,Tirpak Zoltan,5.0,FALSE,TRUE] TO t1
- ROW LIST t1
- ROW LIST t1 WHERE tarokk2=valami
Error: header is missing
- ROW LIST t1 WHERE tarokk=4
Error: header is missing
- ROW LIST t1 WHERE tarokk=TRUE
- ROW DELETE t1 WHERE tarokk=TRUE
- ROW LIST t1
- ROW DELETE t1 WHERE name=Csaba Gyula
- ROW LIST t1
- ROW LIST t1 WHERE avg=2.2
- ROW LIST t1 WHERE avg=3.45
- ROW ADD [3,Marosi Marta,4.5,FALSE,TRUE] TO t1
- ROW DELETE t1 WHERE avg>3.5
- ROW LIST t1
- DATABASE CLOSE
- DATABASE OPEN test2
- DATABASE REMOVE test3
Error: no database
- DATABASE REMOVE test2