Menu

Programmer documentation

Máté Kovács

Programmer documentation

Time-table and life cycle at the end of the project

Planned
  1. 2014/10/09 Requirement specification (costs, milestones, exact descripton, analysis, etc.) /project definition and analysis/
  2. 2014/12/04 Systemplan (classes, methods, input-output, data storage, etc.) /software architecture/
  3. 2014/12/20 The working program /implementation, testing, release/
  4. 2015/01/04 Developer documentation /support/
  5. 2015/01/12 User documentation /support/
Reality
  1. 2014/10/09 Requirement specification (costs, milestones, exact descripton, analysis, etc.) /project definition and analysis/ - This phase was done in time.
  2. 2014/12/04 Systemplan (classes, methods, input-output, data storage, etc.) /software architecture/ - This phase was done in time.
  3. 2015/01/10 The working program /implementation, testing, release/ - 3 weeks delay
  4. 2015/01/10 Developer documentation /support/ - 3 weeks delay
  5. 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
  1. After creating the Handler class as well I tested the program with these commands.
  2. DATABASE CREATE test
  3. DATABASE CREATE test
    Error: already exists
  4. DATABASE CREATE test2
  5. DATABASE OPEN test
  6. DATABASE OPEN test
    Error: already opened database
  7. TABLE CREATE t1 WITH [id:0:INT,name:0:STRING,avg:1:DOUBLE,bentlako:0:BOOL]
  8. TABLE ADD tarokk:1:BOOL TO t1
  9. ROW LIST t1
  10. TABLE ADD tarokk:0:DOUBLE TO t1
    Error: already exists
  11. TABLE ADD valami:2:DOUBLE TO t1
    Error: format is bad
  12. TABLE ADD valami:1:DOBLE TO t1
    Error: format is bad
  13. TABLE CREATE t1 WITH [pid:0:INT]
    Error: already exists
  14. TABLE CREATE t2 WITH [pid:0:INT]
  15. ROW ADD [1] TO t2
  16. ROW ADD [2] TO t2
  17. ROW LIST t2
  18. TABLE EMPTY t2
  19. ROW LIST t2
  20. ROW ADD [1] TO t2
  21. ROW LIST t2
  22. TABLE DELETE t2
  23. TABLE DELETE t2
    Error: no table 't2'
  24. ROW LIST t1
  25. ROW ADD [1,Kovacs Mate,NULL,TRUE,TRUE] TO t1
  26. ROW ADD [1,Kovacs Mate,NULL,NULL,TRUE] TO t1
    Error: format is bad
  27. ROW ADD [1,Kovacs Mate,NULL,TRUE,NULL] TO t1
  28. ROW ADD [2,Horvath Adam,3.45,TRUE,FALSE] TO t1
  29. ROW ADD [3,Csaba Gyula,2.2,FALSE,NULL] TO t1
  30. ROW ADD [4,Tirpak Zoltan,5.0,FALSE,TRUE] TO t1
  31. ROW LIST t1
  32. ROW LIST t1 WHERE tarokk2=valami
    Error: header is missing
  33. ROW LIST t1 WHERE tarokk=4
    Error: header is missing
  34. ROW LIST t1 WHERE tarokk=TRUE
  35. ROW DELETE t1 WHERE tarokk=TRUE
  36. ROW LIST t1
  37. ROW DELETE t1 WHERE name=Csaba Gyula
  38. ROW LIST t1
  39. ROW LIST t1 WHERE avg=2.2
  40. ROW LIST t1 WHERE avg=3.45
  41. ROW ADD [3,Marosi Marta,4.5,FALSE,TRUE] TO t1
  42. ROW DELETE t1 WHERE avg>3.5
  43. ROW LIST t1
  44. DATABASE CLOSE
  45. DATABASE OPEN test2
  46. DATABASE REMOVE test3
    Error: no database
  47. DATABASE REMOVE test2

Related

Wiki: Home

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.