Software Development

LogicGem is a decision table processor which is useful at all levels of the software development process.

  • High-level decision tables can be easily read and filled out by non-programmers. This makes them an ideal way to capture user specifications at analysis time. The high-level tables can generate English language documentation as a deliverable product.
  • Decision tables can be automatically tested for all possible combinations of conditions. If any combinations are not covered by the program logic, the analyst or programmer knows it immediately from the LogicGem screen. If any combination of conditions causes contradictory actions, the analyst or programmer knows it immediately. These things are not obvious from looking at a problem with thousands of possible states.
  • Low-level decision tables can automatically generate program modules which have been formally proven to cover all possible combinations of conditions in a non-contradictory fashion. Furthermore, the generated code will be optimized in a manner specified by the programmer.

LogicGem includes a decision table editor which has an interface similar to using a spreadsheet. The group of rows at the top are the conditions you enter; the bottom group are the actions you want to perform. Each column in the decision table defines a rule related to those conditions and actions.

Research has shown that most defects occur during the design phase, and they are usually errors in program logic, not in computation. Decision tables are useful at all phases of software development for the simple reason that all phases of software development need correct logic. The only thing that changes is the conceptual level of the conditions and actions given in the tables. The analysis phase will use high level concepts, the design phase will use lower-level concepts and the coding phase will have actual computer language code in the table.

Decision Tables

Decision tables are easy to read and can convey more information in a smaller space and clearer format than flowcharting, pseudo-code, narratives and other conventional documentation techniques. They are also easier for both analysts and users to construct and alter than conventional system analysis techniques. The non-analyst user can be given an empty decision table and be asked to fill it out themselves. They can provide information to the systems analyst which would normally require intensive interviews and a great deal of time to obtain.

Tables can be used to automatically generate source code in any programming language which supports if/then/else or switch/case control constructs. While the time saved by generating code would be worth the effort of learning decision tables, there are other benefits.

Code Generation

The first benefit is that the code from a perfected table will have far fewer bugs and less complexity than a program written by a human programmer. A human being has extreme difficulty in keeping in mind more than six or seven things at the same time. As the number of decisions in a module approaches ten, it is increasingly harder to understand and maintain. This is why most bugs are control flow problems, and not computations.

The second benefit is that LogicGem can optimize the generated code by considering the relative cost and frequency of the whole table. The cost of a rule is a number assigned to performing the associated actions of the rule. The cost can be subjective (estimated difficulty on a scale from one to ten) or objective (actual computer time and resources used). For example, “write a letter” would have a lower cost than “write an epic poem” on a subjective scale.

The frequency of a rule is how often the rule is expected to be invoked. The frequency can be estimated or actual, and is often expressed as a percentage for convenience. For example, an automobile insurance company might know that 80% of their clients are males between the ages of 18 and 25 who have not taken a drivers education course. This frequency information would be used to optimize generated computer source code.

Project Maintenance

LogicGem is also a powerful maintenance tool. Even the best program will perform badly if its environment changes. For example, a program written for the automobile insurance company may slow down when 80% of their clients are females over 45 years of age who have taken a drivers education course. Cost and frequency are independent of each other, and both are independent of the structure of the table.

LogicGem enables the analyst to change cost and frequency for the rules and immediately create completely new optimized source code at the push of a button. Furthermore, an option in the generated computer source code will save the frequency information, so that the program can be changed as the environment changes.